Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

New feature: introduced special forms, which allows the user to make …

…extensions

to Modf without altering the source.

No external interface yet.
  • Loading branch information...
commit 916ce8093016bf42bdc7bef83730b5cff1954392 1 parent 99057a8
Zach Kost-Smith authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 modf.lisp
View
7 modf.lisp
@@ -300,11 +300,18 @@ functions ahead of time."
(push slot encounted-slots) ))
new-instance ))
+(defvar *special-modf-forms* (make-hash-table))
+
;; <<>>=
(defun modf-expand (new-val expr enclosed-obj-sym env)
(cond ((or (atom expr) (eql (car expr) 'modf-eval))
`(let ((,enclosed-obj-sym ,expr))
,new-val ))
+ ;; Execute special forms (this allows us to make extensions to Modf
+ ;; without altering the source
+ ((gethash (car expr) *special-modf-forms*)
+ (funcall (gethash (car expr) *special-modf-forms*)
+ new-val expr enclosed-obj-sym env ))
;; First, try rewrite rules
((gethash (car expr) *modf-rewrites*)
(modf-expand new-val (funcall (gethash (car expr) *modf-rewrites*) expr)
Please sign in to comment.
Something went wrong with that request. Please try again.