At 11:49 AM 6/18/2002 -0700, Larry Wall wrote: >On Tue, 18 Jun 2002, Melvin Smith wrote: >: 2) In fact, there are MANY funny named macros in Perl5. > >That is precisely *why* they had to have funny names. Perl 5's >macro naming schemes were a vast improvement over Perl 4's. In >Perl 4 it was impossible to tell at a glance what kind of macro >you were looking at. > >: Don't you agree that code should document itself as much as possible? > >Sure, but there's more than one kind of self-documentation. >The self-documenting nature of Perl 5's macros is intended for people >who can see patterns, not for people who have to have it all spelled >out to them every time. After all, when Perl 5's code was originally >written, it only had to be readable by one person, which was me. :-)
However, there is a happy medium, right, and everyone has a different idea of happiness. >: #define BOop(f) return ao((yylval.ival=f, REPORT("bitorop",f) PL_expect = >: XTERM,PL_bufptr = s,(int)BITOROP)) >: #define BAop(f) return ao((yylval.ival=f, REPORT("bitandop",f) PL_expect = >: XTERM,PL_bufptr = s,(int)BITANDOP)) > >Doesn't matter how often it's used--it fit into the system. I don't see this >as a good place for Huffman coding. In particular, macros defined in My point wasn't whether it fit into the system, I wouldn't want to write the above inline (no macro), but we differ in opinion on what a good name is, maybe. I also don't prefer the long, hungarian notation I provided in my example. :( >the same file they're used are not much of a problem here. If you can't >remember what they mean, you just search for them. It's the macros that >are defined in header files that have to be very carefully named. Why the need to search for something that could be clarified with a few extra characters? >As I say, those aren't a very good example, being local macros rather >than global. It was much more important to systematize the macros in, >say, pp.h. After all these years, I still know exactly what a >dPOPTOPnnrl does, and it's not because I remember the name. So are we saying there is nothing in a name? -Melvin PS: I suppose I came off sounding like I was criticizing Perl5 code. I wasn't; since I could as easily rip up a piece of my own Parrot code. I was simply refuting the idea that the reasons people have problems with macros in Perl5 had nothing to do with funny names.