develooper Front page | perl.perl5.porters | Postings from June 2017

Re: lib/_charnames.pm puts references in %^H

Thread Previous | Thread Next
From:
demerphq
Date:
June 15, 2017 13:03
Subject:
Re: lib/_charnames.pm puts references in %^H
Message ID:
CANgJU+U=RhKC5p0UGjOiL=qkRF=+FUdk1furbrfjO1Q9eMP_Gw@mail.gmail.com
On 15 June 2017 at 12:28, Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> wrote:
> On Thu, 15 Jun 2017 03:01:28 +0200
> demerphq <demerphq@gmail.com> wrote:
>
>> During compilation this hash may be used to store complex
>> structures, such as code references, however once compilation is
>> completed these structures will be flattened to a representation
>> that means that only simple values can be accommodated and retrieved
>> at run time via C<caller()> as above.
>
> I'd say that doesn't quite fit with Zefram's clarification. I'd write
> something more like:
>
>   During compilation this hash may be used to store complex structures,
>   such as code references, as well as simple non-referential scalars. A
>   flattened copy of the values written into the hash is stored with the
>   code that was compiled while it was in effect, and is the copy
>   available via the C<caller()> mechanism. This copy preserves simple
>   strings and numbers, but will not preserve more complex values like
>   references.
>
> Just to really hammer home the point that was clarified; in that
> there's two copies storing two versions of the truth, and whether or
> not references work depends on which copy you are reading from.

Agreed, that is much nicer text. Thanks. I pushed it to the
yves/doc_hints branch. Once people have had a fair chance to make
further improvements ill squash them all down to a single patch.

As an aside there was one thing, do we say "compile time"  or
"compile-time"? Same question for "run-time" and "run time". I noticed
there was existing text with a hyphen, and some without, so i went for
the hyphenated form. Anybody know which is the right form for our
docs?

The form with a hyphen is most common with "run", and the form with a
space is most common with "compile", but the form with a hyphen is
most common overall.  So I am not sure what to do. Am I wrong in
thinking we should use one form consistently?


$ for m in run compile; do for t in "-time" " time"; do echo "$m$t"
$(git grep "$m$t" | wc -l); done; done
run-time 266
run time 143
compile-time 243
compile time 317

For just pod files (or lines that mention pod i guess, not entirely
scientific this...)

$ for m in run compile; do for t in "-time" " time"; do echo "$m$t"
$(git grep "$m$t" | grep pod | wc -l); done; done
run-time 81
run time 58
compile-time 99
compile time 110

cheers,
Yves

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