On 11/19/2015 12:00 PM, Martin Baker wrote:
>   print(a:CoercibleTo(OutputForm),b:CoercibleTo(OutputForm)):Void ==
>     print hconcat([a::OutputForm,b::OutputForm])$OutputForm

As you can see here

https://github.com/hemmecke/fricas/blob/master-hemmecke/src/algebra//coerce.spad#L9

CoercibleTo(...) is a category.

When I interpret your code then I would say that a is a *domain* that
provides a function coerce: a -> OutputForm, i.e. any element of a can
be coerced into an OutputForm, but not a itself.

You probably want something like this:

---------------
printUtil(A: CoercibleTo OutputForm) : Exports == Implementation where
 Exports ==> with
    print : (a: A, b: A) -> Void
      ++ print 2 arguments

 Implementation ==> add
    print(a: A, b: A):Void ==
      print hconcat(a::OutputForm, b::OutputForm)$OutputForm
---------------

But I guess, even that is not in your mind.
Maybe you add "B: CoercibleTo(OutputForm)" as a second parameter of the
package. Well, it becomes a bit cumbersome then.

Do you really need it in a spad file?

I usually use a similar two argument print via the macro mechanism.

O==>OutputForm
dbgPrint(x,y) ==> print([x::O,y::O]$List(O)::O)

Hope that helps.

Ralf

-- 
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