define* or lambda* is vry interesting ! (so, macro*, too)
;; (I like this way of writing .... )
(define yy21
(lambda* (a (b 200) (c 300))
(list a b c)))
(yy21 10) ;(10 200 300)
(yy21 10 20) ;(10 20 300)
;; there is option args or nothing,
;; it is very easy to check by if ...
(define yy22
(lambda* (a b c)
(list a b c)))
(yy22 10) ; (10 #f #f)
(yy22) ; (#f #f #f), oh not error but #f is returned !
(yy22 1 2 3) ;(1 2 3)
;; that means .....
(define yy23
(lambda* ((a 100) (b 200) (c 300))
(list a b c)))
(yy23) ; (100 200 300) !! .. as expected .....
(yy23 10) ;(10 200 300)
(yy23 #f 50) ;(#f 50 300) possible to delete 1st arg, and use only 2nd arg,
; control arg's order, too ....
;; then ...
(define yy23-2
(lambda* ((a 100) (b #f) (c #f))
(list a b c)))
(yy23-2) ; (100 #f #f) !!
(yy23-2 10) ;(10 #f #f)
(yy23-2 #f 50) ;(#f 50 #f)
(yy23-2 #f) ;(#f #f #f)
It is easy to controle the number of argument and value of each argument.
In other words, it is possible to ignore/disable each argument in the function, I reckon.
2026年7月3日金曜日 14:37:18 UTC+9 Minoru: