Skip to content

Instantly share code, notes, and snippets.

@TheTomster
Created August 14, 2013 02:22
Show Gist options
  • Save TheTomster/6227507 to your computer and use it in GitHub Desktop.
Save TheTomster/6227507 to your computer and use it in GitHub Desktop.
(defun generate-typecode (name arg-types return-type defn)
(push (list name (types-from-arglist arg-types) return-type)
*type-registry*)
`(let ((localtypes nil))
,(loop for (type argname) in (pairs arg-types)
collect `(push (cons ,argname ,type) localtypes))
,(loop for (fname &rest args) in defn
collect (cond
((keywordp fname) (generate-type-assertion fname args))
(t 't)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment