Here is a patch to 'any.spad' that does the same thing.

wspage@sarah ~/fricas $ git diff
diff --git a/src/algebra/any.spad b/src/algebra/any.spad
index 9e97bb2..bb80877 100644
--- a/src/algebra/any.spad
+++ b/src/algebra/any.spad
@@ -85,7 +85,12 @@ Any() : SetCategory with

      obj x      == x.ob
      dom x      == x.dm
-     domainOf x == x.dm pretend OutputForm
+     domainOf x ==
+         if #(x.dm)>1 then
+             hconcat(destruct(form2String(x.dm)$Lisp) pretend List
OutputForm)$OutputForm
+             --form2String(x.dm)$Lisp pretend OutputForm
+         else
+             form2String(x.dm)$Lisp pretend OutputForm
      x = y      ==
          dx := dom x
          dy := dom y

On 18 August 2016 at 19:06, Bill Page <[email protected]> wrote:
> Maybe enough of this "interpreter magic" is in the 'form2String' function.
>
> (1) -> )r /home/wspage/typeof
>
> typeof(t:Any):OutputForm ==
>   if #(dom t)>1 then
>     hconcat(destruct form2String(dom t)$Lisp :: List OutputForm)
>   else
>     form2String(dom t)$Lisp
>
>    Function declaration typeof : Any -> OutputForm has been added to
>       workspace.
>                                                                    Type: Void
> (2) ->  ts := taylor(x, x=1)
>
>    (2)  1 + (x - 1)
>                         Type: UnivariateTaylorSeries(Expression(Integer),x,1)
> (3) -> t1:=-1
>
>    (3)  - 1
>                                                                 Type: Integer
> (4) -> s:="sss"
>
>    (4)  "sss"
>                                                                  Type: String
> (5) -> m:=matrix([[1]])
>
>    (5)  [1]
>                                                         Type: Matrix(Integer)
> (6) -> p:=x+1
>
>    (6)  x + 1
>                                                     Type: Polynomial(Integer)
> (7) -> typeof(ts)
>    Compiling function typeof with type Any -> OutputForm
>
>    (7)  UnivariateTaylorSeries(Expression(Integer),x,1)
>                                                              Type: OutputForm
> (8) -> typeof(t1)
>
>    (8)  Integer
>                                                              Type: OutputForm
> (9) -> typeof(s)
>
>    (9)  String
>                                                              Type: OutputForm
> (10) -> typeof(m)
>
>    (10)  Matrix(Integer)
>                                                              Type: OutputForm
> (11) -> typeof(p)
>
>    (11)  Polynomial(Integer)
>                                                              Type: OutputForm
>
> 'form2String' could probably best be called from

I meant to conclude here that it should be called from 'domainOf' in Any.

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to