<void_pointer>Haven't actually done the book myself. Have looked at it in a couple places though. I learned scheme from "Teach Yourself Scheme in Fixnum Days", the Guile Manual, the R6RS standards documents, and some writing by many different people on macros <IHateIrc>I glanced over the r5rs document. I didn't read it VERY throuhly. I need to learn more about delimited continuations and some other things that didn't make sense. <zv>also, gotta spam myself here <mg_>I'm wrapping a c api (with (system foreign) stuff), and it makes sense to express it through goops I think. Is there any hook I can set up so that I free the appropriate resources when an instance is gced? Or do I have to do that manually <wingo>mg_: see the foreign object docs for 2.2, you can attach a finalizer <wingo>ACTION sent sandbox module to guile-devel; review welcome <wingo>mark_weaver: hey, your thoughts very welcome re: sandbox proposal on guile-devel <mg_>wingo: thanks. I'm on 2.0.13 currently (nixos). But I chose to make a c wrapper instead, which I saw had the finalizer argument <mg_>and on that note, is there a good way to go from a c array of stuff to a scm list? <wingo>not a great way, no -- you have to do that manually <mg_>so basically start with an empty list, loop the array and build with scm_list_2(scm_from_something(item), list) ? <wingo>build with scm_cons from the back <wingo>res = SCM_EOL; while (n--) res = scm_cons (scm_from_something (items[n]), res); <mg_>right. Couldn't find scm_cons in the docs, makes sense that that exists! <mg_>does anyone have any links to what you consider well written guile c extensions? <civodul>mg_: i think you can check things like guile-cairo, guile-rsvg, guile-ncurses, etc. <civodul>well, these are all bindings, not sure if that's what you're looking for <civodul>if you're writing bindings, i recommend using (system foreign) instead of the C API ***random-nickname is now known as random-nick
<mg_>civodul: any specific reason for that? <mg_>I'm writing a binding to a c++ lib <mg_>(but it has a c interface included, it that matters) <mg_>I tried going down that route first, but couldn't find any info on how to e.g. handle c enums <civodul>mg_: the FFI allows you to write pure Scheme code, which is generally more "fun" and more flexible <civodul>but for enums, yeah, either you use sophisticated machinery to determine the enum values <civodul>or you hardcode them as Scheme constants <civodul>which is generally okay if the C library has a reasonably stable ABI <mg_>daviid/civodul: thanks for the pointers (no pun intended). I'll take a look tonight ***Guest31748 is now known as micro`
<dsmith-work>mg_: The ffi will be even nicer when guile generates native code. Who knows, might be able to inline the calls and be more efficient than the C wrappers. <mg_>dsmith-work: that would be nice! I guess I'm more used to C style languages so that feels simpler, but the goal is to learn so (system foreign) it is <dsmith-work>mg_: Yeah, C is my native tongue, so I usually reach for it first too. <mg_>hm, how do i deal with a signature like "int some_func(enum some_enum **stuff)? <paroneayea>ACTION implementing a fun stack based language on top of guile <paroneayea>janneke: nope! it's kind of like PushGP, but it uses generic methods which "search" the stack for applicable values rather than have different stacks for each type <paroneayea>janneke: I plan to write a genetic programming environment on top of it. <paroneayea>the goal is to have a distributed anti-abuse system <paroneayea>where your anti-abuse programs make babies with the programs of people you trust <zv>did you know that the word 'guile' comes from the anglo-saxon 'wign' meanings "witchcraft" <gazon>zv: i would love to know source of that entomological info <dsmith-work>I was surprised to know that my name and "dollar" are related. <zv>"wign, wigle: divination, sorcery" <ArneBab_>zv: I didn’t know it, but that’s nice :) <zv>I've had quite a few code-gen bugs, especially in recent versions. <zv>but other than that, Guile is witchcraft as far as I'm concerned