axiom-mail
[Top][All Lists]
Advanced

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

[Axiom-mail] map operators rules and anonymous functions


From: Page, Bill
Subject: [Axiom-mail] map operators rules and anonymous functions
Date: Wed, 1 Oct 2003 15:54:09 -0400

Tim et al.

A recent email by Koen Hillewaert got me thinking about
the use of map in Axiom. We can write things like

  map(inv,[2,3])
  a:=matrix[[6,9],[27,81]]
  map(factor,a)

But if I define an operator I can write

  F:=operator 'F
  F(x)

but

  map(F,[x,y])
  map(F,a)

both fail with with message like "Cannot find
applicable library operation named map with
argument types BasicOperator, List OrderedVariableList
[x,y]"

And since rules such as

  F:=rule 'x == 'y
 
are operators

  map(F,a)

also fails.

But there is a work-around!

If I write

  map(f+->F(f),a)

I get the desired result.

Can one of the Axiom guru's out there explain
this to me?

Is it possible to modify the definition of map
so that it could take an operator as the first
argument?

Cheers,
Bill Page.





reply via email to

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