Re: a beginner's question
- To: mathgroup at smc.vnet.net
- Subject: [mg77797] Re: [mg77768] a beginner's question
- From: DrMajorBob <drmajorbob at bigfoot.com>
- Date: Sun, 17 Jun 2007 06:01:18 -0400 (EDT)
- References: <30732921.1181981513900.JavaMail.root@m35>
- Reply-to: drmajorbob at bigfoot.com
Module declares p to be a local variable, so that it doesn't conflict with a global p you might be using. Block and With do the same thing, but with different context rules. It will take a little time to get used to determining which you need, if any. For ";", look up CompoundExpression -- or highlight ";" and press the Help key. It separates several expressions and returns the value of the last expression in the sequence. Bobby On Sat, 16 Jun 2007 02:31:31 -0500, tung tran <tunganhtr at yahoo.fr> wrote: > I am a beginner in Mathematica and in programming. I read the book "An > Introduction to Programming with Mathematica". > Page 155: > > FindSubsequence[lis_List, subseq_List] := Module[{p}, p = > Partition[lis, Length[subseq], 1]; Position[p, Flatten[{___, subseq, > ___}]]] > > I want to know more about the role of Module function and " ; " in > these lines. I have read documentation about Module function but it > doesn't help me much in understanding this line of code. Thanks for > helping me ! > > Regards, > Tung Anh > > > -- DrMajorBob at bigfoot.com