Re: Why pass by reference?

2009-06-18 Thread Martin D Kealey
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

Re: Why pass by reference?

2009-06-18 Thread Martin D Kealey
> Matthew Walton wrote: > > If a user of your API contrives to make it change while you're > > running, that's their own foot they've just shot, because they can > > look at the signature and know the semantics of the parameter > > passing being used and know that if they change the value external

Re: Why pass by reference?

2009-06-17 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-vts-systems.de |Perl 6| wrote: HaloO, Matthew Walton wrote: If a user of your API contrives to make it change while you're running, that's their own foot they've just shot, because they can look at the signature and know the semantics of the parameter passing being used a

Re: Why pass by reference?

2009-06-16 Thread TSa
HaloO, Matthew Walton wrote: If a user of your API contrives to make it change while you're running, that's their own foot they've just shot, because they can look at the signature and know the semantics of the parameter passing being used and know that if they change the value externally before

Re: Why pass by reference?

2009-06-15 Thread Matthew Walton
> Complex or not in that sense, it complicates things in allowing the value to > be changed by another path.  I think that is something we want to avoid > doing, not present as a feature.  Much of my original post concerns the > actual meaning, not whether it is considered simple. > > Since then, I

Re: Why pass by reference?

2009-06-15 Thread Matthew Walton
> Complex or not in that sense, it complicates things in allowing the value to > be changed by another path. I think that is something we want to avoid > doing, not present as a feature. Much of my original post concerns the > actual meaning, not whether it is considered simple. > > Since then, I

Re: Why pass by reference?

2009-06-14 Thread John M. Dlugosz
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: Actually, it only looks complicated while you think only on the callee side. No, in general it requires introducing a read-only proxy in front of the container. This may be optimized away when it can be tracked at compile-time, but that's certa

Re: Why pass by reference?

2009-06-14 Thread Daniel Ruoso
Em Dom, 2009-06-14 às 15:53 -0500, John M. Dlugosz escreveu: > In Perl 6, the default parameter passing is to make a read-only alias > for the caller's lvalue. This means that the function may not change > the caller's variable, but must track changes to it made by other means. > What is the poi

Why pass by reference?

2009-06-14 Thread John M. Dlugosz
In Perl 6, the default parameter passing is to make a read-only alias for the caller's lvalue. This means that the function may not change the caller's variable, but must track changes to it made by other means. What is the point? It is a contrivance to illustrate how the variable can be chan