<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"><pre class="tw-data-text tw-text-large XcVN5d tw-ta" data-placeholder="Translation" id="tw-target-text" dir="ltr" style="-webkit-text-size-adjust: auto; font-family: inherit; font-size: 24px; line-height: 28px; border: none; padding: 10px 0.14em 10px 0px; position: relative; margin-top: -10px; margin-bottom: -10px; resize: none; overflow: hidden; width: 343px; word-wrap: break-word; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); color: rgb(32, 33, 36) !important;"><span class="Y2IQFc" lang="en">please don't send me more letters !!!</span></pre></div><div dir="ltr"><br><blockquote type="cite">On 2020-06-23, at 23:39, Tobias Pape <Das.Linux@gmx.de> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><span></span><br><blockquote type="cite"><span>On 23.06.2020, at 20:28, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> wrote:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>+1 nice!</span><br></blockquote><span></span><br><span>yeah, nice addition!</span><br><span>I'd suggest to keep #yield: around, tho. </span><br><span>I think it is kind-of tied to the Generator idea (viz. Python, JavaScript, C#)..</span><br><span></span><br><span>Best regards</span><br><span>    -Tobias</span><br><span></span><br><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Le mar. 23 juin 2020 à 20:23, Eliot Miranda <eliot.miranda@gmail.com> a écrit :</span><br></blockquote><blockquote type="cite"><span>Hi All,</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>    I juts had occasion to use generators in anger for the first time.  I was trying to fnd out why a clone of a prse tree was reporting that it was not the same tree.  Generators made enumerating all nodes in each tree together trivial:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>| them |</span><br></blockquote><blockquote type="cite"><span>them := Generator on: [:g| newTree nodesDo: [:n| g yield: n]].</span><br></blockquote><blockquote type="cite"><span>parseTree nodesDo:</span><br></blockquote><blockquote type="cite"><span>    [:n| | twin |</span><br></blockquote><blockquote type="cite"><span>    twin := them next.</span><br></blockquote><blockquote type="cite"><span>    (n isSameAs: twin) ifFalse:</span><br></blockquote><blockquote type="cite"><span>        [self halt]]</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>My message though comes from noticing that generators yield their values via next, so why not use nextPut: instead of yield: ?</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>e.g. I think this is better:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>| them |</span><br></blockquote><blockquote type="cite"><span>them := Generator on: [:g| newTree nodesDo: [:n| g nextPut: n]].</span><br></blockquote><blockquote type="cite"><span>parseTree nodesDo:</span><br></blockquote><blockquote type="cite"><span>    [:n| | twin |</span><br></blockquote><blockquote type="cite"><span>    twin := them next.</span><br></blockquote><blockquote type="cite"><span>    (n isSameAs: twin) ifFalse:</span><br></blockquote><blockquote type="cite"><span>        [self halt]]</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>_,,,^..^,,,_</span><br></blockquote><blockquote type="cite"><span>best, Eliot</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><span></span><br><span></span><br><span></span><br></div></blockquote></body></html>