axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Questions


From: Dylan Thurston
Subject: Re: [Axiom-developer] Questions
Date: Wed, 7 Jan 2004 14:41:54 -0500
User-agent: Mutt/1.5.4i

On Mon, Jan 05, 2004 at 09:42:25PM +0100, David MENTRE wrote:
> Stefan Dirnstorfer <address@hidden> writes:
> 
> > 1) Here Axiom seems not to correctly bind the variable c
> >
> > (2) -> cons:= c+->(x+->c)
> >   (2)  c +-> x +-> c
> >                                                       Type:
> > AnonymousFunction
> 
> I don't understand your example. What are you trying to build?

A better name for this function might be 'constant'.  'c +-> x +-> c'
should be a function that takes an argument, 'c', and returns a function
that takes an argument 'x', ignores x, and returns c.  That is, (cons 3)
is a constant function that always returns 3.

Alternatively, you can think of 'cons' as a function that takes two
arguments, one after the other, and returns the first.

Another way to see the bug is by looking at, say,

  c +-> x +-> c+x

otherwise known as addition.  You'll see the same behaviour.

I'm quite worried by this bug, since it shows some really elementary
failure of lexical scoping, which I understood Axiom to have.  I'll
investigate as soon as I have a chance.

Peace,
        Dylan

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]