Re: Checking for nil return

2020-12-20 Thread Brad Gilbert
Nil is always a valid return value regardless of any check. This is because it is the base of all failures. On Sat, Dec 19, 2020, 8:17 PM yary wrote: > Is this a known issue, or my misunderstanding? > > > subset non-Nil where * !=== Nil; > (non-Nil) > > sub out-check($out) returns non-Nil { ret

Re: Checking for nil return

2020-12-20 Thread yary
After writing that email, I remembered a bit of logic from a class long ago, that any assertion made on the empty set is true. Since Nil is a representation of no results, it would make sense to have assertions about it return true. I think this example shows an optimization to skip return type che

Re: Checking for nil return

2020-12-20 Thread Joseph Brenner
yary wrote: > Is this a known issue, or my misunderstanding? > >> subset non-Nil where * !=== Nil; > (non-Nil) >> sub out-check($out) returns non-Nil { return $out } > &out-check >> out-check(44) > 44 >> out-check(Nil) > Nil > > ^ Huh, I expected an exception on "out-check(Nil)" saying the return