Hello,

How do I use the foreign object type?

When I do:

(use-modules (system foreign-object))
(use-modules (oop goops))
(define-foreign-object-type <thing> make-thing (x) #:finalizer (lambda
(x) #t))
(make-thing "hello")

I get:
ERROR: In procedure struct-set!/unboxed:
Wrong type (expecting exact integer): "hello"

I thought it might be some kind of a bug, but it is the same thing for
3.0.2, 2.2.7 and 2.2.4 (guix) and 2.2.4 (debian).  2.2 is the first to
introduce the foreign objects.

How should I do it?

divoplade


Reply via email to