|
Re: block in recursion, Any cure for that kind of situation?: msg#00103lang.smalltalk.squeak.beginners
>>>>> "Hilaire" == Hilaire Fernandes <hilaire@xxxxxxxxx> writes: Hilaire> I got an error "Attempt to evaluate a block that is already being evaluated", Hilaire> when I call in recursion a block like Hilaire> carre := [:s1 :s2 :s3 :s4 :n | Hilaire> n >0 ifTrue: Hilaire> [carre valueWithArguments: {(segment value: s1 value: s2). Hilaire> (segment value: s2 value: s3). Hilaire> (segment value: s3 value: s4). Hilaire> (segment value: s1 value: s4). Hilaire> n-1}]] This is a maintenance nightmare waiting to happen. Use a proper method call, perhaps creating a "manager" class to manage the workflow, and so you don't have to keep passing segment around. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@xxxxxxxxxxxxxx> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: block in recursion, Any cure for that kind of situation?, Marcin Tustin |
|---|---|
| Next by Date: | Re: block in recursion, Any cure for that kind of situation?, Michael Davies |
| Previous by Thread: | Re: block in recursion, Any cure for that kind of situation?, Klaus D. Witzel |
| Next by Thread: | Re: block in recursion, Any cure for that kind of situation?, Ben Goetter |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |