What to do when both REQUIRED-ARG?, OPTIONAL-ARG? are true? Tomas Volf 22 Oct 2026 21:31 UTC

Hello,

both when writing my own implementation of SRFI-37, and every time when
using it, I stop to think about the signature for (option) procedure:

--8<---------------cut here---------------start------------->8---
procedure: (option NAMES REQUIRED-ARG? OPTIONAL-ARG? OPTION-PROC)
--8<---------------cut here---------------end--------------->8---

So I thought I would as here for an authoritative answer.  What should
code do when an option is created as:

--8<---------------cut here---------------start------------->8---
(option '(#\a "a") #t #t some-proc)
--8<---------------cut here---------------end--------------->8---

What does this combination mean?  #f #f, #t #f, #f #t are obvious, but
#t #t is not.  Since there are two arguments, there probably is *some*
meaning (otherwise it would be one argument taking #f/'no, 'required,
'optional right?), but cannot derive from the text of the SRFI what it
should be.

Thank you in advance,
Tomas Volf

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.