On Thu, Feb 23, 2012 at 08:48:34PM +0100, Waldek Hebisch wrote:
>
> [..]
>
> > -------------------------------------------------- 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)
Yes. Thank you.
1. What is `@', please?
2. I also tried show(xs : List String) ...
in
)abbrev package FOO Foo
Foo() : with f : List String -> List String ==
add
show(xs : List String) : String == unparse(convert(xs)@InputForm)
f(xs : List String) : List String ==
empty? xs => [] :: List String
lx := first xs
lx = "]" => error concat["f ", show xs, " : first(arg) = ]"]
[lx, lx]
And -> f ["]", "cd"]
reports
Function: convert : % -> InputForm is missing from domain: String
Internal Error
The function convert with signature (InputForm)$ is missing from
domain String
It is desirable to use an universal show, may be
show(x : SomeAppropriateCategory) : String ==
unparse(convert(xs)@InputForm) ?
What might it be?
Thanks,
------
Sergei
[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.