Uri Guttman <[EMAIL PROTECTED]> writes: > this idea would need to be worked out in much greater detail. there are > many different identifiers in perl. would all of them be subject to this > change? how would a global work if some other module refered to it using > underscores but your module used hyphens? would your pragma just do a > compile time translation of - to _ when inside identifiers?
Yes, that's what it would do. (Actually, my Ruby preprocessor removes hyphens it finds in identifiers that start with an uppercase character and contain at least one lowercase character, to allow Foo-Bar as a synonym for FooBar.) > what about in eval or symrefs? would the translation be done at runtime > then? how could that be handled in a lexical way if the foo-name is > passed to another module which hadn't used the pragma? or would all > symbol lookups just tr/-/_/ beforehand? but that can't be easily > controlled in a lexical scope. That problem is not specific to this feature. For any package that changes the syntax, you can ask "what about eval?" So... what *about* eval? :-) > and i know how you feel about wanting - vs. _ but i have it the other > way around. i much prefer _ since it maked the words more readable as _ > sorta disappears in the baseline. but then i hate list too so that > influences me a trifle. :) I guess it depends on whether you see it as a separator or a joiner. You could say that hyphens join words, but underscores separate them. > but the sickest thing i have done is to remap _ to - and back inside > emacs. this was so typing -> is done with both keys shifted and i typed > that too often. also that made writing foo_bar easier. Hmm, that's an interesting hack. :-) > so my brain has to swap then when inside emacs vs everywhere else. > makes for some odd homicidal twitching sometimes (especially when anyone > else dares to type into my emacs :). Ha! Like you're ever going to go anywhere outside of Emacs... > anyhow, my main point is that IMO this has too many problems with both > syntax and unknown semantics that are sure to make some large fraction > of us very mad. perl has its style and that it _ for word separation. I agree, of course, that if this can't be done well, then it shouldn't be done at all. Well, at least then it shouldn't be put in the standard distribution. :-) > the evil studly caps is used for module names only (where it does seem > to work better than _ would. or maybe we are just so used to it by now). I've come to prefer Foo-Bar-Baz for class and module names. Having used that style for a while, I don't see any good reason to write them smashed together. > trying to change that in a scoped way will only cause pain > somewhere else. If so, then that is a symptom of a wider problem. I mean, wasn't Perl 6 supposed to make this kind of hack a breeze? -- Daniel Brockman <[EMAIL PROTECTED]>