Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathematica language issues

  • To: mathgroup at
  • Subject: [mg53020] Re: Mathematica language issues
  • From: Bill Rowe <readnewsciv at>
  • Date: Mon, 20 Dec 2004 06:34:38 -0500 (EST)
  • Sender: owner-wri-mathgroup at

On 12/19/04 at 11:44 AM, drbob at (DrBob) wrote:

>>>Compile[{}, Module[{x = 0}, While[x++, EvenQ[x]]; x]][] also
>>>outputs 1.

>It's not surprising. The value of x++ is 1 and that's not True, so
>While exits on the first iteration.

While I understand what is going on, it still seems surprising that things would work. Since the expected syntax is While[test, body], I can see an argument for expecting While[body, test] to be and endless loop if body never evaluates to true as is the case for x++.
To reply via email subtract one hundred and four

  • Prev by Date: Primes (again)
  • Next by Date: Re: Aliases
  • Previous by thread: Re: Re: Mathematica language issues
  • Next by thread: Re: Re: Mathematica language issues