<RhodiumToad>main bug is that it won't free the string if pointer->string errors <daviid>str1ngs: this, imo, is a bug in webkitgtk and/or its GI typelib def - I exposed in depth why i think it is and how to solve it, on #introspectin ... i'm still thinking on the best way to 'workaround', will ping you asap *RhodiumToad wonders if there's a better way to handle functions returning malloc'd strings in the ffi <RhodiumToad>w00t. so tests pass with GUILE_JIT_THRESHOLD=1 on freebsd/armv7 <RhodiumToad>still needs one small patch for correct off_t handling <RhodiumToad>(gen-scmconfig doesn't seem to contemplate the possibility that off_t might be bigger than a long) <str1ngs>daviid: okay, thanks for the update. ***retropikzel_ is now known as retropikzel
<leoprikler>you'd probably need to write a wrapper around it <leoprikler>SSAX in the base library, but it should be a bit simpler <leoprikler>but basically, you need to do a (define-module ...) followed by (include ...) <chrislck>still difficult. no easy examples found :( ***apteryx is now known as Guest39705
***apteryx_ is now known as apteryx
***jonsger1 is now known as jonsger
***jonsger1 is now known as jonsger
***jonsger1 is now known as jonsger
<mwette>I think you need something like (cond-expand (guile-3 (quit)) (guile-2 #t) (else (quit)) ;; the else may be optional) <mwette>sorry I though entire module, then (cond-expand (guile-2 <code>) (else #t)) <mwette>any why the eval-when? I don't think that's needed. <mwette>Maybe this, then: (cond-expand (guile-3) (guile-2 <code>) (else)) <pkill9>why does this return '("test2 "test3")? (assoc-ref '(("test" "test2" "test3")) "test") <pkill9>actually, why does this return '(("test" "test2" "test3"))?: (pretty-print '(("test" . ("test2" "test3")))) <str1ngs>pkill9: assoc-ref takes an alist. like (assoc-ref '(("test" . "foo")) "test") <str1ngs>pkill9: basically it takes a list of pairs <pkill9>i get that, but why does it turn multiple values into a list? <pkill9>if there is more than two values <pkill9>instead of erroring or something <ArneBab>pkill9: remember that (a . b) is just a shorthand for (cons a b) *ArneBab also stumbled over this a few times :-) <pkill9>why has that period been made shorthand for cons? <ArneBab>AFAIK because you can then write cons-cels as data <ArneBab>(a . b) with a and b as primitive values is a pair, but not a list. <ArneBab>(cons a <primitive-value>) gives a pair <ArneBab>AFAIK pairs consume slightly less space because they save one pointer <dsmith>pkill9: I don't know for sure, but I suspect using . for cons'es has been around about as long as there has been lisp. <mwette>(list "test" "test2" "test3") = (cons "test" . (list "test2" "test3")) <mwette>(list "test" "test2" "test3") = (cons "test" (list "test2" "test3")) <leoprikler>(list "test" "test2" "test3") = (cons "test" (list "test2" "test3")) = ("test" . ("test2" "test3") ) ***jonsger1 is now known as jonsger
<RhodiumToad>I think the only thing that really irritates me about scheme (vs lisp) is having to use () rather than nil ***daviid is now known as Guest52359
***Guest52359 is now known as daviid
<str1ngs>hello I'm trying to write this define-macro as a define-syntax but it's just not groking for me. (define-macro (call-javascript js) <str1ngs> `(run-javascript (buffer-widget buffer) ,js #f #f #f)) <str1ngs>I'm assuming this can be done with define-syntax since define-macro is not recommended anymore? <str1ngs>(define-macro (call-javascript js) `(run-javascript (buffer-widget buffer) ,js #f #f #f)) <RhodiumToad>where are buffer-widget and buffer going to come from? <str1ngs>I want (call-javascript "alert();")) to expand to (run-javascript (buffer-widget buffer) "alert();" #f #f #f)) I'm just trying to avoid alot of repeated code. <str1ngs>I guess I want to template here? is that the right term? <RhodiumToad>right but the question is, is it ok for buffer-widget and buffer to be resolved in the lexical context of the define-syntax, rather than that of the expansion? <str1ngs>I'd like to evaluate where the macro is called doe that makes. my macros skill are weak. this is actually an exercise to better understand on my part. <RhodiumToad>so the core distinction between lisp-style defmacros and scheme define-syntax is how the lexical bindings work <RhodiumToad>the intention is that in scheme, all free variables resolve in their lexical contexts <RhodiumToad>so basically you've picked a non-trivial example to use as an exercise <RhodiumToad>if I'm understanding it right, which is by no means certain, you can do it like this: <RhodiumToad>the use of datum->syntax is to construct new syntax in the lexical scope of the caller