Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defmacro data-ctor [name & args]
- `(defstruct ~name
- ~@(map (comp keyword str)
- (range (count args)))))
- (defmacro type-ctor [name & ctors]
- `(do ~@(map (fn [ctor] (apply data-ctor ctor)) ctors)))
- (type-ctor node
- (n2 :r :a :r)
- (n3 :r :a :r :a :r))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement