transcendental-lisp/lisp/lang/dlambda.lisp

20 lines
583 B
Common Lisp
Raw Normal View History

2017-03-06 11:00:18 -05:00
(load "functions.lisp")
2017-03-07 13:15:40 -05:00
(define-special dlambda (&rest methods)
(cons 'lambda
(cons '(&rest arguments)
(list
2017-03-07 13:15:40 -05:00
(cons 'case
(cons '(first arguments)
2017-03-02 14:26:47 -05:00
(mapcar
(lambda (method)
2017-03-07 13:15:40 -05:00
(cons (first method)
(list
2017-03-07 13:15:40 -05:00
(cons 'apply
(cons (cons 'lambda (rest method))
2017-03-02 14:26:47 -05:00
(list
(if (equal t (car method))
2017-03-07 13:15:40 -05:00
'arguments
'(rest arguments))))))))
2017-03-06 11:00:18 -05:00
methods)))))))