Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5?

by blazar (Canon)
on Mar 10, 2005 at 08:07 UTC ( [id://438179]=note: print w/replies, xml ) Need Help??


in reply to Re: (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5?
in thread (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5?

Macros.
Now that you mention them it occurs to me that another desirable feature could be the possibility of creating user defined (infix, postfix, postcircumfix, etc.) operators. But I doubt that even hypothetically this could be doable without anything close to Perl6's powerful prototyping.

Replies are listed 'Best First'.
Re^3: (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5?
by BrowserUk (Patriarch) on Mar 10, 2005 at 08:29 UTC

    I'd like that ability too, but I seriously doubt it is possible.

    Having (just) managed to work my way through the process of adding a new keyword, I have a new (but still basic) understanding of the process involved in toke.c.

    I cannot imagine that it would be an easy task to allow the addition on new operators on the fly.

    If the macro facility was added, then you might be able to define a few catchall keywords that would act as placeholders in the syntax. Say uniop() and binop() and then wrap those in macros to define an new operator. Not sure about that.


    Examine what is said, not who speaks.
    Silence betokens consent.
    Love the truth but pardon error.
      Having (just) managed to work my way through the process of adding a new keyword, I have a new (but still basic) understanding of the process involved in toke.c.
      Hey, you can't give that hint without telling the whole thing: now I'm too curious. What is it? What is it about?
      If the macro facility was added, then you might be able to define a few catchall keywords that would act as placeholders in the syntax. Say uniop() and binop() and then wrap those in macros to define an new operator. Not sure about that.
      And even in that case it wouldn't have quite the same power Perl6's equivalents are supposed to have, e.g. in terms of user-definable priority. Unless a whole array of new uniop()s and binop()s are also defined, which seems rather awkward after all...
        What is it? What is it about?

        I've implemented say. Would you care to test the patch for me?

        It's built against the perl5.8.6 sources from CPAN. I don't have bandwidth to stay current with bleedperl.

        If a few other people would care to try this for me, drop me an email addy by /msg and I'll forward the patch.

        It's all of 63 lines. I guess I could post it here if that would be easier?


        Examine what is said, not who speaks.
        Silence betokens consent.
        Love the truth but pardon error.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-03-28 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found