On Tuesday 28 Jun 2011 09:39:36 Ralf Hemmecke wrote:
> Hi Martin,

HI Ralf,

> Do you intend your Lambda domain to represent unevaluated lambda
> expressions? Or do you want immediate evaluation of a function application?
>
> Looking at
>
>    lambda:(x:%,y:%) -> %
>      ++ Constructs a node containing multiple terms
>
> and its implementation
>
>    lambda(x:%,y:%): % == [[x,y]]
>
> it looks more like you are implementing a lazy version that explicitly
> needs an call to "evaluate" (probably "redux" in your case).

Yes exactly.

> My suggestion is that you add some documentation lines that clearly
> describe your design decision.

OK

> Ralf
>
> PS: I somehow don't like the above lambda function, because it's a bit
> confusing since you probably rather mean "function application" and not
> lambda abstraction.
>
> Aldor would allow to write a function
>
>    apply(x:%,y:%): % == [[x,y]]
>
> where later you could simply type
>
>    x y
>
> in order to call apply(x,y).
>
> I think, in FriCAS, if you use "elt" in place of "apply", it should work
> similarly. I have, however not tested it, so you must experiment yourself.

I used the name 'lambda' for the basic constructors of each type as it
appears to be a convention that the domain name starting with lower
case is used for constructors.

Of course it would be good to be able to construct lambda terms in
FriCAS using the usual syntax conventions used in textbooks. Since I
couldn't find a way to so that directly I wrapped it in this
'parseLambda' constructor.

  parseLambda:(t1: String) -> %
    ++ Constructs nested lambda terms from a string
    ++ notation assumes format like this:
    ++ <term> ::= "\" var "."<term> | n | <term><term> | "("<term>")"
    ++ where:
    ++ \ = lambda (I would like to use unicode lambda symbol but
    ++             I would also like to keep maximum compatibility
    ++             with non-unicode versions of Lisp)
    ++ n = De Bruijn index which is a integer where, 1=inside inner
    ++             lambda term, 2= next outer lambda term, 3= next
    ++             outer and so on.
    ++ brackets can be used around whole terms.

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to