Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote:
Em Qui, 2009-05-28 às 09:27 -0500, John M. Dlugosz escreveu:
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote:
Em Qui, 2009-05-28 às 00:24 -0500, John M. Dlugosz escreveu:
Please see <http://www.dlugosz.com/Perl6/web/info-model-1.html>
and talk to me about it.
The illustratino is cool, but it doesn't take into account the
possibility of:
@a[0] := $x;
Where in the synopses does it say anything like that is possible? := is
applied to a _name_.
I don't recall if it is in the synopsis... but it is a general
expectation, and, I think, this was discussed in IRC for a long time.
But certainly is a good time to either put on the spec or drop the
expectation...
daniel
I agree with you there. This Information Model will handle putting an
Item Container into a primitive slot in a collection, and it "just
works" after that. This seems to be a useful way of pinning down the
abilities and limitations of iterators and modifying containers while
iterating on them, in a way that is implementation-agnostic but well
defined. So, there should be an easy way to do that. Extending the
meaning of := to work in more general terms, "create an lvalue that may
be aliased, assigned to, etc. initially holding the RHS as its value"
might be just what people expect it to do, given the symmetry between
symbol tables and other collections.
But, if you limit the availability of := to declaration-time only (or
pre-declared to accept that, but who needs it?) to allow the compiler to
optimize based on *knowing* the container type, then a different syntax
might be better, since you can make it work on a symbol table entry
(alias something else) without actually binding the symbol.
Just thinking out loud. Wait for the picture.
--John