diff options
| author | Taylan Kammer <taylan.kammer@gmail.com> | 2025-02-10 20:20:26 +0100 |
|---|---|---|
| committer | Taylan Kammer <taylan.kammer@gmail.com> | 2025-02-15 18:38:28 +0100 |
| commit | dd3d8f9d768479df36e51d402adf55afad1aff07 (patch) | |
| tree | 21b11a361ca080a2d130f33fe435b4ac284731be /html/notes/strict-mode.md | |
| parent | 831dc694c404826e9a1bf07788e10b9ac3d9cb2d (diff) | |
update
Diffstat (limited to 'html/notes/strict-mode.md')
| -rw-r--r-- | html/notes/strict-mode.md | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/html/notes/strict-mode.md b/html/notes/strict-mode.md new file mode 100644 index 0000000..5b99386 --- /dev/null +++ b/html/notes/strict-mode.md @@ -0,0 +1,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. |
