MathGroup Archive 2006

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

Search the Archive

Re: Beginner--How to simulate multiple returns for a function?


Hi,

what are multiple returns ?

a) f[x_]:=Module[{lst},
             If[x<1,Return[x]];
             Table[x,{42}]
            ]

b) f[x_]/; x<1:=x
   f[x_]:=Table[x,{42}]

c) f[x_]:={x,Table[x,{42}]}

Regards
  Jens

"xiaochu" <xiaochu at che.utexas.edu> schrieb im 
Newsbeitrag news:e3v0tt$pav$1 at smc.vnet.net...
|
| Hi, All,
|
| Another system's functions can have multiple 
returns, does
| Mathematica support this?
|
| Link to the forum page for this post:
| 
http://www.mathematica-users.org/webMathematica/wiki/wiki.jsp?pageName=Special:Forum_ViewTopic&pid=10267#p10267
| Posted through http://www.mathematica-users.org 
[[postId=10267]]
|
|
|
| 



  • Prev by Date: Re: why doesn't the range on this interval match the plot range?
  • Next by Date: Re: Recursion inspection technique : HoldForm but release variables
  • Previous by thread: Re: Beginner--How to simulate multiple returns for a function?
  • Next by thread: Re: Beginner--How to simulate multiple returns for a function?