------ art_9755_29744466.1212589683584 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wed, Jun 4, 2008 at 4:16 PM, Meinrad Recheis <meinrad.recheis / gmail.com> wrote: > On Wed, Jun 4, 2008 at 10:16 AM, Akinori MUSHA <knu / idaemons.org> wrote: > >> At Wed, 4 Jun 2008 03:38:48 +0900, >> David Flanagan wrote: >> > 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. >> > >> > What does the method do? What's the use-case? >> >> From rdoc: >> >> call-seq: >> e.with_memo(obj) {|(*args), memo_obj| ... } >> e.with_memo(obj) >> >> Iterates the given block for each element with an arbitrary >> object given, and returns the memo object. >> >> If no block is given, returns an enumerator. > > > I like with_memo but I'd propose to call it each_with_memo. > I could also imagine the name "each_with_state". > > -- henon > I had another idea for a name that is totally self explaining e.walk_by( walker) {|(*args), walker| ... } or traverse_with( obj) {|(*args), obj| ... } -- henon ------ art_9755_29744466.1212589683584 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wed, Jun 4, 2008 at 4:16 PM, Meinrad Recheis <<a href ailto:meinrad.recheis / gmail.com">meinrad.recheis / gmail.com</a>> wrote:<br><div class mail_quote"><blockquote class mail_quote" styleorder-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div class h2E3d">On Wed, Jun 4, 2008 at 10:16 AM, Akinori MUSHA <<a href ailto:knu / idaemons.org" target blank">knu / idaemons.org</a>> wrote:<br></div><div class mail_quote"><div class h2E3d"><blockquote class mail_quote" styleorder-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> At Wed, 4 Jun 2008 03:38:48 +0900,<br> David Flanagan wrote:<br> > Akinori MUSHA wrote:<br> > > Hi,<br> > ><br> > > Earlier today I added a new instance method named `with_memo' to<br> > > Enumerable::Enumerator, but I'm not 100% sure if the name fits the<br> > > function.<br> ><br> > What does the method do? What's the use-case?<br> <br> From rdoc:<br> <br> call-seq:<br> e.with_memo(obj) {|(*args), memo_obj| ... }<br> e.with_memo(obj)<br> <br> Iterates the given block for each element with an arbitrary<br> object given, and returns the memo object.<br> <br> If no block is given, returns an enumerator.</blockquote></div><div><br>I like with_memo but I'd propose to call it each_with_memo. <br>I could also imagine the name "each_with_state".<br> </div></div>-- henon<br> </blockquote></div><br>I had another idea for a name that is totally self explaining<br><br>e.walk_by( walker) {|(*args), walker| ... }<br><br>or<br><br>traverse_with( obj) {|(*args), obj| ... }<br><br>-- henon<br> ------ art_9755_29744466.1212589683584--