Ralf Hemmecke wrote:
> 
> Hello,
> 
> I seem to be unlucky today... Does somebody have an idea why the 
> following does not work?
> As a hint... if I remove "(T: BasicType)" from that program, it 
> seemingly works.
> 

What happens if you rename T to something else?  In Lisp code T
is boolean true, Spad is careful to internally rename T to
avoid clash with Lisp T, but I am not sure if this is handled
by the Aldor interface.

> -- with domain parameter T
> (1) -> )co domconst.as 
> 
>     Compiling FriCAS source code from file 
> 
>        /home/hemmecke/GIT/fricas/src/algebra/parint/domconst.as using 
> 
>        AXIOM-XL compiler and options 
> 
> -O -Fasy -Fao -Flsp -laxiom -Mno-ALDOR_W_WillObsolete -DAxiom -Y 
> $AXIOM/algebra -I $AXIOM/algebra 
> 
>        Use the system command )set compiler args to change these 
> 
>        options. 
> 
>     Compiling Lisp source code from file ./domconst.lsp 
> 
>     Issuing )library command for domconst 
> 
>     Reading /home/hemmecke/GIT/fricas/src/algebra/parint/domconst.asy 
> 
>     ...
>     DomainConstant is now explicitly exposed in frame frame1
>     DomainConstant will be automatically loaded when needed from
>        /home/hemmecke/GIT/fricas/src/algebra/parint/domconst
> (1) -> Integer has BasicType
> 
>     (1)  true
>                                    Type: Boolean
> (2) -> D := DomainConstant(Integer)
> 
>     (2)  DomainConstant(Integer)
>                                    Type: Domain
> (3) -> domainConstant()$D
>     Internal Error
>     Unexpected error or improper call to system function matchMmCond :
>        unknown form of condition
> 

matchMmCond (in i-funsel.boot) is complaining about malformed
consition in a modemap.

First thing to check is:

)lisp (showdatabase '|domainConstant|)

expecially the modemaps part.  If modemaps looks reasonable
than I would trace matchMmCond to see if it really uses
modemaps form database (we have one known case where we
temporarily get some strange modemaps, while modemaps in
database are OK).  If modemaps in database are bad, than
one should look at generated .asy file and choose next
steps dependig on result.

> There seems to be some magic that translates
> 
>    domainConstant: %
> 
> into
> 
>    domainConstant: () -> %
> 
> when that Aldor program is run inside FriCAS. Is that really necessary?
> 
> A nullary function is mathematically the same as a constant, but in 
> computer science a function might have side effects (wanted (for example 
> logging how often the function is called) or unwanted).
> 
> Until somebody convinces me otherwise or until SPAD becomes a functional 
> language, I like the distinction between constants and nullary 
> functions. Any chance to have true constants in FriCAS with a modest 
> amount of work?
> 

Spad was designed to have purely functional interface, that is one
domain should never directly look into other one -- one should
use function calls instead.  In the compiler Spad have rather
limited support for constants (IIRC only the only real constants
are the one introduced by the compiler).

I am affraid that to really distinguish constants from nullary
functions requires significant changes to the compiler -- current
modemap machinery has no obvius way to distinguish them.

-- 
                              Waldek Hebisch
[email protected] 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to