Serge D. Mechveliani wrote:
> 
> Please, can you explain the following two features?
> 
> `unparse' in Spad
> *****************
> The program
> 
> -------------------------------------------------- t.spad 
> INT ==> Integer
> )abbrev package FOO Foo
> Foo() : with  
>         show : List INT -> String
>         f    : List INT -> INT
>  ==
>   add
>     show(xs : List INT) : String == 
>                                  oF := xs   :: OutputForm
>                                  unparse(oF :: InputForm)   
>     f(xs : List INT) : INT ==  
>            empty? xs => 0
>            n := first xs
>            n < 2  => error concat["f ", show xs, " :  first(arg) < 2."]
>            n + 1
> ----------------------------------------------------------
> 
> does not compile. How to make it work, please?
>

    show(xs : List INT) : String ==
                                 unparse(convert(xs)@InputForm)

> 
> 
> Error messages
> **************
> I am looking into  src/algebra/*.spad*  in FriCAS-1.1.5  for the 
> examples of forming a message under applying `error'. 
> And the examples occur like this: 
> 
>    f(l : List Foo) : List Foo == 
>                               empty? l => l
>                               first(l) = 0 => error "first(l) = 0"
> 
> As I think, the error report will be like this:
> 
>    Error in the library code:
>    first(l) = 0
> 
> It does not show in what function and of what package the break has 
> happened, and what are the responsible argument values.

Right, some functions print more information, but most
are as this.
 
-- 
                              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