Sun Jul 13 13:10:48 UTC 2008 mantoniotti
* Some modification added. Exported symbols and reverted
Some modification added. Exported symbols and reverted
reader macro #T to construct template instances at read time.
Added MAKE-LOAD-FORM method for templates which should fix problem with
SBCL.
Committing in .
Modified Files:
substitutions.lisp templates-hierarchy.lisp
unification-package.lisp variables.lisp
hunk ./substitutions.lisp 141
+(defun v? (s env &optional (plain-symbol-p nil))
+ (find-variable-value (if plain-symbol-p
+ (make-var-name s)
+ s)
+ env))
+ [_$_]
+
+
hunk ./templates-hierarchy.lisp 222
+
hunk ./templates-hierarchy.lisp 225
-#||
+;;; 20080711 MA:
+;;; Reverted to the old version with MAKE-LOAD-FORM added. Template
+;;; objects are created at read-time.
+
hunk ./templates-hierarchy.lisp 236
-||#
hunk ./templates-hierarchy.lisp 237
+(defmethod make-load-form ((x template) &optional env)
+ (make-load-form-saving-slots x :environment env))
hunk ./templates-hierarchy.lisp 240
-;;; New version with more 'macro-like' behavior. The previous version
+
+#||
+;;; Version with more 'macro-like' behavior. The previous version
hunk ./templates-hierarchy.lisp 245
+;;;
+;;; 20080713 MA
+;;; Removed because it was not working well with nested templates.
+;;; Reverted to the original one plus MAKE-LOAD-FORM.
hunk ./templates-hierarchy.lisp 258
-
+||#
hunk ./templates-hierarchy.lisp 261
- (set-dispatch-macro-character #\# #\T #'|sharp-T-reader|))
+ (set-dispatch-macro-character #\# #\T '|sharp-T-reader|))
+
+
+#|| Useless with the read time templates and MAKE-LOAD-FORM.
+
+(defun rewrite-template-spec (spec)
+ "Rewrites a template specification.
+The rewriting simply makes sure that sub-templates are created as needed.
+The result is either the SPEC itself or an appropriate call to LIST."
+
+ (typecase spec
+ (atom `',spec)
+ (cons (destructuring-bind (head &rest tail)
+ spec
+ (case head
+ (quote spec)
+ (make-template `(make-template ,(first tail)
+ ,(rewrite-template-spec (second (second tail)))))
+ (t `(list ',head ,@(mapcar #'rewrite-template-spec tail)))
+ )))
+ (t `',spec)))
+
+||#
+ [_$_]
+
hunk ./templates-hierarchy.lisp 362
-
-;;; Implementation.
+;;;;===========================================================================
+;;;; Implementation.
hunk ./unification-package.lisp 9
+
hunk ./unification-package.lisp 14
+
hunk ./unification-package.lisp 19
+ "V?"
+
hunk ./unification-package.lisp 22
- "APPLY-SUBSTITUTION")
+ "APPLY-SUBSTITUTION"
+
+ "UNIFICATION-FAILURE"
+ "UNIFICATION-VARIABLE-UNBOUND"
+ )
+
+ (:export
+ "ENVIRONMENT"
+ "ENVIRONMENT-P")
+
hunk ./variables.lisp 5
+
+(defun make-var-name (&optional (s (gensym)) (package *package*))
+ (intern (concatenate 'string "?" (symbol-name s)) package))
+
+