guile-user
[Top][All Lists]
Advanced

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

Re: Use of foreign objects to wrap anything other than an integer


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

OK, nevermind, I did not understand correctly how it worked.

Le mardi 26 mai 2020 à 00:04 +0200, divoplade a écrit :
> 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]