summaryrefslogtreecommitdiff
path: root/notes/strict-mode.md
blob: 5b9938699a0535dd9a9cc532cae7d7c1ee4bd2cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Strict mode to disallow ignoring returned values

This ties in to the last point.  In Scheme, a non-tail expression in a
body can return an arbitrary number of values, which will be silently
ignored.

This can lead to bugs, where a procedure actually returns some kind of
success or failure indicator (instead of raising an error) and the
programmer forgets to handle it.

Though it may be too inefficient to enable globally, there should at
least be a mode of compilation that emits code which checks at every
single function return whether there are any values that are being
ignored, and raises an error if so.

There would of course be a form to explicitly ignore values.