Nathan Wiger wrote:

> Perhaps qi() for "interpolate" or something else.

coming to Perl from Scheme I recall some distress that
I had to create

        ($j=$i) =~ s/(\$\S+)/$1/ge;

instead of what I wanted to do

        $j=qqq/$i/;

so my nomination is for tokens matching /qq*/ to behave like
subsequent applications of evaluation within quotes, even though
it opens the door to a world of taint.


...

> Basically, <> is left as direct access to the iterator, but it's not
> magically called except where it clearly make sense (and I don't think
> normal variable manip like passing into subs and hashes should be in this
> category).

me too


 
> Hmmm, I'm not sure about the "iterator object" you're implicitly proposing
> above. Is it going to be standard fare to assume certain types of objects
> are created from certain constructs? What would this do?

I took the iterator object assumption to imply that dotdot in scalar
context was being defined to return tied scalars that return consecutive
numbers, so we can forget about storing all these eminently optimizable
sequential temporary arrays.



 
>    $iter = (1..10);
> 
> The same thing as above? What about:
> 
> 
> What would these do?

I'd parse them, in my hubris, like so:

>    $iter = (1,2,3,4);

p5: $iter = \(1,2,3,4);
instead of this parsing into comma operator which is what p5 appears
to do with it.

>    $iter = (5,7..10);
since the dotdot is within another array constructor here, we get
another reference to an array instead of a magic iterator. It can
become a rfc123-compliant magic iterator like so

        $iter = ?(5,7..10);

For the rest, assignment is stronger than comma, unless that gets changed.
>    $iter = 1, 2, 3;
>    $iter = a, b, c;
>    $iter = 1, 4 .. 10;



 
> Assuming, however, that we had an iterator object concept, I would say:
> 
> >     while ($x = @foo[$iter]) { ... }
> 
> Works.

so undef always passes through an array-lookup?

        defined(@arrayA[undef]) # always false?


> Phew! My brain hurst. ;-)
> 
> -Nate

i agree w/ e-thing

Reply via email to