MathGroup Archive 2004

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

Search the Archive

Re: Mathematica language issues

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

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

>>Surprisingly,
>>>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