From 451aa92846b5fd5c8a0739336de3aa26d741d750 Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Sat, 29 Mar 2025 11:10:24 +0100 Subject: Relocate MD sources for HTML notes. --- notes/strict-mode.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 notes/strict-mode.md (limited to 'notes/strict-mode.md') diff --git a/notes/strict-mode.md b/notes/strict-mode.md new file mode 100644 index 0000000..5b99386 --- /dev/null +++ b/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. -- cgit v1.2.3