Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Five Features Perl 5 Needs Now

by JavaFan (Canon)
on Dec 19, 2008 at 12:16 UTC ( [id://731533]=note: print w/replies, xml ) Need Help??


in reply to Re: Five Features Perl 5 Needs Now
in thread Five Features Perl 5 Needs Now

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.

Replies are listed 'Best First'.
Re^3: Five Features Perl 5 Needs Now
by moritz (Cardinal) on Dec 19, 2008 at 14:39 UTC
    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).

        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.

        It does more than that. The block executes at BEGIN time, and you can optionally inherit from multiple parents with class Baz is Bar is Foo { ... }.

        That's not a complete revision of Perl 5's object system, but it is a start. Besides that, it's exactly the syntax of Perl 6 -- and I believe it's more descriptive and easier to understand than messing with @ISA or base or parent.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://731533]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-25 15:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found