chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] TinyCLOS, builtin-classes, instantiation.


From: Felix Winkelmann
Subject: Re: [Chicken-users] TinyCLOS, builtin-classes, instantiation.
Date: Mon, 11 Oct 2004 09:59:39 +0200
User-agent: Mozilla Thunderbird 0.5 (X11/20040208)

Johannes Groedem wrote:
It's possible I've misunderstood something, but is this supposed to
work, or are the builtin classes only meant to be used for
generic method-dispatch?

;; test-case.scm:
(require-extension tinyclos)

(define-class <thread-hash> (<hash-table>)
  (mutex))

(make <thread-hash>)
;; EOF


There seems to be a default initialize-method missing.
<hash-table> does not inherit from <object>, but from
<primitive>. Try to add this snippet to tinyclos.scm:

(add-method initialize
  (make-method (list <primitive>)
    (lambda (call-next-method object initargs) object)))

(For example after the built-in classes are defined)

Why this code hangs without the default method isn't clear
to me. An error message is shown (but not completely),
when running under the debugger, so I assume since the
initialize method fails, the instance is in an inconsistent
state and printing it fails.


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]