On 27 October 2015 at 21:34, Waldek Hebisch <hebi...@math.uni.wroc.pl> wrote:
>
> Expanding on Bill's answer: this code is an abuse (wrong).  The
> core thing is that FriCAS list are homogeneous: all elements have
> the same type.  In Lisp lists are allowed to have elements of
> different Lisp types.  The integration routine returns two
> machine float and one machine integer.  On Lisp side Bill packs
> this into a list.  But on Spad side this List in an illegal
> object, so Bill lies and tells Spad compiler that the list
> contains DoubleFloat-s.  Then he has to use 'pretend' to
> tell Spad compiler that the third element is in fact an
> integer.  Currently this works, but will break down if
> Spad compiler becomes only slightly smarter: claiming that
> something is both DoubleFloat and Integer is a contradiction
> and may lead to wrong code or compile time error.
>

Yes, guilty. :) But this was only the first solution I could think of
and so far this is just proof-of-concept code.  There are other ways
in Lisp of dealing with functions that return multiple values but this
is only possible in FriCAS at a higher level, e.g. by use of Record.
Perhaps there is some easy way of using routines already available in
BOOT to construct a Record value directly?  It would take me some time
to find it. Do you know Waldek?  Or can you suggest a different
possible permanent solution?

-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
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