Inconsistency when using previously defined variables as arguments to functions
- Subject: Inconsistency when using previously defined variables as arguments to functions
- From: Barton Willis
- Date: Thu, 27 Jan 2011 04:49:35 -0600
-----maxima-bounces at math.utexas.edu wrote: -----
>>>?But?the?traditional?lambda?syntax?is?clumsy?and?obscure?to
>>>?non-computer-scientists.
>>
>>?you?could?write??function[k]:k??if?that?would?make?people?happier.
Another possibility:
?(%i12) (infix("->",50,50), ?"->"(x,f) ::= (x : if listp(x) then x else [x], buildq([x,f], lambda(x,f))))$
?(%i15) x -> x;
?(%o15) lambda([x],x)
?(%i16) [a,b] -> a+b;
?(%o16) lambda([a,b],b+a)
--Barton