guile-user
[Top][All Lists]
Advanced

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

Use of foreign objects to wrap anything other than an integer


From: divoplade
Subject: Use of foreign objects to wrap anything other than an integer
Date: Tue, 26 May 2020 00:04:18 +0200
User-agent: Evolution 3.30.5-1.1

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

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