Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: Five Features Perl 5 Needs Now

by moritz (Cardinal)
on Dec 19, 2008 at 14:39 UTC ( [id://731554]=note: print w/replies, xml ) Need Help??


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

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).

Replies are listed 'Best First'.
Re^4: Five Features Perl 5 Needs Now
by JavaFan (Canon) on Dec 19, 2008 at 16:57 UTC
    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://731554]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-25 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found