Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^6: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff

by likbez (Sexton)
on Sep 11, 2020 at 14:20 UTC ( [id://11121615]=note: print w/replies, xml ) Need Help??


in reply to Re^5: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
in thread What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on Re^6: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
  • Download Code

Replies are listed 'Best First'.
Re^7: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
by dave_the_m (Monsignor) on Sep 11, 2020 at 14:52 UTC
    How would the parser know to give a "missing continuation" error message? '+$d+$e' is perfectly legal perl code, albeit code which gives rise to the warning "Useless use of addition (+) in void context".

    The reason I gave that code as an example is that it's a perfectly normal way of spreading complex expressions over multiple lines: e.g. where you need to add several variables together and the variables have non-trivial (i.e. long) names, e.g.

    $pressure = $partial_pressure_nitrogen + $partial_pressure_oxygen + $partial_pressure_water_vapour + $partial_pressure_argon + $partial_pressure_carbon_dioxide;
    In this case, the automatic semicolons are unhelpful and will give rise to confusing error messages. So you've just switched one problem for another, and raised the cognitive load - people now need to know about your pragma and also know when its in scope.

    Dave.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^7: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
by Tux (Canon) on Sep 12, 2020 at 09:38 UTC

    You also completely ruin maintainability and extensibility. Consider a filter module ...

    my $fixed = $bad =~ y/\x{00d0}/\x{0110}/r # Eth != D-stroke =~ y/\x{0189}/\x{0110}/r # LETTER AFRICAN D != +D-stroke =~ s{\bpra[ck]ti[sc]e\b}{practice}gr # All 4 seen in docume +nt AB12.38C =~ s{\bX13\.GtrA\.14\b}{X13_GA12}gr # Product got renamed =~ s{\b1234\s*zip\b}{1234ZIP}gir # Reciever will crash +on badly formed ZIP code =~ s{\bpays\s*-?\s*bas\b} {The Netherlands}gir # French forms :( =~ ....;

    The more examples I see posted by my esteemed co-monks, the less I like the idea, and I hated it already when I read it in the OP.


    Enjoy, Have FUN! H.Merijn
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^7: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
by ikegami (Patriarch) on Sep 14, 2020 at 22:11 UTC

    Yes, and the user will get an error.

    Then your suggestion would break a very useful feature. So useful that I take advantage of it in virtually every one of my programs/modules.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-20 02:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found