in reply to Re: Syntax Highlighting Editors Beware
in thread Syntax Highlighting Editors Beware

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.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^3: Syntax Highlighting Editors Beware
by swampyankee (Parson) on Aug 09, 2008 at 19:22 UTC

    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

Re^3: Syntax Highlighting Editors Beware
by zentara (Cardinal) on Aug 09, 2008 at 18:08 UTC
    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.
        Then you bring up the problem of multiple nested quotes when you mix vars_with_spaces and constants
        my $with = 2; my $with spaces in them = 4; #which is more readable? print "$with spaces in them "$with spaces in them"\n"; #or print "$with spaces in them $with_spaces_in_them\n";
        You will never convince me that spaces in variable names makes things better. Microsoft's mistake number 1 was \r\n as a linefeed, mistake number 2 was spaces in variables and filenames.

        I'm not really a human, but I play one on earth Remember How Lucky You Are
Re^3: Syntax Highlighting Editors Beware
by John M. Dlugosz (Monsignor) on Aug 10, 2008 at 04:38 UTC
    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