IRC channel logs

2016-08-27.log

back to list of logs

<mark_weaver>zv: sorry, I had to go afk for a bit... to be clear, I didn't write the implementation of SRFI-64 either. I submitted some minimal patches upstream to make it work better with Guile 2, which were accepted upstream, and then I imported the upstream implementation into Guile.
<mark_weaver>anyway, can you show me some example code that demonstrates the problem you're seeing?
<mark_weaver>preferably a self-contained example that I can try running on my system
<zv>the basics all work (test-equal '(1 2 3) '(1 2 3)) etc
<zv>but you can try this
<zv>git@github.com:zv/SICP-guile.git
<zv>guile sicp4.scm
<zv>will automatically run the tests
<mark_weaver>what URL do you pass to 'git clone' to get that?
<zv>git clone git@github.com:zv/SICP-guile.git
<zv>oh, uh
<zv>git clone https://github.com/zv/SICP-guile.git
<mark_weaver>thanks
<zv>you can add this to tests/evaluator.scm: (test-eq (query/eval '(job ?x (computer programmer))) '((job (Fect Cy D) (computer programmer)) (job (Hacker Alyssa P) (computer programmer))))
<zv>(just to demonstrate that no macro is causing this issue, etc.)
<mark_weaver>sicp4.scm doesn't appear to use SRFI-64, but rather defines its own 'test-equal' macro
<zv>mark_weaver, i thought you might say that
<zv> https://gist.github.com/zv/95ae2661fad370f27dd8b606aba23ed5
<zv>so here it is with raw test-equal
<zv>oh, i may have added test-equal into sicp.scm as a stopgap measure, feel free to remove that as well
<zv>feel free to remove the test-runner, etc. none of that has mattered in the past
<mark_weaver>zv: so, one thing I notice is that you've reversed the arguments to 'test-equal'. the expected value comes first, and the test expression follows.
<mark_weaver>srfi-64 will only guard against exceptions from within the test expression.
<zv>i see
<mark_weaver>but anyway, in the gist that you just pasted <https://gist.github.com/zv/95ae2661fad370f27dd8b606aba23ed5>, what goes wrong with that 'test-equal' call?
<mark_weaver>(I haven't tried running it yet; I tend to be careful what I run on my machine :)
<zv>mark_weaver: nothing goes wrong, it simply doesn't do anything at all.
<paroneayea>hm
<paroneayea>super dumb question
<zv>i just switched guile to 2.0.12 and now it says "unbound variable test-equal"
<paroneayea>what do I do in the case of trying to call pointer->procedure on something that has one of its own defined types (I'm guessing a struct) as an argument?
<paroneayea>and it's not a pointer to a struct, you pass in thte struct
<zv>mark_weaver although your point about the test v. actual expressions is a good point
<paroneayea>ok it's a struct yeah
<paroneayea>looks like I can pass in NULL for it though
<mark_weaver>paroneayea: NULL is not a struct
<mark_weaver>paroneayea: if a struct (as opposed to a pointer) is passed as an argument, you need to know the details of that struct type to make the call.
<paroneayea>mark_weaver: ok... well I'm looking at https://dpaste.de/NKCh
<paroneayea>which says "CTX maybe set to NULL", but gcry_ctx_t appears to be a struct
<paroneayea>ACTION apologizes for being ignorant about C-land
<mark_weaver>paroneayea: gcry_ctx_t is a pointer type
<paroneayea>mark_weaver: oh
<mark_weaver>"typedef struct gcry_context *gcry_ctx_t;" defines 'gcry_ctx_t' to be a pointer to struct gcry_context
<paroneayea>ahhhhh
<paroneayea>thanks mark_weaver :)
<mark_weaver>np!
<zv>ok mark, turns out im the moron here
<mark_weaver>zv: oh, did you figure out what's wrong?
<zv>you were totally right about the expected/test-expr
<mark_weaver>oh, did the test expression raise an exception?
<zv>yes, and what remained was because i had failed to realize that use-modules wouldn't override an existing method definition
<mark_weaver>ah, okay. thanks for the update!
<mark_weaver>I have to go afk. good luck!
***logicmoo is now known as dmiles
<amz3`>héllo :)
<paroneayea>hello #guile!
<paroneayea>whatcha hacking on today, *?
<OrangeShark>paroneayea: I am just working on adding more stuff to the haunt docs
<paroneayea>OrangeShark: oh nice :)
<paroneayea>good work!
<paroneayea>hm :(
<paroneayea>ACTION segfaults guile by not knowing what e's doing with the FFI
<paroneayea> http://paste.lisp.org/display/324397
<stis>evening guilers!
<paroneayea>mark_weaver: davexunit: don't suppose either of you (or someone else more knowledgable about C / the FFI) would have any idea what I'm doing wrong that's crashing guile? I have a *guess*
<paroneayea>my guess is that passing in a bytevector pointer for "const void *KEY" isn't actually working
<paroneayea>but I don't really know
<paroneayea>though maybe I should be calling gcry_kdf_derive to derive the key
<paroneayea>I figured that was just for the PKI stuff, not HMAC, but I don't really know.
<paroneayea>OH
<paroneayea>I forgot to (dereference-pointer mac) when calling pointer->mac
<paroneayea>derp.
<paroneayea>horray, whew
<paroneayea>hm
<paroneayea>:D
<paroneayea>:'D
<paroneayea>finally got libgcrypt based HMACs working
<stis>what do you think about this logic programming VCS ideas -> http://c-lambda.se/versioning.html
<stis>fast looping for the expert: http://c-lambda.se/fast-looping-in-prolog.html