[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Facets 0.6.3

Ryan Leavengood

4/18/2005 7:02:00 PM

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.

Ryan




2 Answers

Trans

4/18/2005 8:38:00 PM

0

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.

Ryan Leavengood

4/18/2005 8:55:00 PM

0

Trans wrote:
> 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.

Sounds good to me, especially since my ego is stoked by you using some of
my ideas, muwhahahaha (not that they were that revolutionary.)

Ryan