On Wed, Feb 9, 2011 at 6:43 PM, Dox <o.castillo.felis...@gmail.com> wrote:
> Hi people!
>
> I was wondering if there is a way of bundle two kind of different
> objects together and define operations on them.
>
> Suppose, I'd like to bundle a number and a string (3, Hello) and (4,
> World!!)... then define and operation which multiplies the numbers and
> add strings, so the result is (12, HelloWorld!!)
>
> Something like that!

Yes. See, for example, how the sage.misc.preparser.BackslashOperator
is implemented. (I think we have a more generic one, but I'm not sure
where it is.)

- Robert

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

Reply via email to