Clearly "typeOf" can only handle 1 argument, following patch should
fix this bug, but I wonder if there are better ways of error handling
than "error".
diff --git a/src/interp/i-spec2.boot b/src/interp/i-spec2.boot
index b82cae83..15249526 100644
--- a/src/interp/i-spec2.boot
+++ b/src/interp/i-spec2.boot
@@ -1057,7 +1057,7 @@
--% Handler for typeOf
uptypeOf form ==
- form isnt [op, arg] => NIL
+ form isnt [op, arg] => error "typeOf: 1 argument required"
if VECP arg then transferPropsToNode(getUnname arg,arg)
if m := isType(arg) then
m :=
Also the unrelated "typeOf" in fortran.spad can be deleted:
diff --git a/src/algebra/fortran.spad b/src/algebra/fortran.spad
index f055b260..e9e04235 100644
--- a/src/algebra/fortran.spad
+++ b/src/algebra/fortran.spad
@@ -1228,8 +1228,6 @@ SimpleFortranProgram(R, FS) : Exports ==
Implementation where
nameOf(u : %) : Symbol == u . name
- typeOf(u:%):Union(FST,"void") == u . type
-
bodyOf(u : %) : FS == u . body
argumentsOf(u : %) : List Symbol == variables(bodyOf u)$FS
> --
> 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...@googlegroups.com.
> To post to this group, send email to
fricas...@googlegroups.com.
> Visit this group at
https://groups.google.com/group/fricas-devel.
> For more options, visit
https://groups.google.com/d/optout.