Re: RFC 159 (v1) True Polymorphic Objects
[email protected] (Nathan Wiger)
| Newsgroups | perl.perl6.language.objects |
|---|---|
| Organization | Sun Microsystems |
| Message-ID | <[email protected]> |
Jonathan Scott Duff wrote: > > > Operator Overloading > > ------------------------------------------------- > > PLUS Called in + context > > MINUS Called in - context > > TIMES Called in * context > > DIVIDED Called in / context > > MODULUS Called in % context > > How about ye olde ADD, SUB, MUL, DIV, and MOD? Yeah, these are good. They're the "wrong tense", but they are all the same length, which is a plus. > I continue to think that stealing names from the programmer is a bad > thing. That's what RFC59 is all about. If we're going to use allcaps > subroutines to mean something special to perl I think we should make > it an error for the programmer to use them. Actually, I think this is a pretty good idea. At least a warning similar to what Perl 4 had for barewords: ALLCAPS sub name may conflict with future reserved word at line 3. Although it'll probably make the Perl 5 purists cringe. :-) I never define my own methods in ALLCAPS just so they're not confused with perl builtins. In fact, I generally don't define anything in ALLCAPS for this reason. I usually use a leading _ for main variables or private methods. Enforcing "style" on users (prohibiting ALLCAPS) is probably gonna be a tough sell. But I think a warning like the above would be almost a necessity, especially since it looks like we're going to have 50+ ALLCAPS methods predefined in Perl 6 at least. -Nate