Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

by Anonymous Monk
on Mar 09, 2005 at 17:00 UTC ( #437958=note: print w/replies, xml ) Need Help??


in reply to Re^2: (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?

I see no reason why it couldn't be implemented in current Perl, as infix ~~ doesn't clash with any existing operator.
There isn't a technical reason why it couldn't be implemented. I think the main reason it won't get implemented is that the people really wanting it aren't going to write the patch, and the few that do write large patches for perl5 have other priorities.

Write a solid patch that does implement binary ~~, addressing all possible backwards compatability issues, and you'll have a decent chance of getting the operator in Perl.

And that's true for all Perl6 features people want find its way into Perl5. Wishing for it won't get it implemented. Voting for them won't get them implemented. Discussing here how useful the features would be won't get them implemented.

The basic rule for adding new features to perl5 has been for several years: write a patch that adds the feature. Discussing the idea on p5p first might not be a bad idea, (if only to avoid doing work for something that won't get accepted). But unless you write the patch, or find someone to write it, it's unlikely to be added.

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

Replies are listed 'Best First'.
Re^4: (Sort of) poll: what Perl6 features do you consider {likely,desirable} to leak into P5?
by Juerd (Abbot) on Mar 09, 2005 at 19:15 UTC

    And that's true for all Perl6 features people want find its way into Perl5.

    Only in theory. Some syntax is incompatible and will because of that not happen. Some things are, compared to big things like currying, an object model, good threading, junctions, hyperops, and rules, quite simple to implement. Operators like // and ~~ are good examples. Of these, // is much easier to implement, and that's probably why it already has been implemented. That doesn't mean nobody will volunteer to code up ~~.

    Wishing for it won't get it implemented. Voting for them won't get them implemented. Discussing here how useful the features would be won't get them implemented.

    Very true, but I don't understand why you even took the time to type that. It's something everybody knows, and in the context of this thread could very well be interpreted as a plea to please no longer discuss Perl 5 innovation.

    Perl 5 isn't dead just yet, and we'll be using it for a long time. If someone can implement ~~, that almost gives given/when for free. I'm not saying it should be done. I'm also not at all suggesting that people who have better things to do "waste" their time on this.

    Also, wishing for features does get you into a Perl 6 mood. Every time I code Perl 5 I think "I wish I had $perl6_feature, it'd certainly make my life a bit easier this minute" every so many lines. It makes me appreciate Perl 6 and all the effort people put into its creation.

    Discussing the idea on p5p first might not be a bad idea, (if only to avoid doing work for something that won't get accepted).

    But discussing it on Perl Monks gets us whiny replies like yours. I regret that I'm even spending time to reply, but such is my nature.

    But unless you write the patch, or find someone to write it, it's unlikely to be added.

    Amen, but so what?

    Let us dream and discuss the new features. If not for Perl 5, then to celebrate Perl 6 in advance.

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

      Of these, // is much easier to implement, and that's probably why it already has been implemented.
      No. The main reason it was implemented is because people have wanted this for at least a decade. And wanted it badly. There have been some very heated arguments about this operator (and its name, anyone remember the ||| and ?? suggestions?) in the past.
      in the context of this thread could very well be interpreted as a plea to please no longer discuss Perl 5 innovation.
      Then you have missed the meaning of what I wanted to indicate. My point is that, compared with the past, development of Perl5 seems to be done by only a few people. I'd welcome it if more people worked on Perl5!
      But discussing it on Perl Monks gets us whiny replies like yours.
      The only thing that gets me 'whiny' is when I see people suggesting things that should be implemented - but without doing the legwork themselves. I read your see no reason why it couldn't be implemented in current Perl as being such a suggestion.

      My point is that we can all wish for Perl6 features to be implemented in Perl5, but that "not breaking backwards compatability" isn't the only reason they won't find their way into Perl5. Someone has to actually do the work.

      But unless you write the patch, or find someone to write it, it's unlikely to be added.
      Amen, but so what?
      Well, you saw no reason why it couldn't be implemented in current Perl - but I did. And that's the reason.

        The main reason it was implemented is because people have wanted this for at least a decade. And wanted it badly. There have been some very heated arguments about this operator (and its name, anyone remember the ||| and ?? suggestions?) in the past.

        If the idea behind the feature that ~~ represents existed this long, it would have too. It is new, though. However, it gives us given/when and THAT has also been wanted for a very long time. Just see Google Groups and our own Perl Monks for proof. In fact, I think a switch statement has been asked for/about much more often than defined-or.

        I read your "see no reason why it couldn't be implemented in current Perl" as being such a suggestion.

        I was evaluating the technical possibility, not implying that it SHOULD be done.

        Well, you saw no reason why it couldn't be implemented in current Perl - but I did. And that's the reason.

        It could, but it probably won't.

        Or, well, I asked xmath if it would be easy to implement ~~ so that it called a perl side sub. This would enable me to do the comparisons themselves in Perl, probably reusing some logic from Switch.pm. (Consider File::Glob.) xmath answered my question by saying it wouldn't be a great deal of work, and my gut says he's already started working on it even though I haven't asked for the actual implementation yet :)

        And he brought up an improbable but existing clash: foo~~bar is now foo(~~bar). But I think we should just strongly state that scalar should be written as scalar instead of ~~ ;) (Those who really want to use ~~ for the first argument of a function, can use + or parens to disambiguate.)

        Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2018-11-14 19:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (177 votes). Check out past polls.

    Notices?