This may be a bug, or perhaps I’m missing something …
I made a variadic TO DO LIST block, which when applied looks like:
I made two implementations, one with FOR EACH, and the other: recursive.
The FOR EACH implementation stops after having done the stuff it was asked to. The recursive implementation however keeps running (idling, actually) after it has finished all of its chores.
Does anyone know why?
just drag the allbutfirstof into the arrows just like what you would normally do
Do you mean: ? - True, that version stops.
I tried yet another version: testing for ITEM 1 OF the input list instead of whether the list is empty:
, which also stops.
Now returning to the apparently defective implementation I decided to display the length of the input list before testing:
As it turns out, with 2 inputs, the length of the input list is 2 at first, then 1, and after that it remains one, no matter how often the function is called with INPUT LIST: ALL BUT FIRST OF (action).
I’ll stop here, and leave it to the Snap! Team to find out what is happening here.
i'd guess the length is 1 because you left an empty slot in the to do list block
that's still an empty slot, all you did was change the shape. click the left arrow on the variadic.
This is what I did after d4s_over_dt4 suggestion - seems to work
I think your trying to count angels on a pinhead even though you know the answer is 42
OK, I see it now.
I honestly didn’t grasp it (and still don’t, fully).
Input lists are at least somewhat complicated (or may be it’s just me )
On the other hand I’m happy it’s not really a bug.
Thanks for your help, everyone.
Couldn't you remove the run entirely and just do
EDIT: Sorry, this is redundant, I didn't see that d4s_over_dt4 had already proposed this solution. Sorry again!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.