Object&gt;&gt;recurse: aZeroInputValuable&quot;ThatReturnsATwoInputValuable&quot;<div><br></div><div>^( aZeroInputValuable value<br><div> ) value:( self )value:[ :anObject | anObject recurse: aZeroInputValuable ]<br></div><div><br></div><div>&quot;Object&gt;&gt;recurse:</div><div><br></div><div>does for recursion what &gt;&gt;do: does for iteration</div><div><br></div><div>it enables any Object O to do recursion</div><div>Without writing a new recursive method in the Class of O</div><div><br></div><div>It does this even if the </div><div>BlockClosures in this version of Smalltalk being used</div>Can only do tail recursion accurately <div></div></div><div>Like in Dolphin Smalltalk 6</div><div><br></div><div>You call it like</div><div><br></div><div>( anObject recurse:[[ :anobject :recurse | </div><div>       ( anobject someChildren collect:[ :child | </div><div>              ( something something ).</div><div>              ( ( recurse value:( child something ) ) something ) </div><div>              ]</div><div>       ) asSomeObjectSomething</div><div>]] )</div><div><br></div><div>ok</div><div>So i haven&#39;t actually tried it yet</div><div>so i do not actually know if it actually works</div><div>so it&#39;s too hot off the presses for that</div><div>because I&#39;m more into a math major than physics</div><div>i guess i always like math way better</div><div>and so i have a tendency to say      that has already been shown</div><div>but i can&#39;t see how it can fail</div><div>So i am putting it out there right now without testing it first</div><div>each recursion creates a new twoInputValuable</div><div>and the &gt;&gt;recurse: method keeps getting called</div><div>from inside of itself</div><div><br></div><div>so i think it works</div><div><br></div><div>but i guess you have to try it to find out</div><div><br></div><div>if you can figure an easier way</div><div>or why it can&#39;t work</div><div>then please show it</div><div><br></div><div>i have been trying to do this for a long time</div><div>and it shocks me that it&#39;s so small     must be something wrong in there</div><div>so if you easily find a better way</div><div>or that it&#39;s no way at all</div><div>then i missed it and I&#39;m too early</div><div>and I&#39;m semi mal informed</div><div>ie stupeid</div><div>and I&#39;m a baaad scientrist       cepting I&#39;m not one</div><div>et all</div><div>not quite easily done</div><div><br></div><div>Kjell E Godo&quot;</div><div><br></div><div><br></div><div><br></div>