Permalink
Browse files

[cl-backend] foreign stash entries are for now filled in with dummy

symbols
  • Loading branch information...
1 parent a5f68a0 commit 1d616cd8f696ff8b3253b370f4ae088a14a8f8cc @pmurias pmurias committed Feb 16, 2011
Showing with 10 additions and 4 deletions.
  1. +6 −2 cl-backend/backend.lisp
  2. +4 −2 cl-backend/niecza-stash.lisp
View
@@ -10,7 +10,8 @@
; Macros
-(defun xref-to-symbol (xref) (intern (concatenate 'string "XREF-" (first xref) "-" (write-to-string (second xref)))))
+(defun xref-to-symbol (xref) (if (equal (first xref) "MAIN") (xref-to-symbol-real xref) (list 'quote (xref-to-symbol-real xref))))
+(defun xref-to-symbol-real (xref) (intern (concatenate 'string "XREF-" (first xref) "-" (write-to-string (second xref)))))
(load "cl-backend/niecza-stash.lisp")
@@ -158,7 +159,9 @@
nil
(list (var-name var) (make-scalar ""))))
((and (list* var stash path) (when (equal stash "stash")))
- (list (var-name var) `(get-stash ,path)))))
+ (list (var-name var) `(get-stash ,path)))
+ ((and (list* var common path) (when (equal common "common")))
+ (list (var-name var) (niecza-stash:to-stash-name path)))))
; converts a list of lexicals
@@ -257,6 +260,7 @@
(list (niecza-stash:wrap-in-let stash_root
(loop for thing in xref for i upfrom 0 when thing collect (compile-sub-or-packagoid i thing)))))))
+
(defun print-thing (thing) (format t "~A" (FETCH thing)))
(defun p6-say (&rest things) (mapcar #'print-thing things) (format t "~%"))
(defun p6-concat (&rest things) (apply 'concatenate 'string (mapcar #'FETCH things)))
@@ -10,21 +10,23 @@
((and (list name var Xref ChildNode) (when (equal var "var")))
(cons (list (append prefix (list name)) Xref) (process (cons name prefix) ChildNode)))))
+;;(trace entry)
(defun process (prefix nodes) (apply 'append (mapcar #'(lambda (x) (entry prefix x)) nodes)))
+
(defun wrap-in-let (stash body)
(let ((processed (process '() stash)))
`(let
- ,(mapcar (lambda (x) (list (to-stash-name (first x)) nil)) (hide-foreign processed))
+ ,(mapcar (lambda (x) (list (to-stash-name (first x)) nil)) processed)
,@body
,@(set-stash processed))))
(defun only-with-xrefs (stash) (remove-if (lambda (x) (not (second x))) stash))
(defun set-stash (stash)
- (mapcar (lambda (x) `(setf ,(to-stash-name (first x)) ,(niecza::xref-to-symbol (second x)))) (only-with-xrefs (hide-foreign stash))))
+ (mapcar (lambda (x) `(setf ,(to-stash-name (first x)) ,(niecza::xref-to-symbol (second x)))) (only-with-xrefs stash)))
(defun hide-foreign (stash)
(remove-if

0 comments on commit 1d616cd

Please sign in to comment.