[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GOOPS, generics and module system
From: |
Нуёпт |
Subject: |
GOOPS, generics and module system |
Date: |
Thu, 11 Feb 2010 01:31:16 +0300 |
Please tell me what's wrong with this code:
;;; first program
(define-module (my-module)
#:use-module (oop goops)
#:use-module (module a)
#:use-module (module b)
#:duplicates merge-generics
)
(display (inside? (make <a>)))(newline)
(display (inside? (make <b>)))(newline)
;;; module a
(define-module (module a)
#:use-module (oop goops)
)
(define-class <a> () x)
(define-method (inside? (a <a>)) "class a" )
(export inside?)
(export <a>)
;;; module b
(define-module (module b)
#:use-module (oop goops)
)
(define-class <b> () x y )
(define-method (inside? (b <b>)) "class b" )
;(export inside?)
(export <b>)
Such error occurred if `(export inside?)' is uncommented:
ERROR: Unbound variable: inside?
Else:
class a
ERROR: No applicable method for #<<generic> inside? (1)> in call (inside? #<<b>
94afdc0>)
I want that first program can include modules a and b, second include
a, n and p, for example, and so on, i.e. modules a, b, c... must not know about
each other, but
can provide generic methods.
- GOOPS, generics and module system,
Нуёпт <=