in reply to Re^5: Two more Features Perl 5 Maybe Needs
in thread Five Features Perl 5 Needs Now

Well Princes of Perlport ... Sigils or not sigils, is this here the question?

Many styleguides in many languages tell the programmers to use a naming convention e.g. special post- or prefixes to distinguish which datatype you use. (e.g. Hungarian notation)

For me, well done sigils are just a build-in naming convention and perl6 tries to go this way, by making @arr[1] acting like $arr[1].

And IMHO Perl without sigils already exists, it's called Ruby! ; )

UPDATE: seriously, changing the parser such that he accepts variables without sigils IMHO results in reinventing Ruby...

Replies are listed 'Best First'.
Re^7: Two more Features Perl 5 Maybe Needs
by jdporter (Paladin) on Dec 21, 2008 at 20:50 UTC
    a built-in naming convention

    That's sounds paradoxical; and in any case seems to violate the timtowtdi spirit of Perl.

    by making @arr[1] acting like $arr[1]

    And that's part of my argument: One of the few situations where sigils actually serve a constructive semantic purpose is being eliminated. Sigils are being rendered more gratuitous, not less. And sigils clearly violate the "Huffman encoding" philosophy of Perl grammar.

    Anyway, I've argued this in the past, and it's clear that @larry are quite undivorceably married to the idea of sigils, so they're staying. I have faith that Perl can cling to its relevance by other means.

    it's called Ruby!

    Need I say more.

      > That's sounds paradoxical; and in any case seems to violate the timtowtdi spirit of Perl.

      Well my "language" might be creative but I think you got the point! ; )

      But I can't imagine to easily eliminate sigils while continuing the mechanisms of perl's contexts...

      I'd prefere having even more sigils, also for coderefs and objects, since single symbols are better to read than ..._cref, ..._aref, ..._href and ..._oref

      >> it's called Ruby!
      > Need I say more.

      Actually Ruby HAS sigils ... just at other places!

      And I really like the concept e.g. of distinguishing instance- and class-variables! While it's ugly to double sigils @@classvar it's much more readable to write @instvar than $self->{instvar}

      So for readability I'm in favour of much more sigils!

      And by making them optional to use:

      use Sigil qw{ € ¥ ¢ ° };
      you still have MTOWTDI!

      I'd ask "so why don't you use Ruby straight away?" if the answer wouldn't be obvious... "Because it's not compatible with CPAN".

      So compability must be the crucial feature of any language extension. New sigils beyond standard ASCII can lead to this compability without many conflicts with old code.

      either in the coderange from 128-255 or Unicode! Keymapping of the editor might be a problem, so there might be a fallback solution like $@arr instead of €arr, like the fallback solution in perl6 for » with >>.

      and all these extra sigil could be automatically translated in plain perl code.