On Mar 12, 2009, at 8:47 PM, Nicolas M. Thiery wrote:

>       Dear Robert,
>
> Hmmm. Quite an interesting discussion. Could anyone try to make some
> sort of synthesis of the different opinions expressed in this thread?
>
> On Thu, Mar 12, 2009 at 12:18:45PM -0700, Robert Bradshaw wrote:
>> As mentioned, everything can be seen as a Z-module. This would mean
>> that every time I implement _mul_ I would have to handle this case.
>> It's much simpler to let _mul_ only worry about the ring (or group,
>> or field...) multiplication. One can define _rmul_, _lmul_, ... for
>> actions.
>
> +10
>
> Just 2 cents:
>
>  - I would reserve _lmul_, _rmul_ ... for actions which can be
>    considered as some sort of multiplication by scalars,

It is. The semantics for _rmul_ and _lmul_ are that the other element  
is guaranteed to be a scalar (i.e. a member of your basering).

> and using another name like the one you suggested for other actions
>
>  - I see 10*bla as (potentially) involving two independent things:
>    coercion and multiple dispatch

Yep, though in my mind they're a bit more intertwined (e.g. for a \in  
Z, b \in QQ[x], one can do a*b by doing a coercion then an action,  
b._lmul_(QQ(a)).

> For whatever it's worth, I had started writing a draft of paper on the
> coercion (= implicit conversion) and multiple dispatch mechanism I had
> implemented in MuPAD:
>
> http://mupad-combinat.svn.sourceforge.net/viewvc/mupad-combinat/ 
> trunk/MuPAD-Combinat/Papers/2007-12-13-Overloading.tex?view=markup
>
> Strangely enough, I lost part of my motivation for working on this
> shortly after :-)

I'll take a look. I've been intending to write this up as a paper  
too, but haven't found the time yet.

- Robert



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

Reply via email to