OSDN Git Service
(root)
/
happyabc
/
happyabc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
90f5a51
)
[UPDATE] Class sample
author
mzp
<mzpppp@gmail.com>
Sat, 1 Nov 2008 03:35:46 +0000
(12:35 +0900)
committer
mzp
<mzpppp@gmail.com>
Sat, 1 Nov 2008 03:35:46 +0000
(12:35 +0900)
example/class.scm
patch
|
blob
|
history
diff --git
a/example/class.scm
b/example/class.scm
index
cff377c
..
5120583
100644
(file)
--- a/
example/class.scm
+++ b/
example/class.scm
@@
-1,13
+1,18
@@
;; Example for class definition
+;;; 42
;;; 12
;;; [object Foo]
;;; 10
-(define-class Foo Object
- ([init x] (let ((t 10))
- (let ((t 12))
- (print t))))
- ([f x] (print x)))
+(define-class Foo (Object) ())
+(define-method init ((self Foo) x)
+ (print x)
+ (let ((t 10))
+ (let ((t 12))
+ (print t))))
+
+(define-method f ((self Foo) x)
+ (print x))
(define foo (new Foo 42))
(print foo)