[Newbies] block in recursion, Any cure for that kind of situation?
Marcin Tustin
mm3 at zepler.net
Tue Jan 22 21:35:18 UTC 2008
You could add an extra parameter that is another block. Use that parameter
as the value of carre in the block. something like:
f := [:a :ff | a ifTrue: [ff (a not) ff] ]
ff: = [:a :ff | a ifTrue: [ff (a not) ff] ]
On Jan 22, 2008 9:10 PM, Hilaire Fernandes <hilaire at ofset.org> wrote:
> I got an error "Attempt to evaluate a block that is already being
> evaluated", when I call in recursion a block like
>
> carre := [:s1 :s2 :s3 :s4 :n |
> n >0 ifTrue:
> [carre valueWithArguments: {(segment value: s1 value: s2).
> (segment value: s2 value: s3).
> (segment value: s3 value: s4).
> (segment value: s1 value: s4).
> n-1}]]
>
> Hilaire
>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20080122/d220004e/attachment.htm
More information about the Beginners
mailing list