Any idea why?
It's the usual... the former is parsed as (print()), the latter as
(print(('-'),(()))). The latter contains (()), which is obviously
not a sensible expression.
Remember that operations like "print" are parsed as functions with optional
parentheses about the argument list. So "print ()" is parsed as "print" with
an empty argument list, i.e. no arguments. "print ()" == "(print)".
Brandon S. Allbery KB8JRR, all...@NCoast.ORG (Internet), BALLBERY (MCI Mail)
ALLBERY (Delphi), uunet!cwjcc.cwru.edu!ncoast!allbery (UUCP), BrandonA (A-OL)
How 'bout, 'cuz the syntax doesn't all subscripting a null list? The
first one happens to compile because a print () is transmogrified by
the tokener into a (print), so it looks to the parser like
There are probably better ways to do that, but it would make the parser
more complex. I do, occasionally, struggle feebly against complexity... :-)