Re: The name of "keyword-call"
Lassi Kortela 22 Oct 2019 19:56 UTC
How about one of these:
----------------------------------------------------------------------
(define foo
(kwlambda (a b (c d e))
(list a b c d e)))
(foo 1 2) ; => (1 2 #f #f #f)
(apply foo 1 2 '()) ; => (1 2 #f #f #f)
(kwcall foo 1 2 ()) ; => (1 2 #f #f #f)
(kwcall foo 1 2 (d 4)) ; => (1 2 #f 4 #f)
(kwcall foo 1 2 (d 4 e 5)) ; => (1 2 #f 4 5)
(kwcall foo 1 2 (e 5 c 3 d 4)) ; => (1 2 3 4 5)
----------------------------------------------------------------------
(define foo
(klambda (a b (c d e))
(list a b c d e)))
(foo 1 2) ; => (1 2 #f #f #f)
(apply foo 1 2 '()) ; => (1 2 #f #f #f)
(kcall foo 1 2 ()) ; => (1 2 #f #f #f)
(kcall foo 1 2 (d 4)) ; => (1 2 #f 4 #f)
(kcall foo 1 2 (d 4 e 5)) ; => (1 2 #f 4 5)
(kcall foo 1 2 (e 5 c 3 d 4)) ; => (1 2 3 4 5)
----------------------------------------------------------------------
I intended 177 as a stopgap measure (though one that will admittedly
last for years). Ideally the language would have read syntax so you
could just type keywords into ordinary function calls and lambda lists
(as you can already do in a few Schemes).
The name "kcall" is as short as "apply". Should it be even shorter?