Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Switched the precendence between rewrite rules (now higher probabilit…

…y) and

normal CL macro expansions.  This is the right thing to do because often Modf
needs to do something completely different (in fact the complete opposite) of
what a Lisp form would normally do.  So, rewrite rules now also allow for a way
to prevent normal macro expansion.
  • Loading branch information...
commit 99057a8c4ead09d96fe53061c341dbc401880f29 1 parent d75d5a0
Zach Kost-Smith authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 modf.lisp
View
7 modf.lisp
@@ -305,13 +305,14 @@ functions ahead of time."
(cond ((or (atom expr) (eql (car expr) 'modf-eval))
`(let ((,enclosed-obj-sym ,expr))
,new-val ))
- ((macro-function (car expr) env)
- (modf-expand new-val (funcall (macro-function (car expr) env) expr env)
- enclosed-obj-sym env))
;; First, try rewrite rules
((gethash (car expr) *modf-rewrites*)
(modf-expand new-val (funcall (gethash (car expr) *modf-rewrites*) expr)
enclosed-obj-sym env))
+ ;; expand it if it is a macro
+ ((macro-function (car expr) env)
+ (modf-expand new-val (funcall (macro-function (car expr) env) expr env)
+ enclosed-obj-sym env))
;; Okay, we are going to call modf-expand
(t (let* ((obj-sym (gensym))
(new-val (if enclosed-obj-sym
Please sign in to comment.
Something went wrong with that request. Please try again.