[Top][All Lists]

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

Re: [Axiom-developer] Re: fixing SPAD

From: Waldek Hebisch
Subject: Re: [Axiom-developer] Re: fixing SPAD
Date: Sat, 19 May 2007 19:28:35 +0200 (CEST)

> Martin, correct me if I am wrong...  But I guess Martin meant that 
> something like
> define ResidueClassRing(R: CommutativeRing, p: R): Category == with {
>      Ring;
>      if prime? p then Field;
>      ...
> }
> which would be perfectly fine in Aldor does not work in SPAD.

Sure, I am going to replay to his message where he gave more details.
> 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.

To avoid confusion:  Axiom also computes exports at runtime.  Namely,
each function signature has associated predicate which is evaluated
when domain is constructed at runtime.  But the compiler can only only
handle simple predicates ("has" and "is").  AFAIK predicates may
contain arbitrary boolean expressions built from simple predicates,
so restrictions on boolean expressions are just parser thing (in
other word syntactic sugar).  The restriction on base predicates
is deeper.

                              Waldek Hebisch

reply via email to

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