<ft>Note that every other C developer will look at you funny, though, if you do. ;) <ft>I mean, in K&R you can also do int foo(a,b,c,d) { ... }, because the parameters will be implicitly int. I think everything that was changed from K&R to ANSI has been an improvement. ;) ***chimez1 is now known as chimez
***chimez1 is now known as chimez
***eponym is now known as epony
<manumanumanu>What exactly does goops do to macro expansion? defining a generic procedure is ruining an unrelated macro expansion... <roelj>Using the FFI, how do I create a pointer to a pointer? <roelj>manumanumanu: I think that just makes a pointer with the same address as "pointer". <manumanumanu>roelj: i usually use malloc directly for those things. 2 secs and I'll paste you my implementation (that also free's allocated memory using the GC) <roelj>manumanumanu: That's very smart. Thanks! <manumanumanu>When the allocated memory pointer becomes unavailable to the guile program, it will be freed <roelj>That's what the '(dynamic-pointer "free" (dynamic-link))' does, right? <manumanumanu>that las argument is a guard, and you can leave it out to manually manage the memory <manumanumanu>to fill the memory you have to access it as a bytevector and write whatever pointer address you have to it. <roelj>Why is size_t the return type for malloc in your definition? <manumanumanu>no, because I am passing the return-value to make-pointer and explicitly adding a guard function <roelj>So, glibc's malloc returns a pointer, which you pass to make-pointer. How does size_t affect the return value of c_malloc? <roelj>It's still the address of the memory location? <manumanumanu>Why I am asking is because I am implementing racket-styled for loops for guile, and I have been looking at cl LOOP-witchery for ideas to extend it <roelj>If I may ask, could you give me an example of a pointer to a pointer using your 'malloc' function? I think I'm lost at the return value of glibc's malloc, and how that is interpreted by make-pointer. <roelj>Right, and then how do you fill that pointer with an addres? <manumanumanu>Then I just write the pointer address to that bytevector <manumanumanu>probably using (bytevector-u64-native-set! ...) or whatever i is called <roelj>Isn't that size_t-specific then? <manumanumanu>yes. you should use different bytevector procedures depending on the size of size_t <roelj>Right, thanks! I was hoping to avoid having to know the details of the underlying platform. <roelj>Do you use (sizeof size_t) to determine wether it's 32-bit or 64-bit? <roelj>Is it correct to state that (= (sizeof size_t) 8) means 64-bit, (= (sizeof size_t) 4) means 32-bit, and (= (sizeof size_t) 2) means 16-bit? <manumanumanu>I figure all this out by pulling out almost all my hair over a weekend :D <roelj>manumanumanu: Alright, I think I got around it. <roelj>So, the function takes a pointer to a pointer to NULL, and will allocate memory itself. So I just gave it a (malloc (sizeof size_t)), and later on when I need the allocated memory by that function, I used (dereference-pointer xxxx). <roelj>This way, I don't need to know about whether something is NN-bit. <roelj>As long as 'dereference-pointer' does its job correctly. <roelj>And instead of (malloc (sizeof size_t)) I used (bytevector->pointer (make-bytevector (sizeof size_t))). <wingo>guile's jit is going to be pretty simple, but happily it will be able to inline subr and foreign calls <wingo>i think we have to compile to wasm to be webscale ;) <cmaloney>Then we can have a proper scheme in the browser ***chimez1 is now known as chimez
<daviid>mechanicalfrogs: that is a keyword <daviid>mechanicalfrogs: keyword->symbol ... then symbol->string, or use srfi-88 which has keyword->string <mechanicalfrogs>yeah - i'm not sure what's wrong because I'm using example code with latest releases of chickadee and guile-sdl2 <daviid>this has been discussed here recently <daviid>mechanicalfrogs: yes, we know :) <daviid>Chickadee probably uses srfi-88 and did not tll you ... <daviid>mechanicalfrogs: anyway, the best is to define your own keyword->string <daviid>iirc, srfi-88 has a problem, in the way that it changes the reader ... i don't have ti me to check now, try to search the log about this, r someone may shim in <amz31>ACTION got a (great of course) idea <amz31>I will rename culturia.next to asylum <amz31>I prefer much more that name, 'asylum' seems timeless whereas AI / IA thing can fade away <amz31>also, maybe more of interesting, I will drop the biwascheme dependency, I found a ((very) creative) way to avoid javascript altogether, I let you guess how... <amz31>and last but not least I am ready (at last) to use zehefyu93 because I am now sure this verioned git-like database can be useful in production <amz31>which means I need to read the 2nd edition of reasoned schemer <amz31>to add support for it in zehefyu in turn change the database backend in the main project <amz31>also, I will adopt a chatbot-like user interface and interop maybe with gnunet... dreams. <amz31>please people, let me know what design / graphics do you prefer <amz31>well it's prolly not very important