Scans a character source for a boolean value. Takes a
character stream reader getc and a stream strm. Ignoring case and
initial whitespace, the sequences "true" and "false" are converted to
the corresponding boolean values. On successful scanning of a boolean
value, scan returns SOME(b, rest), where b is the scanned value and
rest is the remaining character stream.
Scans a boolean from a string s. It returns SOME(b) for
a scanned value b; otherwise it returns NONE. Equivalent to
StringCvt.scanString scan.
Discussion
In addition to the not function presented here, the
language defines the special operators andalso and orelse, which
provide short-circuit evaluation of the AND and OR of two boolean
expressions. The semantics of strict AND and OR operators, which would
evaluate both expressions before applying the operator, are rarely
needed and can easily be obtained using the andalso and orelse
operators.