Ralf Hemmecke wrote:
> 
> > Nothing strange.  Basic Spad types have fixed relation to Lisp
> > types.  You are not allowed to store someting different than
> > Lisp integer in Spad Integer variable.  Similarely, Spad
> > string must be Lisp string, Spad List must be Lisp list,
> > Spad DoubleFloat must be Lisp DOUBLE-FLOAT, Spad
> > Boolean must be either Lisp NIL or Lisp symbol T.
> > Spad compiler, basic domains and Spad runtime support
> > cooperate to ensure this.  You have broken the contract,
> > and the result is as usual (hang or crash).
> 
> Can you point me to where exactly I have broken the contract?
> 
> x exquo y ==
>     zero? y => "failed"
>     z := (INTEXQUO(x, y)$Lisp) pretend %
>     -- or better this?
>     -- z: % := (INTEXQUO(x, y)$Lisp) pretend %
>     NULL(z)$Lisp => "failed"
>     z

'%' is Integer here.  Using 'pretend' you promise that result
of 'INTEXQUO' really is an integer.  But 'INTEXQUO' may
return Lisp NIL, which is not an integer.

> In fact, I think the compiler is pretty weak here. It shows
> 
>    compiling exported exquo : ($,$) -> Union($,failed)
> Local variable z lacks type.
> Local variable G81827 lacks type.

Sorry for those messages.  This is due to extension by Krystian
which collects type information.  It does not mean that 'z'
has no type at all, just that Krystian was not able to catch
that type.  This code works on output of Spad compiler and
at this plase there may be variables not present in user
source.  To generate good code we would like to know their
types.  Krystian explained in his proposal why he want types
and his typechecker work will provide types for all variables.

-- 
                              Waldek Hebisch
[email protected] 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to