MathGroup Archive 2002

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

Search the Archive

Re: Programming language difficulties.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg38430] Re: Programming language difficulties.
  • From: wolframmath at netscape.net (mikhalna)
  • Date: Sat, 14 Dec 2002 03:20:59 -0500 (EST)
  • References: <atc9f8$3hs$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Oliver,

Your example works fine if you remove "Evaluate":
 
In[1]:= secondWithdraw[ initBalance_ ] := 
    Module[ { balance = initBalance },
      Function[ amount,
        If[ balance >= amount,
          balance -= amount; balance,
          Print[ "Insufficient Funds" ]
          ]
        ]
      ]
In[4]:= W1:=secondWithdraw[100]
In[5]:=W1[60]
Out[5]=40

Cheers.


  • Prev by Date: Re: Pure recursive functions
  • Next by Date: RE: Question about precision.
  • Previous by thread: Programming language difficulties.
  • Next by thread: Re: Programming language difficulties.