Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Perl6: What is "idfirst letter"?

by rir (Vicar)
on Sep 07, 2011 at 20:44 UTC ( #924669=perlquestion: print w/ replies, xml ) Need Help??
rir has asked for the wisdom of the Perl Monks concerning the following question:

Quoting Synopsis 2:
The $Package'var syntax is gone. Use $Package::var instead. (Note, however, that identifiers may now contain an apostrophe or hyphen if followed by an "idfirst" letter.)
This seems to be the only occurance in the Synopses of the term "idfirst". What is it and is it current?

Be well,
rir

Comment on Perl6: What is "idfirst letter"?
Re: Perl6: What is "idfirst letter"?
by Anonymous Monk on Sep 07, 2011 at 21:03 UTC
    I guess it is like [a-zA-Z] in perl5, has to be first letter of subroutine name sub a4567, except perl6 equivalent (probably similar)
      The set is much much larger than that in Perl5. For example, identifiers can start with "_" and "é".
Re: Perl6: What is "idfirst letter"?
by ikegami (Pope) on Sep 07, 2011 at 21:05 UTC

    Identifiers are usually of the form

    identifier: idfirst idcont*

    For example, identifiers can usually contain digits, but not in the first position.

    It sounds like Perl6 will allow

    identifier: idfirst idcont* ( [-'] idfirst idcont* )*

    What is it and is it current?

    Actually, identifiers aren't well defined in Perl5. Tom Christiansen tried to hammer down the definition on p5p in the last two weeks, but I didn't follow the conversation. I'll locate it if you ask.

Re: Perl6: What is "idfirst letter"?
by moritz (Cardinal) on Sep 07, 2011 at 21:08 UTC
      Well, in Perl5, "[" and U+0001 are allowed as the first (and only) character of an identifier, but I don't think anyone would consider them idfirst. I don't know if Perl6 has such exceptions.
        No. There are special variables with "weird" names ($/, $!, $¢) but they aren't identifiers.

        I also don't think that [ counts as an identifier character in Perl 5, because you can't write sub [ { }

Re: Perl6: What is "idfirst letter"?
by tchrist (Pilgrim) on Sep 08, 2011 at 18:54 UTC
    “idfirst” is jut an abbreviation for any code point with the Unicode ID_Start property.

    Anyway, Perl identifiers don’t seem to pay as much attention to IDS as you would think. You can start them with other types of decimal numbers and connector punctuation, both of which are IDC (ID_Continue) not IDS.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://924669]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2014-10-21 01:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (94 votes), past polls