[Top][All Lists]

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

Re: [Axiom-developer] Re: fixing SPAD

From: Ralf Hemmecke
Subject: Re: [Axiom-developer] Re: fixing SPAD
Date: Sat, 19 May 2007 19:16:07 +0200
User-agent: Thunderbird (X11/20070326)

From aggcat.spad.pamphlet:

   if Entry has SetCategory and % has finiteAggregate then
      entry?: (Entry,%) -> Boolean
        ++ entry?(x,u) tests if x equals \axiom{u . i} for some index i.

Form aggcat2.spad.pamphlet:

      if B has ListAggregate(R) or not(B has shallowlyMutable) then
        -- A is a list-oid, and B is either list-oids or not mutable
        map(f, l) == construct [f s for s in entries l]

So, as Martin wrote simple boolean operators already work.  I belive
that there are restrictions, namely that more complicated expressions
do not work.

Martin, correct me if I am wrong... But I guess Martin meant that something like

define ResidueClassRing(R: CommutativeRing, p: R): Category == with {
    if prime? p then Field;

which would be perfectly fine in Aldor does not work in SPAD.

In contrast to "has", "is", "and", etc. the function "prime?" is not defined by the language and thus cannot be evaluated at compile time. In Aldor that is delayed until the time that category is first used (at runtime). Only then the actual exports are computed.


reply via email to

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