From: Meinrad Recheis Date: 2008-06-10T20:42:22+09:00 Subject: [ruby-core:17184] Re: Enumerable::Enumerator#with_memo ------=_Part_30374_22332067.1213098153717 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue, Jun 3, 2008 at 8:28 PM, Akinori MUSHA wrote: > Hi, > > Earlier today I added a new instance method named `with_memo' to > Enumerable::Enumerator, but I'm not 100% sure if the name fits the > function. > > Some other options I could think of include: > > with: > - too general; may clash with a reserved keyword in future > > with_object: > - not bad, but too unspecific and a bit too long to use often > > with_obj: > - looks terrible when we have ObjectSpace.each_object > > with_accum: > - too specific > > > Anyone think of a better name? The method's semantic can be seen as "carrying" an object/value along while iterating over a sequence. Hence the name "carry" would also suit. To avoid any confusion about what the method returns we could discuss introducing a method "carry" which returns self and a method "carry_and_return" which returns the carry. -- henon ------=_Part_30374_22332067.1213098153717 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue, Jun 3, 2008 at 8:28 PM, Akinori MUSHA <knu@idaemons.org> wrote:
Hi,

Earlier today I added a new instance method named `with_memo' to
Enumerable::Enumerator, but I'm not 100% sure if the name fits the
function.

Some other options I could think of include:

with:
   - too general; may clash with a reserved keyword in future

with_object:
   - not bad, but too unspecific and a bit too long to use often

with_obj:
   - looks terrible when we have ObjectSpace.each_object

with_accum:
   - too specific


Anyone think of a better name?

The method's semantic can be seen as "carrying" an object/value along while iterating over a sequence. Hence the name "carry" would also suit.

To avoid any confusion about what the method returns we could discuss introducing a method "carry" which returns self and a method "carry_and_return" which returns the carry.

-- henon


------=_Part_30374_22332067.1213098153717--