For the avoidance of confusion, here is a version with non-guessed syntax:<br><br>f := [:a :ff | a ifTrue: [{a . (ff value: (a not) value: ff)}] ifFalse: a].<br>g := [:a :ff | a ifTrue: [{a . (ff value: (a not) value: ff)}] ifFalse: a].
<br>f value: true value: g.<br><br><div class="gmail_quote">On Jan 22, 2008 9:35 PM, Marcin Tustin <<a href="mailto:mm3@zepler.net">mm3@zepler.net</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
You could add an extra parameter that is another block. Use that parameter as the value of carre in the block. something like:<br><br>f := [:a :ff | a ifTrue: [ff (a not) ff] ] <br>ff: = [:a :ff | a ifTrue: [ff (a not) ff] ]
<div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">On Jan 22, 2008 9:10 PM, Hilaire Fernandes <<a href="mailto:hilaire@ofset.org" target="_blank">hilaire@ofset.org</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I got an error "Attempt to evaluate a block that is already being<br>evaluated", when I call in recursion a block like<br><br>carre := [:s1 :s2 :s3 :s4 :n |<br> n >0 ifTrue:<br> [carre valueWithArguments: {(segment value: s1 value: s2).
<br> (segment value: s2 value: s3).<br> (segment value: s3 value: s4).<br> (segment value: s1 value: s4).<br> n-1}]]<br><br>
Hilaire
<br><br>_______________________________________________<br>Beginners mailing list<br><a href="mailto:Beginners@lists.squeakfoundation.org" target="_blank">Beginners@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">
http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br></blockquote></div><br>
</div></div></blockquote></div><br>