IRC channel logs

2022-11-12.log

back to list of logs

<old>!help
<old>!help ident
<old>!who #guile
<old>Nice
<lilyp>!help
<gnucode>hey guile... is this a predicate ?
<gnucode>(lambda (x) (if (string? x) #t (throw 'bad! x)))
<gnucode>My gut tells me no. that predicates should not be able to raise exceptions...
<old>By definition I think that a predicate either return #t or #f
<old>no exception
<lilyp>gnucode: it's a predicate as long as you wrap it in false-if-exception :P
<gnucode>lilyp: hmmm.
<gnucode>it's actually kind of funny because then file-exists? is not a predicate.
<gnucode>(file-exists? #f)
<gnucode>raises an exception
<gnucode>I'll add that to me tiny hacks that I eventually need to do.
<gnucode>to my*
<gnucode>also I just sent the biug report.
<gnucode>bug*
<mwette>I think it's OK to raise an exception if input arguments are not consistent with the definition of the preditate.
<old>file-exists? expect number (file descriptor) or path or port I think
<old>So it makes sens for it to throw an exception I guess?