develooper Front page | perl.perl5.porters | Postings from August 2010

Re: mauve::reftype()

Thread Previous | Thread Next
Ben Morrow
August 30, 2010 05:16
Re: mauve::reftype()
Message ID:
> LVALUE (C<< (&{sub { *x = \$_[0] }}(substr("",0)), \$x) >>)

It doesn't need to be that complicated. \substr("", 0) will do just
fine. I don't think it's worth trying to include a '\$x' where it adds
that much complication.

> GLOB (C<< \($x = *y) >>)

I presume you included $x in the example because you think this is
'really' a SCALAR ref? I disagree. Globrefs are different from scalar
refs in important ways; apart from anything else, they've got their own
deref operator.

> BIND -- I don't know what these were or are

Will be. The intention is (or was) to use this SvTYPE for read-only
aliases, as in Perl 6. IIRC Chip was working on an implementation, but I
haven't seen anything about it for quite a while.

> REGEX (C<< qr// >>)

A REGEX, OTOH, could reasonably be considered a SCALAR ref. It's derefed
with $, the result fits in a scalar variable, &c.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About