lambda related question



Let me explain a littel bit more:
I want to use genmatrix ith a lambda expression.
something like

rior(expr,sizee) := genmatrix(lambda([i,j],expr),size,size)

and then do

rior(a[i],3)

Any suggestions for doing this in an elegant way
(I know how to do this nicely in Mathematica, but I want to use
maxima to make it accessible to my students)



On 12/23/2011 5:18 PM, Stavros Macrakis wrote:
> ev(x) where x is a symbol seems to be OK.  I'd be more comfortable if we
> had a simple eval function that did only that, though.  Of course, any
> time you use an eval function you have to be careful about things like
> scope.
> 
>           -s
> 
> On Fri, Dec 23, 2011 at 11:06, Raymond Toy <toy.raymond at gmail.com
> <mailto:toy.raymond at gmail.com>> wrote:
> 
>     On 12/23/11 7:07 AM, Stavros Macrakis wrote:
>>         subst(expr,'expr,lambda([i],expr))
>>         buildq([expr],lambda([i],expr))
>>
>>     Both return lambda([i],i).
>>
>>     Examples of use:
>>
>>         expr: '(i^2)$
>>         myfun: subst(expr,'expr,lambda([i],expr))$
>>         myfun(5) => 25
>>
>>     or simply
>>
>>         lambda([i],ev(expr))(5) => 25
>>
>     Is this one of the cases where ev is the right thing to use?
> 
>     Ray
> 
> 
>     _______________________________________________
>     Maxima mailing list
>     Maxima at math.utexas.edu <mailto:Maxima at math.utexas.edu>
>     http://www.math.utexas.edu/mailman/listinfo/maxima
> 
> 
> 
> 
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima