Trans
4/18/2005 8:38:00 PM
Ryan Leavengood wrote:
> B. K. Oxley (binkley) wrote:
> >
> > What happens when you have both foo? and foo! -- how do you tell
them
> > apart for the require?
>
> If someone were to code like that (which they likely never would),
those
> two methods would be in the same foo.rb file.
Binkley has a fair concern b/c of the way Facets organizes it
extensions: each method is individually requirable. Of course there are
a number of exceptions when the methods are very tightly related. It
just so happens that thus far methods with names in the form of #x,
#x?, #x! and #x= are indeed very tightly related. So, with only tinge
of hesitation, I will go ahead and take the approach of just dropping
them. I may be eating my words down the road over some particular
exception, but I think it unlikely enough not to fret over.
Here are basic guidelines I've decide upon:
1. Any file named after a method ending in a punctuation mark (eg. ? !
=) will simply lack the punctuation mark. Even in the cases were there
are multiple methods of the same name (eg. #x and #x?), b/c their
functionality ought to be related enough to warrant being in the same
facet file.
2. Operators will be given a fitting name and suffixed with '-op'. For
example what was 'enumerable/**.rb' for the cross-product operator will
be called 'enumberable/cross-op.rb'.
3. Other special character names such as '[].rb' will be given common
names and likewise followed by the '-op' suffix. So for instance,
'[].rb' will become 'brackets-op.rb'.
Acceptable?
T.