<mwette>bytestructures provides deals with substructures nicely (you can generate a scheme object that references a structure buried within a structure) <chrislck>leoprickler: thx will dig into guile sources ***catonano_ is now known as catonano
<chrislck>I found (install-r7rs!) -- not sure what it does -- then tried (load "srfi-180.scm") still no go <chrislck>^ srfi-180 requires srfi-145; copied&pasted srfi-145 still no go. ***rekado_ is now known as rekado
<leoprikler>guix environment --container --ad-hoc guile guile-srfi-145 -- guile --no-auto-compile -L . -c '(use-modules (srfi srfi-180)) (json-write #("hello" "world"))' <civodul>that's an elaborate but elegant way to say "hi" <leoprikler>Don't know about "elegant", given that we already have guile-json, but it serves to illustrate the point ;) ***Server sets mode: +nt
<civodul>also interesting is the fact that it's a "least-authority hi" given the use of --container <civodul>no harm is done to your environment by saying "hi" <leoprikler>There is also no outside influence, that could make it say anything else but "hi". <davexunit>I don't love guile-json either, so I guess I'll stick with my own implementation <rekado>the C API I’m working with has a procedure to allocate an object and another to destroy it and free its memory. Is there something I can do to detect if a C object has been freed already? <rekado>I want to prevent the users of the Guile bindings from accidentally destroying the object more than once. <rekado>though perhaps I should not expose this procedure at all and use a finalizer instead…? <civodul>rekado: yeah, don't expose it and use finalizers *rekado reads up on finalizers <civodul>Schemers don't expect to do manual memory management <rekado>yes, this is for the “low” bindings <rekado>I indent to add another layer on top of this. <davexunit>pointer objects accept a function pointer as a finalizer. <davexunit>I recently wrapped some stuff in libfreetype and used that feature in a couple places. <davexunit>you can build whatever high-level interface you want on top and guile is going to make sure that when the low-level pointer is finally ready to be GC'd that it will be cleaned up in C land. <civodul>finalizers put pressure on the GC tho, so they're quite expensive <civodul>so if your library has an option that lets you replace the allocation routines it uses, it's better to do that and avoid finalizers altogether <civodul>that's what libguile does with GMP for instance <leoprikler>hmm, is there a way to do this even without such an option? <civodul>they were removed, but i think there were discussions about reintroducing them <davexunit>reading the docs on the new exception handling stuff and uh... I have no idea how to handle exceptions anymore. <davexunit>I just want to print out a backtrace after catching any error in a form. <RhodiumToad>is the stuff in the docs under Debugging > Programmatic Error Handling > Pre-Unwind Debugging any help? <davexunit>aaaaand it blows up trying to print the backtrace :) <roptat>again, silly question... how to compare to srfi-19 date objects? <roptat>I saw time<=?, but I get TIME-ERROR type incompatible-time-types <roptat>comparing two dates, which one is older <RhodiumToad>ok, so a date object in srfi-19 is broken-down components of a timestamp, whereas a time value is on a continuous time scale? <RhodiumToad>so to use time<=? you'd need to convert using date->time-utc (or date->time-tai) <ATuin>is it possible to match nested records using '(ice-9 match)'? <ATuin>trying something like this did not work: "(($ <response> id1 #nil ($ <jsonrpc-error> id2 msg data))" <ATuin>ah, seems in need to use "(= pat)" <d4ryus>davexunit: i wrote a (very) basic display-backtrace replacement since it prints function arguments which, if they contain records with custom printers, breaks fibers yield: http://paste.debian.net/1166399/ maybe you find something usefull <leoprikler>for all intents and purposes I'm still mostly stuck on 3.0.2 <rekado>mwette: a C procedure takes a “const char* values[]”; the generated FFI code calls unwrap~array, but then fails because of “Unbound variable: unwrap~array” <rekado>I see that (system ffi-help-rt) exports unwrap~array but doesn’t define it. <rekado>the FFI helper guide indicates that this is an open issue.