Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix letn, ignore module definitions for now, add allow defining a new…

… method
  • Loading branch information...
commit 8e6294d2298f16f3ca2e3a82b0aba2251480aa6c 1 parent 3f20992
@pmurias pmurias authored
Showing with 36 additions and 8 deletions.
  1. +36 −8 cl-backend/backend.lisp
View
44 cl-backend/backend.lisp
@@ -53,8 +53,8 @@
scalar))
(defclass p6-Mu () ())
-(defgeneric |new| (invocant))
-(defmethod |new| (invocant) (make-instance (class-of invocant)))
+(defgeneric |new| (invocant &rest rest))
+(defmethod |new| (invocant &rest rest) (make-instance (class-of invocant)))
(defclass p6-Scalar () (value))
@@ -109,6 +109,12 @@
(defun xref-to-subsymbol (xref) (main-xref (cadr xref)))
+; HACK
+(defmacro define-nam-module (
+ i
+ name ; The object's debug name
+ exports ; List of global names to which object is bound
+))
(defmacro define-nam-class (
i
@@ -177,12 +183,34 @@
`(setf ,(intern var) ,@rvalue)
(intern var)))
-(defun to-let-vars (vars)
- (if (consp vars)
- (cons (list (intern (car vars)) (cadr vars)) (to-let-vars (cddr vars)))
- '()))
-(nam-op letn (&body vars-and-body)
- `(let ,(to-let-vars (butlast vars-and-body)) ,@(last vars-and-body)))
+
+(labels (
+ (seperate (mixed)
+ (if (stringp (first mixed))
+ (let ((result (seperate (rest (rest mixed)))))
+ (list
+ (cons (list (intern (first mixed)) (second mixed)) (first result))
+ (second result))
+ )
+ (list nil mixed)))
+
+ (to-let-vars (vars)
+ (if (consp vars)
+ (cons (list (intern (car vars)) (cadr vars)) (to-let-vars (cddr vars)))
+ '())))
+
+ (nam-op letn (&body vars-and-body)
+ (let ((seperated (seperate vars-and-body)))
+ `(let* ,(first seperated) ,@(second seperated)))))
+
+;(trace nam-letn)
+
+
+
+
+
+
+
; ???
Please sign in to comment.
Something went wrong with that request. Please try again.