Browse files

methods

  • Loading branch information...
1 parent 9eaf007 commit ae495d694f49891b0a9fe7d425971ebfd80cd496 @pmurias pmurias committed Feb 6, 2011
Showing with 11 additions and 4 deletions.
  1. +11 −4 cl-backend/backend.lisp
View
15 cl-backend/backend.lisp
@@ -104,10 +104,6 @@
(defun xref-to-subsymbol (xref) (main-xref (cadr xref)))
-(defun compile-method (method)
- (fare-matcher:match method
- ((and (list name normal dunno xref) (when (equal normal "normal")))
- `(defmethod ,(intern name) (invocant) (,(xref-to-subsymbol xref))))))
(defmacro define-nam-class (
i
@@ -120,8 +116,19 @@
)
`(progn
(defclass ,(main-xref i) (p6-Mu) ())
+ ,@(mapcar #'compile-method methods)
(setf ,(main-xref i) (make-instance ',(main-xref i)))))
+(defun compile-method (method)
+ (fare-matcher:match method
+ ((and (list
+ name ; Method name without ! decorator
+ kind ; Allowable kinds are "normal", "private", and "sub"
+ var ; Variable for implementing sub in param role
+ body ; Reference to implementing sub
+ ) (when (equal kind "normal")))
+ `(defmethod ,(intern name) (invocant) (,(xref-to-subsymbol body))))))
+
;(trace define-nam-class)

0 comments on commit ae495d6

Please sign in to comment.