This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
lincore's profile picture

[1.7.10/CC1.65] parallel.waitForAny(nil) waits forever

Started by lincore, 20 February 2015 - 09:58 AM
lincore #1
Posted 20 February 2015 - 10:58 AM
VERSION:
1.65, as shipped with FTB Direwolf20 1.7 1.0.3
DESCRIPTION:
Calling parallel.waitForAny with no arguments or explicitly with nil causes the function to never return. Also, the program can not be terminated using ctrl-t, only ctrl-r works (bad for startup+remote server).
EXPECTED RESULT:
While passing no arguments/nil to this function is clearly a bug, it is still reasonable for clients to expect an error.
REPRODUCTION STEPS:
Start the lua REPL and run parallel.waitForAny(nil, print)
Cranium #2
Posted 20 February 2015 - 04:29 PM
That's actually just poor coding. You're not supposed to pass nil to the parallel functions.
lincore #3
Posted 20 February 2015 - 07:38 PM
I am aware of that. However, I think this is an error that can be easily caught and since the function is part of the official cc api I argue that it should be. If nothing else, at least fail early and fail hard.