|
[Date Index]
[Thread Index]
[Author Index]
Re: Functions, Part 1
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg573] Re: [mg564] Functions, Part 1
- From: Arthur Wasserman <Arthur.Wasserman at math.lsa.umich.edu>
- Date: Sun, 19 Mar 95 11:27:08 -0500
> (1) f[x_] := x + 1
>
> (2) g = Function[x,f[x]]
>
> (3) h = Function[x,Function[y,y+1]]
>
> Now g[2] and f[2] output 3 as expected. But
> h[2] (indeed, h[garbage]) outputs Function[y,y+1].
> What`s going on?
You for got the x in the definition of h. You want:
h = Function[x,Function[y,y+1][x]]
Now h[2]=3.
Prev by Date:
Re: Functions, Part 1
Next by Date:
Re: Confused about contexts ...
Previous by thread:
Re: Functions, Part 1
Next by thread:
Re: Functions, Part 1
|