Re: Ambitious Work Amirouche Amazigh BOUBEKKI 02 Nov 2026 17:23 UTC

Le 01/11/2026 à 17:19, Artyom Bologov a écrit :

>> By the way, giving an example how that works with let-keywords, and
>> let-optionals:
>>
>> https://synthcode.com/scheme/chibi/lib/chibi/optional.html
>
> Optionals are an obvious extension, but they are not portable.

They are portable, they rely on syntax-rules and rest arguments.

ref:
https://github.com/ashinn/chibi-scheme/blob/master/lib/chibi/optional.scm

My question is about whether the tail of a dotted argument list can have
heterogeneous types.

Here is an example from the documentation:

(define (make-person . o)
   (let-keywords o ((name "John Doe")
                    (age 0)
                    (occupation job: 'unemployed))
     (vector name age occupation)))

(list (make-person)
       (make-person 'name: "Methuselah" 'age: 969)
       (make-person 'name: "Dr. Who" 'job: 'time-lord 'age: 1500))

The rest argument called o contains either:

- the empty list
- (list 'name: "Methuselah" 'age: 969)
- (list 'name: "Dr. Who" 'job: 'time-lord 'age: 1500))

I am not arguing for a way to implement keyword or optional arguments.

As I read the draft, the dotted tail is one check applied to each
element, so it can’t describe o here. Is that right?