------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 &lt;<a hrefailto:meinrad.recheis / gmail.com">meinrad.recheis / gmail.com</a>&gt; wrote:<br><div classmail_quote"><blockquote classmail_quote" styleorder-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div classh2E3d">On Wed, Jun 4, 2008 at 10:16 AM, Akinori MUSHA &lt;<a hrefailto:knu / idaemons.org" targetblank">knu / idaemons.org</a>&gt; wrote:<br></div><div classmail_quote"><div classh2E3d"><blockquote classmail_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>
&gt; Akinori MUSHA wrote:<br>
&gt; &gt; Hi,<br>
&gt; &gt;<br>
&gt; &gt; Earlier today I added a new instance method named `with_memo&#39; to<br>
&gt; &gt; Enumerable::Enumerator, but I&#39;m not 100% sure if the name fits the<br>
&gt; &gt; function.<br>
&gt;<br>
&gt; What does the method do? &nbsp;What&#39;s the use-case?<br>
<br>
From rdoc:<br>
<br>
 &nbsp; &nbsp;call-seq:<br>
 &nbsp; &nbsp; &nbsp;e.with_memo(obj) {|(*args), memo_obj| ... }<br>
 &nbsp; &nbsp; &nbsp;e.with_memo(obj)<br>
<br>
 &nbsp; &nbsp;Iterates the given block for each element with an arbitrary<br>
 &nbsp; &nbsp;object given, and returns the memo object.<br>
<br>
 &nbsp; &nbsp;If no block is given, returns an enumerator.</blockquote></div><div><br>I like with_memo but I&#39;d propose to call it each_with_memo. <br>I could also imagine the name &quot;each_with_state&quot;.<br>&nbsp;</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--