Permalink
Browse files

skeleton for Method proto

  • Loading branch information...
1 parent cc00937 commit 22260829632538b56053230a528d7c25392bff86 @zephyrfalcon committed Mar 15, 2011
Showing with 27 additions and 0 deletions.
  1. +25 −0 builtin/umethod.scm
  2. +2 −0 interpreter.scm
View
@@ -0,0 +1,25 @@
+;; builtin/umethod.scm
+;; User-defined methods.
+
+;; Proto is called Method for practical reasons (having to write
+;; "UserDefinedMethod" all the time gets a bit old). In a more perfect
+;; world, Method would be the parent object of both BuiltinMethod and
+;; UserDefinedMethod. Maybe in Delta/C...
+
+(define-record-type delta-umethod #t #t
+ args ;; list of arguments (as Scheme strings)
+ block ;; instance of delta-block; comes with its own namespace
+ )
+
+;;; --- methods ---
+
+(define *umethod-methods* '())
+
+;;; --- Method proto ---
+
+(define dummy-umethod 'FIXME)
+
+(define make-umethod-proto
+ (make-proto-maker 'umethod *umethod-methods* :default dummy-umethod))
+
+
View
@@ -16,6 +16,7 @@
(load "builtin/list")
(load "builtin/bmethod")
(load "builtin/block")
+(load "builtin/umethod")
(define-record-type interpreter #t #t
builtin-ns ;; contains protos
@@ -42,6 +43,7 @@
(list "List" make-list-proto *list-methods*)
(list "BuiltinMethod" make-bmethod-proto *bmethod-methods*)
(list "Block" make-block-proto *block-methods*)
+ (list "Method" make-umethod-proto *umethod-methods*)
))
(define (add-protos interp)

0 comments on commit 2226082

Please sign in to comment.