Re: Send scheme procedure as callback to foreign thread.

2022-10-13 Thread Zhu Zihao
Thanks for your help! I submit a more detailed report to https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58498. -- Retrieve my PGP public key: gpg --recv-keys B3EBC086AB0EBC0F45E0B4D433DB374BCEE4D9DC Zihao signature.asc Description: PGP signature

Send scheme procedure as callback to foreign thread.

2022-10-10 Thread Zhu Zihao
In Guile FFI programming, we have procedure->pointer, which makes a Scheme procedure a foreign callback. And foreign library call use this callback. However, if this callback is called in a another foreign thread. The scheme context is not properly setup, It may cause crash or UB. IIUC, the proce

Re: Pretty print bytevectors with its content in hex format

2022-10-04 Thread Zhu Zihao
> Right. The Guile printer has no option of that sort yet. Quickly I > would think that this should work: > > (use-modules (oop goops)) > > (define-method (display (bv ) port) > (format port "#vu8(~{#x~x~})" (bytevector->u8-list bv))) > > but I haven't tested it. Thanks for your help! I test

Pretty print bytevectors with its content in hex format

2022-09-30 Thread Zhu Zihao
Hi, dear Guile users! I'm using Guile to play around with some binaries. In Guile, the bytevector prints its content in decimal format. Just like: #vu8(255 255 255 255) But, it's always more convenient if its content is printed in hex format like #vu8(#xff #xff #xff #xff) I don't see any optio

Make the pkgconfig file of Guile relocatable.

2022-02-27 Thread Zhu Zihao
Currently, the guile-3.0.pc.in in 'meta' use the variable substitution directly. prefix=@prefix@ exec_prefix=@exec_prefix@ bindir=@bindir@ libdir=@libdir@ includedir=@includedir@ datarootdir=@datarootdir@ datadir=@datadir@ pkgdatadir=@datadir@/guile pkgincludedir=@includedir@/guile sitedir=@site

Difference between guardian and finalizer

2021-12-05 Thread Zhu Zihao
Guile now have both guardian and finalizer. Guardian API can be directly accessed from Scheme, but finalizer API only available in (system foreign-object). I see they're all based on the finalize mechanism of libgc, what's the difference between them? If I want to manage the destruction of a for