Bill Page wrote:
>
> I think this is a strange problem.
>
> Consider the following code which is a simplified and reduced version
> of some larger piece that I am currently working on:
>
> -- file: BadCode.spad
> )abbrev domain BAD BadCode
> BadCode(A:Monoid): with
> coerce: %->OutputForm
> == add
> Rep == List A
> rep(x:%):Rep == x pretend Rep
> per(x:Rep):% == x pretend %
>
> coerce(x:%):OutputForm ==
> r:=rep(x)
> --output("#r=",#r::OutputForm)$OutputPackage
> if empty? r then coerce(0$InputForm)
> else if #r=1 then
> s:=first r
> if s=1 then
> coerce(1$InputForm)
> else
> coerce(s)
> else coerce(convert("more")@InputForm)
> --
>
> (1) -> )co BadCode.spad
> Compiling FriCAS source code from file /home/wspage/BadCode.spad
> using old system compiler.
> BAD abbreviates domain BadCode
> ...
> BadCode is already explicitly exposed in frame frame1
> BadCode will be automatically loaded when needed from
> /home/wspage/BAD.NRLIB/BAD
>
> (1) -> ([] pretend BAD(Integer))
>
> (1) 0
> Type: BadCode(Integer)
> (2) -> ([1] pretend BAD(Integer))
>
> (2) 1
> Type: BadCode(Integer)
> (3) -> ([2] pretend BAD(Integer))
>
> (3) 2
> Type: BadCode(Integer)
> (4) -> ([1,2] pretend BAD(Integer))
>
> (4) 1
> Type: BadCode(Integer)
>
> --
>
> Notice the result in (4) above. I expected to see the output "more".
>
<snip>
> Can you reproduce this? Can anyone see why this happens? What am I missing?
Which version of FriCAS are you using? Current version (revision
675) build on top of sbcl-1.0.16 running on 64-bit Fedora 9 for "(4)"
above gives me "more". The same using ecl-9.8.4 and gcl.
BTW: I get
(1) -> solve([tan(b) = a],[b])
(1) []
--
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
-~----------~----~----~----~------~----~------~--~---