Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'List modification in module' topicStudent Support Forum > General > "List modification in module"

Next Comment >Help | Reply To Topic
Author Comment/Response
Randall
12/07/06 12:08pm

Why is the effect of my module {}?

This example should just set a = b.

In[144]:=
Clear[zez,a,b]
zez[a_List,b_List]:=Module[{i},Do[Set[a[[i]],b[[i]]],{i,2}]]

In[146]:=

a={2,2}
b={4,4}
Trace[zez[a,b]]

Out[146]=
{2,2}

Out[147]=
{4,4}

Out[148]=
{}


In[78]:=
a

Out[78]=
{2,2} (should be {4,4} here)

URL: ,

Subject (listing for 'List modification in module')
Author Date Posted
List modification in module Randall 12/07/06 12:08pm
Re: List modification in module yehuda ben-s... 12/08/06 04:57am
Next Comment >Help | Reply To Topic