-
Notifications
You must be signed in to change notification settings - Fork 2
/
fset-synthesize.lisp
30 lines (25 loc) · 1.12 KB
/
fset-synthesize.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
(in-package :edn)
(defclass fset ()
()
(:documentation "An EDN synthesizer that produces fset datastructures"))
(defmethod synthesize-compound ((implementation fset) (discriminator (eql :map)) args)
(fset:convert 'fset:map
(mapcar (fw.lu:destructuring-lambda ((p k v))
(declare (ignore p))
(cons (synthesize implementation k)
(synthesize implementation v)))
args)))
(defmethod synthesize-compound ((implementation fset) (discriminator (eql :set)) args)
(fset:convert 'fset:set
(mapcar (lambda (a)
(synthesize implementation a))
args)))
(defmethod synthesize-compound ((implementation fset) (discriminator (eql :vector)) args)
(fset:convert 'fset:seq
(mapcar (lambda (a)
(synthesize implementation a))
args)))
(defmethod synthesize-compound ((implementation fset) (discriminator (eql :list)) args)
(mapcar (lambda (a)
(synthesize implementation a))
args))