Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Funny Behavior of Module

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124759] Re: Funny Behavior of Module
  • From: Shizu <slivo.vitz at msa.hinet.net>
  • Date: Sat, 4 Feb 2012 06:31:17 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Without the assignment x = y, the procedure works fine.

When we introduce the redundant assignment (done by Louis on purpose), Mathematica treats it as an initialization, and so global variable y is assigned to x first, and so a = y^2.
But it's should be in the {} for local variables and initializations.
But then if it's in the {}, we should not assign something to x which is an argument.
The x = y here should not affect the value of a.

Hence I think this is a bug -- M thinks that x = y is an initialization.



  • Prev by Date: Re: Filling area between curves
  • Next by Date: Re: creation of date list
  • Previous by thread: Re: Funny Behavior of Module
  • Next by thread: Re: Funny Behavior of Module