[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-mail] Declare variable type within function
From: |
Martin Rubey |
Subject: |
Re: [Axiom-mail] Declare variable type within function |
Date: |
17 Mar 2008 17:27:26 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 |
"Bill Page" <address@hidden> writes:
> > But I can play tricks like this:
> >
> > foo(x)==
> > L:=[x.1-x.1]
> > L:= append(L,x)
> > return L
> >
> Although you might still consider it a "trick" I would suggest the
> following code that I think is more transparent:
>
> foo(x)==
> L:=select(a+->false,x)
> L:= append(L,x)
Angelos' trick is better: select would have to consider every element of x...
But maybe you like
foo(x)==
L:= if empty? x then x else rest [first x]
L:= append(L,x)
The best way to go forward is of course to make type inference better. (And I
do believe that it's already quite OK, contrary to Bill)
Martin