Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg66441] Re: Beginner--How to simulate multiple returns for a function?
  • From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 12 May 2006 02:03:50 -0400 (EDT)
  • Organization: Uni Leipzig
  • References: <Pine.GSO.4.44.0605100054500.17163-100000@smc> <e3v0tt$pav$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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?