nested anonymous functions

View: New views
3 Messages — Rating Filter:   Alert me  

nested anonymous functions

by Michael Becker-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



    Hi,

        does axiom  really support  anonymous functions?
 

                       AXIOM Computer Algebra System
                          Version: Axiom (May 2009)
                Timestamp: Sunday June 21, 2009 at 23:34:35
............
............

(1) ->  (y+-> y+1) 1
(1) ->
   (1)  2
                                                        Type: PositiveInteger
(2) ->  (x +-> ((y+-> y+x) 1)) 2
 2) ->
   >> System error:
   The variable #:G1404 is unbound.

(2) -> f == (x +-> ((y+-> y+x) 1))
                                                                   Type: Void
(3) -> f 2
   Compiling function f with type PositiveInteger -> PositiveInteger

   (3)  3
                                                        Type: PositiveInteger


      --  Michael



------------------------------------------------------------------------------------
Diese Nachricht könnte vertrauliche und/oder rechtlich
geschützte Informationen enthalten. Wenn Sie nicht der
Adressat dieser Email sind oder nicht autorisiert sind, diese
für den Adressaten entgegenzunehmen, so ist es untersagt,
diese Nachricht oder in ihr enthaltene Informationen zu nutzen,
zu kopieren, offen zu legen oder anderweitig weiterzuverarbeiten.
Sollten Sie diese Nachricht fälschlicherweise erhalten haben,
verständigen Sie den Absender bitte unverzüglich per Antwort auf
diese Mail und löschen sie diese anschließend.
Vielen Dank für Ihre Kooperation.
------------------------------------------------------------------------------------
This message may contain confidential and/or privileged
information. If you are not the addressee or authorized
to receive this for the addressee, you must not use, copy,
disclose or take any action based on this message or any
information herein. If you have received this message in
error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your co-operation.
------------------------------------------------------------------------------------
We make your business move.




_______________________________________________
Axiom-developer mailing list
Axiom-developer@...
http://lists.nongnu.org/mailman/listinfo/axiom-developer

Re: nested anonymous functions

by Tim Daly-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Michael,

Try

(x +-> ((w,y)+->y+w) (x,2)) 1

The outer function of x requires one argument
which is bound as x, and the inner function of
(x,y) requires 2, (w,y)

This does not appear to be a bug.

Tim


Michael Becker wrote:

>     Hi,
>
>         does axiom  really support  anonymous functions?
>  
>
>                        AXIOM Computer Algebra System
>                           Version: Axiom (May 2009)
>                 Timestamp: Sunday June 21, 2009 at 23:34:35
> ............
> ............
>
> (1) ->  (y+-> y+1) 1
> (1) ->
>    (1)  2
>                                                         Type: PositiveInteger
> (2) ->  (x +-> ((y+-> y+x) 1)) 2
>  2) ->
>    >> System error:
>    The variable #:G1404 is unbound.
>
> (2) -> f == (x +-> ((y+-> y+x) 1))
>                                                                    Type: Void
> (3) -> f 2
>    Compiling function f with type PositiveInteger -> PositiveInteger
>
>    (3)  3
>                                                         Type: PositiveInteger
>
>
>       --  Michael
>
>
>
> ------------------------------------------------------------------------------------
> Diese Nachricht könnte vertrauliche und/oder rechtlich
> geschützte Informationen enthalten. Wenn Sie nicht der
> Adressat dieser Email sind oder nicht autorisiert sind, diese
> für den Adressaten entgegenzunehmen, so ist es untersagt,
> diese Nachricht oder in ihr enthaltene Informationen zu nutzen,
> zu kopieren, offen zu legen oder anderweitig weiterzuverarbeiten.
> Sollten Sie diese Nachricht fälschlicherweise erhalten haben,
> verständigen Sie den Absender bitte unverzüglich per Antwort auf
> diese Mail und löschen sie diese anschließend.
> Vielen Dank für Ihre Kooperation.
> ------------------------------------------------------------------------------------
> This message may contain confidential and/or privileged
> information. If you are not the addressee or authorized
> to receive this for the addressee, you must not use, copy,
> disclose or take any action based on this message or any
> information herein. If you have received this message in
> error, please advise the sender immediately by reply e-mail
> and delete this message. Thank you for your co-operation.
> ------------------------------------------------------------------------------------
> We make your business move.
>
>
>
>
> _______________________________________________
> Axiom-developer mailing list
> Axiom-developer@...
> http://lists.nongnu.org/mailman/listinfo/axiom-developer
>
>  



_______________________________________________
Axiom-developer mailing list
Axiom-developer@...
http://lists.nongnu.org/mailman/listinfo/axiom-developer

Re: nested anonymous functions

by Michael Becker-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Am Montag, 20. Juli 2009 12:39 schrieb Tim Daly:

> Michael,
>
> Try
>
> (x +-> ((w,y)+->y+w) (x,2)) 1
>
> The outer function of x requires one argument
> which is bound as x, and the inner function of
> (x,y) requires 2, (w,y)
>
> This does not appear to be a bug.


 
  Tim,

    This was a question.

    According to Section 6.16:  Variables in Functions are local or global (in
workspace)
   
    e.g.:
(4) -> bla() == (m:=3;f() == m +3; f())
                                                                   Type: Void
(5) -> bla()
   Compiled code for f has been cleared.
   1 old definition(s) deleted for function or rule f
   Compiling function f with type PositiveInteger -> Polynomial Integer

   Compiling function bla with type () -> Polynomial Integer

   (5)  m + 3
                                                     Type: Polynomial Integer

   

   So nested anonymous functions are not really supported.



   -- Michael

 


>
> Tim
>
> Michael Becker wrote:
> >     Hi,
> >
> >         does axiom  really support  anonymous functions?
> >
> >
> >                        AXIOM Computer Algebra System
> >                           Version: Axiom (May 2009)
> >                 Timestamp: Sunday June 21, 2009 at 23:34:35
> > ............
> > ............
> >
> > (1) ->  (y+-> y+1) 1
> > (1) ->
> >    (1)  2
> >                                                         Type:
> > PositiveInteger (2) ->  (x +-> ((y+-> y+x) 1)) 2
> >  2) ->
> >
> >    >> System error:
> >
> >    The variable #:G1404 is unbound.
> >
> > (2) -> f == (x +-> ((y+-> y+x) 1))
> >                                                                    Type:
> > Void (3) -> f 2
> >    Compiling function f with type PositiveInteger -> PositiveInteger
> >
> >    (3)  3
> >                                                         Type:
> > PositiveInteger
> >
> >
> >       --  Michael
> >
> >
> >
> > -------------------------------------------------------------------------
> >----------- Diese Nachricht könnte vertrauliche und/oder rechtlich
> > geschützte Informationen enthalten. Wenn Sie nicht der
> > Adressat dieser Email sind oder nicht autorisiert sind, diese
> > für den Adressaten entgegenzunehmen, so ist es untersagt,
> > diese Nachricht oder in ihr enthaltene Informationen zu nutzen,
> > zu kopieren, offen zu legen oder anderweitig weiterzuverarbeiten.
> > Sollten Sie diese Nachricht fälschlicherweise erhalten haben,
> > verständigen Sie den Absender bitte unverzüglich per Antwort auf
> > diese Mail und löschen sie diese anschließend.
> > Vielen Dank für Ihre Kooperation.
> > -------------------------------------------------------------------------
> >----------- This message may contain confidential and/or privileged
> > information. If you are not the addressee or authorized
> > to receive this for the addressee, you must not use, copy,
> > disclose or take any action based on this message or any
> > information herein. If you have received this message in
> > error, please advise the sender immediately by reply e-mail
> > and delete this message. Thank you for your co-operation.
> > -------------------------------------------------------------------------
> >----------- We make your business move.
> >
> >
> >
> >
> > _______________________________________________
> > Axiom-developer mailing list
> > Axiom-developer@...
> > http://lists.nongnu.org/mailman/listinfo/axiom-developer





_______________________________________________
Axiom-developer mailing list
Axiom-developer@...
http://lists.nongnu.org/mailman/listinfo/axiom-developer