Skip to content
Permalink
blog-1
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
16 lines (15 sloc) 601 Bytes
(defun register-builtin-types ()
(add-constructors '((true . bool)
(false . bool))))
(defun register-prim-functions ()
(labels
((pred (p)
(lambda (&rest args)
(if (apply p args) 'true 'false))))
(register-prim-function '>= 2 (pred #'>=))
(register-prim-function '+ 2 #'+)
(register-prim-function '- 2 #'-)
(register-prim-function '* 2 #'*)
(register-prim-function '/ 2 #'/)
(register-prim-function 'show-int 1 (lambda (x) (format nil "~D" x)))
(register-prim-function 'string-append 2 (lambda (x y) (format nil "~A~A" x y)))))