New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sort() parsing error (5.005_02) #1840
Comments
From jeffp@crusoe.netCreated by jeffp@crusoe.net sub foo { return (1,20,2,30) } Perl parses this as @a = sort foo (); That is, sorting the empty list by some function. What's that status of Perl Info
|
From @tamiasOn Fri, Apr 14, 2000 at 10:47:06PM -0400, Jeff Pinyan wrote:
That is the expected behavior. =item sort SUBNAME LIST Disambiguate if that's not what you meant. sort +foo(); Ronald |
From [Unknown Contact. See original ticket]On Apr 14, Ronald J Kimball said:
Yes, I know that. But sorting the EXPLICITLY empty list with a function |
From @tamiasOn Fri, Apr 14, 2000 at 10:58:58PM -0400, Jeff Pinyan wrote:
Sorry, fixing it would be more counterintuitive: sort foo (); # sorts &foo() with default comparison function Ronald |
From [Unknown Contact. See original ticket]Jeff Pinyan <japhy@pobox.com> writes:
Perl's parser is one of Yacc family - which are LALR(1) i.e. one Why not write it as sort (foo()); ?
|
From @tamiasOn Sat, Apr 15, 2000 at 01:08:39PM +0100, Nick Ing-Simmons wrote:
Because that's still parsed as sorting the empty list with &foo as the But why is sort ((foo())); a syntax error (at least in 5.005_03 - haven't Ronald |
From [Unknown Contact. See original ticket]Nick Ing-Simmons wrote:
But you can add black magic to the lexer to handle those cases,
|
From [Unknown Contact. See original ticket]In article <38F89263.B19A297F@fdesar.net>,
Well, one thing that might be a good idea is to have perl generate a |
Migrated from rt.perl.org#3103 (status was 'resolved')
Searchable as RT3103$
The text was updated successfully, but these errors were encountered: