in reply to [Perl6] Small 6 discoveries V, Sigils

I certainly don't want to get rid of sigils.

In the proprietary programming language that I am using the most frequently after Perl, all variable names start with with a # character. Then, I am also doing quite a bit of shell programming, where variables start with $ (when you use hem).

So, when I am using other programming languages su as C, Python or Scala, I have trouble telling variables from other identifiers. Sigils are so useful for me to know at first sight what kind of a beast I'm dealing with! I have almost come to the feeling that sigil-less programming languages are somewhat crippled. ;-)

  • Comment on Re: [Perl6] Small 6 discoveries V, Sigils

Replies are listed 'Best First'.
Re^2: [Perl6] Small 6 discoveries V, Sigils
by Anonymous Monk on Oct 23, 2017 at 21:32 UTC
    I agree with Laurent. And I could do with more sigil, which is more controversial. As much I would like to get rid of the € as a French currency, I would like to have it as sigil for types that are Associative, Positional and Scalar. Many kinds of tree nodes could have that property. In Perl 6, a match acts like it has these properties but can't advertise it with .^roles (see below). $/ would be written as €/. Ironically, a non match is Nil and not Match. And one successful match value cannot be used as an invocant to .^roles :
    'a' ~~ /a/; say $/.^roles OUTPUT: «(exit code 1) Unexpected named argument 'transitive' passed