On Mon, 19 May 2014 13:31:08 -0400, Ola Fosheim Grøstad <ola.fosheim.grostad+dl...@gmail.com> wrote:

On Monday, 19 May 2014 at 17:11:43 UTC, Steven Schveighoffer wrote:
It shouldn't matter. Something that returns immutable references, can return that same thing again if asked the same way. Nobody should be looking at the address in any meaningful way.

I think this is at odds with generic programming. What you are saying is that if you plug a pure function into an algorithm then you have to test for "pure" in the algorithm if it is affected by object identity. Otherwise, goodbye plug-n-play.

I think I misstated this, of course, looking at the address for certain reasons is OK, Object identity being one of them.

But some of the tricks being detailed here as "proof" that we cannot memoize are not really valid code.

Returning the same immutable object, when called with the same immutable parameters, should never cause a break in code, pure or not.

-Steve

Reply via email to