Mon May 21 12:33:05 UTC 2007 mantoniotti
* See previous message.
hunk ./apply-substitution.lisp 12
-;;; apply-substitution --
-;;;
-;;; EXCLUDE-VARS are variables that will just pass through (a list for
-;;; the time being).
+(defgeneric apply-substitution (substitution item))
hunk ./apply-substitution.lisp 14
-(defgeneric apply-substitution (substitution item &optional exclude-vars))
hunk ./apply-substitution.lisp 15
-
-(defmethod apply-substitution ((s environment) (n number) &optional exclude-vars)
- (declare (ignore exclude-vars))
- n)
-
-
-(defmethod apply-substitution ((substitution environment) (s symbol)
- &optional (exclude-vars ()))
- (declare (type list exclude-vars))
+(defmethod apply-substitution ((substitution environment) (s symbol))
hunk ./apply-substitution.lisp 18
- (if (member s exclude-vars :test #'eq)
- s
- (multiple-value-bind (val foundp)
- (find-variable-value s substitution)
- (cond (foundp (apply-substitution substitution val exclude-vars))
- (t (warn "~S is a free variable in the current environment."
- s)
- s))))
- )
+ (multiple-value-bind (val foundp)
+ (find-variable-value s substitution)
+ (cond (foundp val)
+ (t (warn "~S is a free variable in the current environment." s)
+ s))))
hunk ./apply-substitution.lisp 26
-(defmethod apply-substitution ((substitution environment) (l cons)
- &optional (exclude-vars ()))
- (declare (type list exclude-vars))
- (cons (apply-substitution substitution (first l) exclude-vars)
- (apply-substitution substitution (rest l) exclude-vars)))
-
+(defmethod apply-substitution ((substitution environment) (l cons))
+ (cons (apply-substitution substitution (first l))
+ (apply-substitution substitution (rest l))))
hunk ./apply-substitution.lisp 30
-(defmethod apply-substitution ((substitution environment) (l null)
- &optional exclude-vars)
- (declare (ignore exclude-vars))
+(defmethod apply-substitution ((substitution environment) (l null))
hunk ./apply-substitution.lisp 33
+(export '(apply-substitution))
hunk ./apply-substitution.lisp 35
-;;; compose-substitions --
-;;; The definition is a direct translation of TPL's definition at page 318.
-;;; Usually these are done by directly composing and currying
-;;; functions in ML/Haskell derivatives, but that is just being "lazy".
-;;; The current definition may be too "eager", but the "correct"
-;;; semantics should be preserved.
-
-(defun compose-substitutions (env2 env1) ; note the order.
- (declare (type environment env2 env1))
-
- (loop for env1-frame in (environment-frames env1)
- collect
- (loop for (var . term) in (frame-bindings env1-frame)
- collect (make-binding var (apply-substitution env2 term))
- into result-bindings
- finally (return (make-frame result-bindings)))
- into frames
- finally (return (make-environment :frames frames))))
- [_$_]
- [_$_]
-
-
-;;; ground-term --
hunk ./match-block.lisp 13
- (substitution (make-empty-environment))[_^M_][_$_]
+ (substitution '(make-empty-environment))[_^M_][_$_]
hunk ./match-block.lisp 42
- (let* ((,env-var (unify ',template ,object ,substitution))[_^M_][_$_]
+ (let* ((,env-var (unify ,template ,object ,substitution))[_^M_][_$_]
hunk ./match-block.lisp 52
- (signal uf)[_^M_][_$_]
+ (error uf)[_^M_][_$_]
hunk ./match-block.lisp 158
-The full syntax of MATCHING is[_^M_][_$_]
+The full syntax of MATCH-CASE is[_^M_][_$_]
hunk ./match-block.lisp 166
-The values returned by the MATCHING form are those of the last form in[_^M_][_$_]
+The values returned by the MATCH-CASE form are those of the last form in[_^M_][_$_]
hunk ./match-block.lisp 191
- otherwise-clause[_^M_][_$_]
+ `(progn ,@(rest otherwise-clause))[_^M_][_$_]
hunk ./substitutions.lisp 27
+(defun (setf binding-variable) (v b)
+ (declare (type binding b))
+ (setf (car b) v))
+
+
hunk ./substitutions.lisp 37
+(defun (setf binding-value) (v b)
+ (declare (type binding b))
+ (setf (cdr b) v))
+
+
+
hunk ./unification-package.lisp 17
- "MAKE-EMPTY-ENVIRONMENT")
+ "MAKE-EMPTY-ENVIRONMENT"
+ "APPLY-SUBSTITUTION")
hunk ./unification.asd 15
- (:file "match-block")))
+ (:file "match-block")
+ (:file "apply-substitution")))