You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some code where I have to wait for a forked process to create a file and I can't get feedback over its return status or stdout, so I use a polling pattern similar to this:
localval=nil-- kick off the external processfork_process(...)
repeatval=check_for_val(...)
untilval~=nilval:foo()
In this current form, I get a diagnostic that says I need to perform a nil check on val before calling foo, but the loop condition here should be considered the nil check.
This already works for while val == nil do...end so it would be nice to see it for repeat...until val~= nil as well.
The text was updated successfully, but these errors were encountered:
dljsjr
changed the title
repeat…until val ~= nil should satisfy the need for subsequent nil checksrepeat…until val ~= nil should satisfy the need for nil checks
Feb 19, 2024
I have some code where I have to wait for a forked process to create a file and I can't get feedback over its return status or stdout, so I use a polling pattern similar to this:
In this current form, I get a diagnostic that says I need to perform a nil check on
val
before callingfoo
, but the loop condition here should be considered the nil check.This already works for
while val == nil do...end
so it would be nice to see it forrepeat...until val~= nil
as well.The text was updated successfully, but these errors were encountered: