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

Re: mauve::reftype()

Thread Previous | Thread Next
From:
demerphq
Date:
August 30, 2010 04:22
Subject:
Re: mauve::reftype()
Message ID:
AANLkTikz_myb1duBV1cjQNegu11FirtPvqpAre_FHVeU@mail.gmail.com
On 30 August 2010 13:18, Zsbán Ambrus <ambrus@math.bme.hu> wrote:
> On Mon, Aug 30, 2010 at 12:51 PM, demerphq <demerphq@gmail.com> wrote:
>> BIND, VSTRING and LVALUE lack an "example", and the others could have
>> their "examples" reviewed.
>
> The examples confuse me because C<< *STDOUT{IO} >> returns a reference
> to IO, whereas C<< $code->() >> uses up a reference (it won't even
> autovivify one).

Yes, well, I think maybe we should show both where it makes sense.

> Here are my suggestions.  All of these create a reference, and they
> also try to imply which ones are really scalar refs even where that
> complicates the code.

Thanks, ill try to patch it in.

>
> SCALAR (C<< \$x >>)
>
> REF (C<< \($x = \1) >>)
>
> LVALUE (C<< (&{sub { *x = \$_[0] }}(substr("",0)), \$x) >>)
>
> VSTRING (C<< \($x = v1.0.0) >>)
>
> GLOB (C<< \($x = *y) >>)
>
> ARRAY (C<< \@x >>)
>
> HASH (C<< \%x >>)
>
> CODE (C<< \&x >>)
>
> FORMAT (C<< (eval "format =\n.", *STDOUT{FORMAT}) >>)
>
> IO (C<< *STDOUT{IO} >>)
>
> BIND -- I don't know what these were or are
>
> REGEX (C<< qr// >>)
>
> UNKNOWN -- there should be no example

Agreed. Im not even sure UNKNOWN should be documented.

Yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About