On 9/27/07, Fernando Perez wrote:
>
> On 9/27/07, Robert Bradshaw wrote:
>
> > I agree with your caution, but don't see how the examples above mess
> > anything up. If an object B wants to pretend to be immutable, it
> > merely has to check that nothing points to it before mutating itself
> > (and, in mutating itself, don't mutate objects that have other
> > pointers to them).
>
> Yup, I was just trying to illustrate the issues that could arise if
> one uses the assumption that refcount==1 <==> no side effects on
> in-place operations.  But with the proper care, it's a perfectly valid
> approach for optimizing expressions involving immutable objects.
> Given Bill's surprise, it probably wasn't totally useless to provide
> these examples :)
>

Very useful indeed, thanks! :-)

Regards,
Bill Page.

--~--~---------~--~----~------------~-------~--~----~
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://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to