work on generic extend

This commit is contained in:
Felix Brendel
2019-10-05 12:12:55 +02:00
parent 5e82f9175d
commit 9cba9cafc0
4 changed files with 57 additions and 6 deletions
+29
View File
@@ -158,6 +158,30 @@ ithe sequence as arguemens."
exports))))
(define-syntax (generic-extend args . body)
(let ((fun-name (first args))
(params (rest args))
(types ())
(names ()))
(define (process-params params)
(when params
(let ((_name (first params))
(_type (first (rest params))))
(assert (symbol? _name))
(assert (keyword? _type))
;; (print (append types _type))
(break)
(set! types (append types _type))
;; (print types)
(set! names (append names _name))
(process-params (rest (rest params))))))
(process-params params)
(print fun-name)
(print names)
(print types)
)
)
(define (null? x)
:doc "Checks if the argument is =nil=."
(= x ()))
@@ -409,3 +433,8 @@ added to a list, which in the end is returned."
;; (print-inner args)
;; ())
(generic-extend (+ v1 :vector v2 :vector)
(body))