dyna
dyna copied to clipboard
check that first argument of comma is a boolean
Ultimately by type checking, of course, but for now you could even do it by adding a conjunct of the form is_bool(X).
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.
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.)