> -----Original Message-----
> From: Smylers [mailto:smyl...@stripey.com]
> Sent: Wednesday, August 24, 2011 2:20 AM
> To: perl6-language@perl.org
> Subject: Re: Underscores v Hyphens (Was: [perl6/specs] a7cfe0: [S32]
> overhaul)
> Moritz Lenz writes:
> > Am 23.08.2011 10:46, schrieb Damian Conway:
> >
> > > ... why hidden_from_backtrace instead of hidden-from-backtrace?
> >
> > ... low-level things are spelled with underscores, while we reserve
> > the minus character for user-space code.
> So the idea is that if Perl 6 has an identifier zapeth_clunk itself that
> leaves zapeth-clunk free to be used by developers to mean something
> else?
> Is that something we want to enable?
> Code with identifiers that differ only in word separators sounds like it
> would be most confusing to maintain. Are there specific circumstances in
> which it would be useful?

This feature came about (along with Larry's generalization to include "'"s)
in response to a question I posed back around 2008 (IIRC) about the
feasibility of a P6 module to allow hyphens in identifiers. 

(BTW, I frequently mix hyphens with underscores to make space-free file
names with hyphenated dates, hyphenated words, and so on. But I wouldn't
want hyphens and underscores treated as equivalent, just as I wouldn't want
upper and lowercase letters treated as equivalent. Then again, "use strict;"
is my friend, so I don't anticipate non-trivial problems with such sorts
non-equivalences. YMMV.) 

Here is a reply of mine to an old thread on this topic; others have
independently expressed somewhat similar sentiments. 

[Sun 4/11/2010 12:45 AM]
> From: Mark J. Reed [mailto:markjr...@gmail.com]
> Perl borrows vocabulary almost exclusively from English, but it is
> not English, and its conventions are not those of English.  (And the
> conventions around hyphens that people are citing are quite specifically
> those of standard written English; other writing systems, even those using
> the same alphabet and mostly the same punctuation, have different rules).

Consider s/English/Linux/ for example. :-)

One consideration leading up to allowing "-" in P6 identifiers (initially in
the context of an optional syntax-tweaking module) involved compatibility
with fairly common usage in {directory and file} names (where spaces are
avoided for cross-platform reasons). I've always thought {Lisp variable
names and Unix/Linux file names} with hyphens (versus underscores) were
{more readable and substantially easier to type (during long typing



> I would personally like to see hyphens used as the standard word
> with underscores available for exceptions - say, naming a Perl interface
> method exactly the same as the underlying C function it provides access


Best Regards,

Conrad Schneiker

Reply via email to