dyna icon indicating copy to clipboard operation
dyna copied to clipboard

check that first argument of comma is a boolean

Open jeisner opened this issue 11 years ago • 2 comments

Ultimately by type checking, of course, but for now you could even do it by adding a conjunct of the form is_bool(X).

jeisner avatar Jun 07 '13 14:06 jeisner

Correction: Just a conjunct is_bool(X) isn't the right way to do it. Because the value should be $error if the first argument isn't a boolean. As with the other boolean operators on #38.

jeisner avatar Jul 08 '13 18:07 jeisner

This should print an error message as noted above.
See https://piazza.com/class/hgfxeb95g9z4vi?cid=77 for what goes wrong without an error message!

(I got caught by this myself -- gave incorrect code on the assignment, which tripped up the students because there was no error message to enlighten them that I'd made a mistake.)

jeisner avatar Jul 25 '13 02:07 jeisner