Hello,
I suspect typeOf is an interpreter function that does not mix well with
library things.
As a workaround may I suggest to coerce its output to OutputForm like this :
typeOf(n)::OutputForm = Integer => output("type is integer")
__
Greg
Le mer. 31 août 2022 à 07:14, 'Nasser M. Abbasi' via FriCAS - computer
algebra system <[email protected]> a écrit :
> I am learning Fricas with the hope I can write Fricas script for CAS
> integration tests directly.
>
> I am having hard time figuring how to check the type of variable. I looked
> at Fricas book but it shows no examples.
>
> (11) -> n:Integer
> Type:
> Void
> (12) -> n:=10
> (12) 10
> Type:
> Integer
> (13) -> typeOf(n)
> (13) Integer
>
> Now I want to check, using if then else, that "n" has type "Integer". How
> to this? For example, this gives error
>
> if typeOf(n)=Integer then output("type is integer")
>
> I tried few other permutations of the above, but they all give errors.
>
> Thanks
> --Nasser
>
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/fricas-devel/8a0019d9-e2d0-44c9-a899-682e4361e6a4n%40googlegroups.com
> <https://groups.google.com/d/msgid/fricas-devel/8a0019d9-e2d0-44c9-a899-682e4361e6a4n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/CAHnU2dYvmH4BbF8TLrdkiW9f2MOMjZ0Drb4B3W2B3Xb9KW_ksw%40mail.gmail.com.