| Author |
Comment/Response |
User
|
10/30/02 09:57am
I want to generate a list of the functions (+1) (+2) (+3)... (haskell syntax). I try:
Table[ (k+#)&, {k,1,10} ]
but the variable k is never bound. For instance,
k=0;
f=Function[t, t+k];
k=1;
f[0] => 1
I can do:
Map[ Function[k, Function[t,k+t]], Range[1,10]]
But is there a less awkward way via Table? In Haskell list comprehensions, for instance, one can simply do:
[ \t->t+k, k<-[1..10] ]
Can you give any references to evaluation rules inside of Mathematica lambdas?
Thanks.
URL: , |
|