Re: Reentrant Functions
- To: mathgroup at smc.vnet.net
- Subject: [mg29441] Re: [mg29424] Reentrant Functions
- From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
- Date: Wed, 20 Jun 2001 04:36:22 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
on 6/19/01 6:35 PM, Hermann Schmitt at schmitther at netcologne.de wrote: > > Hello, > can functions be made reentrant, i.e. can I invoke in a function the > same function again? > Hermann Schmitt > > If you mean what I think you mean than the answer is yes. #0 inside a function stands for the function itself. For example the following is the definition of the factorial function: If[#==1,1,# #0[#-1]]& E.g. In[100]:= If[#==1,1,# #0[#-1]]&[5] Out[100]= 120 -- Andrzej Kozlowski Toyama International University JAPAN http://platon.c.u-tokyo.ac.jp/andrzej/ http://sigma.tuins.ac.jp/~andrzej/