MathGroup Archive 2013

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

Search the Archive

Re: Warsaw Univ. course, was Re: Work on Basic Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg131026] Re: Warsaw Univ. course, was Re: Work on Basic Mathematica
  • From: Richard Fateman <fateman at eecs.berkeley.edu>
  • Date: Tue, 4 Jun 2013 02:01:24 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <kmngb2$3rv$1@smc.vnet.net> <20130519095011.606CD6A14@smc.vnet.net> <knv52t$j93$1@smc.vnet.net> <ko1nhc$r3t$1@smc.vnet.net> <ko9ito$kf1$1@smc.vnet.net> <20130601102708.D06EF6A07@smc.vnet.net> <CA+mE4FvOwVNbZrzQS89H0JT7-Osp_1qTOqfSei0QHXmZdagsjg@mail.gmail.com>

On 6/3/2013 9:25 AM, Leonid Shifrin wrote:

<long message>

Thanks for what I consider a most agreeable contribution.
I was not aware of your material on stackexchange, which seems
to be rather nice.


You are right that my example regarding mutable Lists in Mathematica
was incorrect. Actually on two grounds.  The syntax was not right and
I did not mean to say that Lists in Mathematica are not mutable, since
they certainly are.

Just that Lists have the uncomfortable property that if you access one 
element,
all the others are re-evaluated. Here is an example, which I think is 
free of
mis-used syntax...

(   q=Table[f[i],{i,1,3}];
      f[n_]:=(Print[n];g[n]))

q[[2]]

     evaluates to display
1
2
3
g[2]

Changing q by, for example,   q[[2]]=hello
does not re-evaluate the elements.
However, referring to in again as q[[2]] does this:
1
3
hello

Thanks for pointing out the original error.
RJF





  • Prev by Date: Re: Interval vs default, was Re: Mathematica numerics and... Re: Applying
  • Next by Date: Re: defining a function whose parameter must be a function
  • Previous by thread: Re: Warsaw Univ. course, was Re: Work on Basic Mathematica Stephen!
  • Next by thread: Re: Warsaw Univ. course, was Re: Work on Basic Mathematica Stephen!