>> BTW: Why can I not use this for List PI?
>>
>> >> Apparent user error:
>> Cannot coerce lc
>> of mode (List (PositiveInteger))
>> to mode (List (Integer))
>>
>> The other way round would make sense for me.
>> But PI is a subset (and subtype) of INT ...
>> What am I missing again? These errors are not
>> so apparent for me ;-)
Why do you say, you cannot?
L==>List PI
cumSum(l: L): L == (empty? l => []; s:PI:=first l;[(s:=s+i) for i in l])
But otherwise the question you were posing is not about this code but
rather more general.
If there is a function coerce: A -> B, by what rule would there be a
function
coerce: Foo(A) -> Foo(B)
? In our case Foo would be List, but if the compiler special lifting
feature built in for List, then why not for MyList (which would be my
implementation of List, but not using List at all)?
Do you see what the problem in general is? As long as there is no code
in the definition of Foo that exports and implements such a coerce,
there is no way, for the compiler to give you that (except someone
builds it into the compiler).
Ralf
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en.