in reply to Five Features Perl 5 Needs Now

It's also worth noting that chromatic also submitted a patch to p5p to introduce the class keyword, see for example here and many other recent threads on p5p.

Replies are listed 'Best First'.
Re^2: Five Features Perl 5 Needs Now
by JavaFan (Canon) on Dec 19, 2008 at 12:16 UTC
    Yes, but Rafael doesn't like it as it's now, as it adds very little to perl - it just adds syntax. I can't say I disagree with that.
      What's wrong with adding "just syntax" for now?

      "Just syntax" is the difference between how you use the regex engine in Perl, and how you use it most other languages (where load a library, compile a pattern, and match it).

      "Just syntax" is often the difference between a feature that's used very often, and one that's mostly avoided.

      "Just syntax" is also what distinguishes Perl from most other languages, and Perl 6 from Lisp. (Ok, my last point about Perl 6 is not 100% serious, but you get the picture).

        It's "just syntax" in that it over little more than a different name from the keyword 'package' - the only difference is that it comes with a trailing scope. So you can do:
        class FOO { BLOCK }
        instead of
        { package FOO; BLOCK }
        It won't even save you on keystrokes; 'class' can clash with an existing subroutine, so you'd need a 'use feature' to actually use it.

        And "it's just syntax" means that there's no addition semantics in the BLOCK. Rafael said it would be more worthwhile if the BLOCK had additional properties; methods for instance (with compile time lookup, and not callable as subs).