[comp.lang.eiffel] Hyphen as identifier characters

sommar@enea.se (Erland Sommarskog) (02/20/90)

Norman K. Shelley (shelley@atc.sps.mot.com) writes:
>I would like to propose that the hyphen be added to the default alphabet for
>identifiers and that the hyphen take over the accepted use of the
>underscore for separating words in an identifier.
>
>Page 240 of "Eiffel: The Language" states that "internal upper-case letters ...
>as in putAtRight, contradicts the standard conventions of English ...
>and is not part of the recommended style."  I agree BUT must note that the
>underscore ('_') as a word separator is NOT English either.  A whitespace
>is the accepted standard but computers have troubles with whitespace in
>names/labels so what do we do?  Common Lisp uses hypens ('-') as a
>separator and this has more acceptance in English than an underscore.

Since hyphens are used for minus signs to, introducing them
is not trivial, particulary not in an existsing language. E.g,
      c:=a-b;
would suddenly be ambiguous. Now, I stopped writing my code like
that many years ago, but I know too many who haven't.

It's correct that the underscore is not a word separator normally,
but one could think of it as a space. Hyphens on the other hand
has a meaning of it's own. If I could chose I might call a variable
end-of-file_mark, and thus use the hyphen as in normal language.
It would be more fun if we make the compilers handle space in names,
I agree.

Finally, there are situations where case shifts definitely are better
than underscores or hyphens, to wit: when you have a limited number
of significant characters. A case shift says the same in zero
characters as an underscore does in one.



-- 
Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se