Re: Declare variable type within function

"Bill Page" <[email protected]>
Newsgroups gmane.comp.mathematics.axiom.user
Message-ID <[email protected]>
On 3/17/08, Themos Tsikas wrote:
> foo(x) == list x
>
>  works for you?
>

This function is *not* equivalent to what Angelos wrote which could
actually be written most simply as just:

 foo(x) == x

>  > foo(x)==
>  >       L:=[x.1-x.1]
>  >       L:= append(L,x)
>  >       return L

However I am sure that he intended this only as an example and in
general the logical of this function could be much more complex then
just calling append and returning what was passed. As I understand it
the point of the example is that we want 'L' to have the *same type*
as 'x' but a different value - without ever specifying the actual type
of 'x'.

Regards,
Bill Page.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.