On 11/11/2008 11:38 AM, Martin Rubey wrote:
> Robert Bradshaw <[EMAIL PROTECTED]> writes:
> 
>> In Sage, we use the term "coercion" to denote a canonical (using the  
>> term a bit loosely), implicit map between Parents (or objects of a  
>> concrete category). E.g. from ZZ to F5 would be a "coercion," but  
>> there is a "conversion" and not a "coercion" the other direction.  
>> Coercions are invoked to do arithmetic, but conversions are not. 

> Just for the record, this is *exactly* the same definition as in FriCAS.

Exactly.

> (in case you wonder, the notation "Object::SomeType" is syntactic sugar for
> "coerce(Object)@SomeType", where @ is a language builtin, that selects the
> function according to return type.

And, as Robert kindly explained (thank you), it is written 
"SomeType(Object)" in Sage.

The only difference between Sage and Aldor/panAxiom is that Sage checks 
whether the Object can be coerced to SomeType at runtime whereas Aldor 
and SPAD allow to check at compile time.

And I don't say that "some string"::Integer is impossible to succeed, it 
is only a question whether the compiler sees (has in scope) a function 
coerce: String->Integer that would do the job... of course at compile 
time. (By the way, if one defines this coerce to be the length of the 
string and takes + as the concatenation of strings then this coerce is 
even a homomorphism from the String monoid into the integers considered 
as an additive monoid.)

Ralf

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to