in reply to Syntax Highlighting Editors Beware

On the one hand, I'm not worried because Emacs is smart. On the other hand, this is sort of disturbing -- didn't Larry learn from the $Package'thing syntax in Perl 4?

Replies are listed 'Best First'.
Re^2: Syntax Highlighting Editors Beware
by BrowserUk (Patriarch) on Aug 09, 2008 at 16:31 UTC

    I suspect that the inclusion of ', is to allow the aping of the mathematical notational convention:

    my $x' = f( $x ); my $g'' = f( f( $g ) );

    Quite what prompts the resurrection of $this-stuff I can't work out? Wooing the Fortran lobby? The Lisp Libation? It is one shift easier to type than $this_stuff, but that's not saying much.

    Now, if we could have variable names $with spaces in them = 1, that would be revolutionary. Funny things is, on the basis of 30 seconds thought, it doesn't seem like it would present that many difficulties to implement.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      The mathematic notation bit may be sound, except for the bit about "...being followed by a letter."

      And being a member of the Cabal of Fortran Programmers, no Fortran programmer would ever consider '-' to be a reasonable character to permit in a variable name. Code like

      IF( IF .NE. NE .OR. NE .EQ. OR) THEN(IF, OR, NE)
      is bad enough; allowing code like
      IF(IF .NE. IF - NE) .OR. IF-NE .NE. NE) THEN(IF, NE, IF-NE)
      where IF - NE is an arithmetic operation and IF-NE is a variable would be insufferable.


      Information about American English usage here and here. Floating point issues? Please read this before posting. — emc

      if we could have variable names $with spaces in them = 1

      What about printing that variable in an interpolated string, and confusion with a variable named $with?

      my $with = 2; my $with spaces in them = 4; print "$with spaces in them\n";

      I know in Perl/Gtk2 there is some confusion with signal and property names with - in them, but it's resolved by automatically converting them to underscores.

      ’key-press-mask’ and ’key_press_mask’
      are interpreted as the same thing.

      I think a space should be a space, and not have any sort of hidden connector usage, what's wrong with underscores? Yeah, that reminds me of tabs and Python.....yuck.


      I'm not really a human, but I play one on earth Remember How Lucky You Are

        Ah! Now you thought about that for more than my recommended 30 seconds didn't you?

        After another 30 seconds of deep meditation I divine that the obvious thing to do is disambiguate them in usual way. Just quote them!


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
      That was my thought at first, too, except that the change doesn't allow for that, since ' is terminal rather than followed by another letter. I suggest that ' (but not -) be allowed as terminal too, for this very purpose.l