Re: Transparent / Opaque references

2005-06-07 Thread TSa (Thomas Sandlaß)
Juerd wrote: $y() = 7; No, sorry, that looks to me as if $y is a reference to an lvalue sub, not like any form of referencing of scalars. I think it will come naturally to the C++ and Java folks. There the accessor kind of functions is either mapped into the name get_y() and set_y(value), or

Re: Transparent / Opaque references

2005-06-02 Thread wolverian
On Thu, Jun 02, 2005 at 10:45:45PM +0200, Juerd wrote: > If we allow "sub .foo", "sub :foo" comes naturally, and another > asymmetry is gone. > > It would also allow "multi sub" and "multi method" to simply become > "multi". I _really_ like the explicit 'method' name that methods have. Calling t

Re: Transparent / Opaque references

2005-06-02 Thread Juerd
"TSa (Thomas Sandlaß)" skribis 2005-06-02 22:22 (+0200): > The only thing that is a bit unclear to me is if the dot is part of the > operator name---like a sigil---or purely syntactical. A method is e.g. > also not defined with the dot: > class Blahh > { >method .example ( $non_invocant ) {...}

Re: Transparent / Opaque references

2005-06-02 Thread TSa (Thomas Sandlaß)
HaloO Juerd, you wrote: Except that () doesn't return a reference to an anonymous scalar of the list it surrounds. Of course not. The inside of the .() call operator has type Signature and the dispatch goes to the implementation that has the closest type distance to the types of the actual arg

Re: Transparent / Opaque references

2005-06-02 Thread Juerd
"TSa (Thomas Sandlaß)" skribis 2005-06-02 21:30 (+0200): > And it nicely lines up with $y[], $y{}, @a[], %h{} etc. as > dereferential expressions. Except that () doesn't return a reference to an anonymous scalar of the list it surrounds. Juerd -- http://convolution.nl/maak_juerd_blij.html http:

Re: Transparent / Opaque references

2005-06-02 Thread TSa (Thomas Sandlaß)
Juerd wrote: $y() = 7; No, sorry, that looks to me as if $y is a reference to an lvalue sub, not like any form of referencing of scalars. Well, it is a reference to an lvalue sub if it is just that :) As unspecificly typed as it stands there it could be anything that reacts to &postfix:<()>

Re: Transparent / Opaque references

2005-06-02 Thread Juerd
"TSa (Thomas Sandlaß)" skribis 2005-06-02 20:36 (+0200): > Might it be applicable to use .() as the dereferencer > of scalar variables that derefs to the next none(Ref) > type and if that is a Code it dispatches to it as expected? Or perhaps postfix $, to deref recursively. my $foo = 5;

Re: Transparent / Opaque references

2005-06-02 Thread TSa (Thomas Sandlaß)
Luke Palmer wrote: When we heard that Larry didn't acutally want $$foo to infinitely dereference, some of us were overjoyed, and others severely disappointed. Both transparent dereferencing (infinite $$foo) and opaque dereferencing (one-level $$foo) have their uses, but they are definitely disti

Re: Transparent / Opaque references

2005-06-01 Thread TSa (Thomas Sandlaß)
Juerd wrote: Thomas Sandlass skribis 2005-05-28 17:34 (+0200): I propose %hash = { key => :\$variable, foo => 'bar' }; :\$variable looks like many things to me, but not an alias. Let's forget that idea, because I have a bunch of better ones! $hash = { key => \ $variable but rw , foo =

Re: Transparent / Opaque references = Link / Ref

2005-05-30 Thread Juerd
"TSa (Thomas Sandlaß)" skribis 2005-05-30 8:58 (+0200): > [This is a repost, somehow it didn't get through before, sorry.] This is the fourth time it did get through to my mailbox, at least. Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http:/

Re: Transparent / Opaque references = Link / Ref

2005-05-29 Thread TSa (Thomas Sandlaß)
[This is a repost, somehow it didn't get through before, sorry.] Luke wrote: > Both transparent dereferencing (infinite $$foo) and > opaque dereferencing (one-level $$foo) have their uses, but they are > definitely distinct. Well, they are more like variations on a theme. > Instead of adding d

Re: Transparent / Opaque references

2005-05-28 Thread Juerd
Thomas Sandlass skribis 2005-05-28 17:34 (+0200): > >%hash = { key => undef, foo => 'bar' }; > >%hash := $variable; > >%hash = 5; # $variable is now 5 too > Sorry to interrupt, but wasn't {} not derefed when assigned > to a % variable? Don't get me wrong, I like this meaning. And > it

RE: Transparent / Opaque references

2005-05-28 Thread Thomas Sandlass
Juerd wrote: > The only real problem with having only infix := for binding, is that you > can't easily use an alias (aka transparent reference) in a list. You can > have an array of aliases, but it's harder to have an array or hash in > which one element is an alias. Binding can be done explicitly:

RE: Transparent / Opaque references = Link / Ref

2005-05-28 Thread Thomas Sandlass
Luke wrote: > Both transparent dereferencing (infinite $$foo) and > opaque dereferencing (one-level $$foo) have their uses, but they are > definitely distinct. Well, they are more like variations on a theme. > Instead of adding different syntax for each > kind, I'll propose something different:

RE: Transparent / Opaque references

2005-05-28 Thread Thomas Sandlass
Luke wrote: > Both transparent dereferencing (infinite $$foo) and > opaque dereferencing (one-level $$foo) have their uses, but they are > definitely distinct. Well, they are more like variations on a theme. > Instead of adding different syntax for each > kind, I'll propose something different:

Re: Transparent / Opaque references = Link / Ref

2005-05-28 Thread Thomas Sandlass
Luke wrote: > Both transparent dereferencing (infinite $$foo) and > opaque dereferencing (one-level $$foo) have their uses, but they are > definitely distinct. Well, they are more like variations on a theme. > Instead of adding different syntax for each > kind, I'll propose something differen

Re: Transparent / Opaque references

2005-05-28 Thread Damian Conway
Brent 'Dax' Royal-Gordon wrote: Juerd <[EMAIL PROTECTED]> wrote: There is no way to get an anonymous rw scalar, is there? There's always the Perl 5 hack: \do { my $x } Although that's not truly anonymous, I suppose. There's a less-well-known hack that *is* truly anonymous: $ano

Re: Transparent / Opaque references

2005-05-27 Thread Brent 'Dax' Royal-Gordon
Juerd <[EMAIL PROTECTED]> wrote: > There is no way to get an anonymous rw scalar, is there? There's always the Perl 5 hack: \do { my $x } Although that's not truly anonymous, I suppose. -- Brent 'Dax' Royal-Gordon <[EMAIL PROTECTED]> Perl and Parrot hacker

Re: Transparent / Opaque references

2005-05-27 Thread Ashley Winters
On 5/27/05, Juerd <[EMAIL PROTECTED]> wrote: > > There is no way to get an anonymous rw scalar, is there? Can't the [] and {} syntaxes be considered aliases for new Array(...) and new Hash(...)? my $x := new int = 10; # looks like it should work Ashley Winters

Re: Transparent / Opaque references

2005-05-27 Thread Juerd
Juerd skribis 2005-05-28 1:15 (+0200): > There are named arrays, @foo, and anonymous arrays, []. > > There are named hashes, %foo, and anonymous hashes, {}. > > There are only anonymous pairs. You can't dereference a pair, or bind a > name to it. I forgot an important one: There are named sca

Re: Transparent / Opaque references

2005-05-27 Thread Juerd
Luke Palmer skribis 2005-05-27 20:59 (+): > Opaque references always need to be explicitly dereferenced (except > for binding an array to an array reference, etc.). Transparent > references always automatically dereference. The decision of what > type of dereferencing will go on is left up to