in reply to Re: Perl fan being tempted with Python
in thread Perl fan being tempted with Python

I wrote a really witty rejoinder to this on a punchcard, but I can't seem to find a reader for it on any of my machines . . .

The problem is not that it uses whitespace, it's that the amount of whitespace has semantic meaning. Yes a Makefile uses whitespace, but so long as there's one initial tab it doesn't make any difference what amount of additional whitespace precedes the command. And I can't think of any shell where the amount of whitespace makes a syntactic difference.

No one's saying you can't use the amount of whitespace as a semantically significant portion of your programming language, but the fact that pretty much no one does any more might mean something.

Update: OOOOH, you caught me AM. Thanks for showing the one corner case that proves that Perl is just as guilty. I'll have to go delete the part where I said Perl was completely wartless itself.

--
We're looking for people in ATL

  • Comment on Re^2: Perl fan being tempted with Python

Replies are listed 'Best First'.
Re^3: Perl fan being tempted with Python
by Anonymous Monk on Jun 20, 2005 at 11:21 UTC
    The problem is not that it uses whitespace, it's that the amount of whitespace has semantic meaning.
    It doesn't quite change the semantic meaning, but Perl thinks the programmer uses the amount of whitespace to have different semantic meaning:
    $ perl -wcle 'print("foo")' # 0 spaces -e syntax OK $ perl -wcle 'print ("foo")' # 1 space print (...) interpreted as function at -e line 1. -e syntax OK $ perl -wcle 'print ("foo")' # 2 spaces -e syntax OK
      All three examples had the same meaning, you just got a spurious warning for the second usage.