develooper Front page | perl.perl5.porters | Postings from November 2011

Re: RFC: Autoloading charnames

Thread Previous | Thread Next
From:
David Golden
Date:
November 22, 2011 14:18
Subject:
Re: RFC: Autoloading charnames
Message ID:
CAOeq1c-Cyh__kQKN-+fcXf=Di+O_+-15WcJhxT6g3_X5S63zVg@mail.gmail.com
On Tue, Nov 22, 2011 at 5:03 PM, Karl Williamson
<public@khwilliamson.com> wrote:
> It has been proposed that charnames automatically load when a \N{} is seen.
>  That is easy to do, and I think it should load as if the :full and :short
> options had both been specified.
>
> Does anyone disagree with doing this?

What are the pros and cons, specifically, of choosing either or both
of :full and :short?  Would it be loaded at compile time or runtime?

> If it is done, should the functions in the module also autoload.  That is,
> should a line like 'my $poo = charnames::viacode(0x1F4A9)' fail if charnames
> hasn't been 'used' or 'required' or should it cause the module to load ?

I don't like general-purpose auto-loading.  However, I can see the
case for \N{} (just I saw the case for autoloading IO::File when
methods are called on filehandles.  If \N{} does load charnames, then
I would expect charnames::viacode(...) to work.  However, without
prior \N{} (assuming compile-time loading), I would expect
charnames::viacode() to be a compilation error.

-- David

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