[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl6-language
Subject:    Re: Why pass by reference?
From:       Martin D Kealey <martin () kurahaupo ! gen ! nz>
Date:       2009-06-19 6:19:16
Message-ID: alpine.DEB.1.10.0906191814530.10800 () feathers ! sig ! net ! nz
[Download RAW message or body]

On Fri, 19 Jun 2009, Martin D Kealey wrote:
> To that end I would propose that:
>  - parameters should be read-only AND invariant by default, and
>  - that invariance should be enforced passing a deep immutable clone
>    (*5) in place of any object that isn't already immutable.

Sorry, typo: that last word should have been "invariant", meaning that it
*won't* change, rather than "immutable", meaning that it *can't*.

Compilers can rely on invariance to perform a range of very powerful
optimizations; immutability is one way to guarantee invariance, but not the
only way.

-Martin
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic