Pathologically Eclectic Rubbish Lister | |
PerlMonks |
in reply to What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
Highly desirable Make a semicolon optional at the end of the line, if there is a balance of brackets on the line and the statement looks syntactically correct ("soft semicolon", the solution used in famous IBM PL/1 debugging compiler).
Why would this be highly desirable? Consider:
print( "Hello World" ) if( 1 );
versus
print( "Hello World" ) if( 1 < 2 ) { print("Goodbye"); };
Adding your change idea makes the parser even more complex and introduces weird edge cases.
I think even Javascript now recommends using semicolons instead of eliding them at the end of a line.
Update: Some examples where ASI in Javascript goes wrong:
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
by dsheroh (Monsignor) on Sep 10, 2020 at 09:07 UTC | |
by likbez (Sexton) on Sep 10, 2020 at 21:02 UTC | |
by dsheroh (Monsignor) on Sep 11, 2020 at 07:55 UTC | |
by tobyink (Canon) on Sep 11, 2020 at 07:00 UTC | |
by haj (Vicar) on Sep 12, 2020 at 10:26 UTC | |
| |
A reply falls below the community's threshold of quality. You may see it by logging in. | |
A reply falls below the community's threshold of quality. You may see it by logging in. |