Closed jcubic closed 2 years ago
That's a good try for a portable void value, but it's not bulletproof since as you say, it's unspecified by the standard.
Here's a survey of what (if #f #f)
returns: https://doc.scheme.org/surveys/OneArmedIf/
In general, https://doc.scheme.org/surveys/ (source https://github.com/schemedoc/surveys) is a good place to find out how different implementations do things. If you discover new stuff, PRs to that repo are very helpful to the Scheme community!
Here's a new one: https://github.com/schemedoc/surveys/pull/9
@jcubic According to https://doc.scheme.org/surveys/OneArmedIf/ (if #f #f)
is not a very reliable way of getting void. Should we omit the recipe?
I'm fine.
Thanks!
I've seen this pattern in a book by Nils M Hom Sketchy Scheme. it can be written as a variable or as a macro:
This is a way to get undefined (or to be precise unspecified by R7RS spec) value in Scheme. But I'm not sure how much it's compatible with different scheme systems.
we can also add predicate:
Tested in Chicken, Guile, and Kawa (that gives warning
warning - missing else where value is required
).