Kurt Pagani wrote:
>
> Not bad ;)
> Now we can compare types:
>
> )abbrev package CMPTYPE CompareTypes
> CompareTypes(T:Type,S:Type):Exports == Impl where
> SEX ==> SExpression
> Exports == with
> sameType? : (T, S) -> Boolean
> Impl == add
>
> import TypePackage(T)
> import TypePackage(S)
>
> sameType?(x:T,y:S):Boolean ==
> test ( typeof(x)::SEX = typeof(y):: SEX )
>
>
> sameType?([1,2,3],[4,5]) -> true
> sameType?([1,2,%pi],[6,7]) -> false
> ...
I wonder what is the goal of this excercise?
BTW: Both in Spad and in interpreter overload resolution
takes into account target type. So for expressions anwer
depends on how you ask the question...
BTW2: The desion goal of FriCAS typesystem was that anwer to
questions like 'sameType?' should be mostly statically known,
without need for runtime tests (I write "mostly" because
Union-s require some testing).
--
Waldek Hebisch
--
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.