develooper Front page | perl.perl5.porters | Postings from March 2023

Re: Pre-RFC Deep constants

Thread Previous | Thread Next
From:
demerphq
Date:
March 13, 2023 10:30
Subject:
Re: Pre-RFC Deep constants
Message ID:
CANgJU+UfV-d06FW1t2=bq0G2it4HB3tLBBf=u4U3yEFKwDkBpA@mail.gmail.com
On Mon, 13 Mar 2023 at 11:03, Ruud H.G. van Tol via perl5-porters <
perl5-porters@perl.org> wrote:

>
> On 2023-03-10 10:24, Ruud H.G. van Tol wrote:
> > On 2023-03-09 17:58, Robert Rothenberg wrote:
> >> I'm a fan of using constants in code, and often using interpolatable
> >> constants with something like Readonly or Const::Fast for deep
> >> constants:
> >
> > I think it is good to list all that can be meant by 'constant'.
> >
> > There are constants that direct compilation.
> > For example to "compile out" a part of the code.
> > Or constants that can be inlined at compilation.
> >
> > Per process there is $^T, generally a fixed integer.
>

Sadly $^T is not a constant, nor read-only.  I have been bitten by that
before.


> > Etc. etc.
> >
>
>  From tchrist (2011), in a different context:
>
> | Note also that anything that pretends
> | there’s a such thing as a negative constant
> | doesn’t understand the grammar; just run
> | perl -MO=Concise,-exec -le '$x = -3**$y'
> | to find out the whys and the wherefores.
>

 Interesting. I'd call that a bug not a feature.

cheers,
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