<galex-713>Ok, I tried once again to understand sha512, once again I failed to find where is the core code implementing it <galex-713>kristofer: yeah I already did found it at this time, just couldn’t understand the code ^^" <amz3`>taylan: what do you think of dynamic-link* <amz3`>I'd like to improve and remove it from my blog we I understand your point of view ***amz31 is now known as amz3`
<cbaines>If I use module-define! should I be able to access those variables once I import the module with use-modules in the interpreter? <cbaines>I've tried this, and I can see the bindings when I run ",in (test) ,binding", but I can't get the values by evaluating the relevant symbols <cbaines>e.g. it prints this "bar #<variable 26a89d0 value: bar>", but if I just type bar, it tells me that the variable is unbound? <cbaines>The reason why I am looking at reflection, is that I am trying to create a guile module, which exports a list of bindings generated from some data. <cbaines>So, I've managed to guess one apparent solution (module-define! (resolve-interface '(test)) 'foo "foo") <cbaines>previously I was using (current-module) rather than resolve-interface <taylan>cbaines: in the REPL, you're in the (guile-user) module by default <taylan>the prompt will tell you, like "scheme@(guile-user)>" <cbaines>Ok, I didn't say above, but the code I mentioned was in a script, and I was trying to access the variables from the REPL <cbaines>Do guile modules support a . in the name (e.g. (define-module (test.foo) ...))? I tried this, and it didn't work, but its hard to tell if that is the reason? <amz3>galex-713: did I convince you that writing code is important even if it's NIH? <amz3>taylan: so why is dynamic-link* ugly? <amz3>cbaines: It doesn't work on my side <galex-713>amz3: well the problem is that what I need is new concepts more than just write code <amz3>galex-713: what concepts, for instance? <galex-713>Although to write code friends advised me Cormen but I only found it in english and I can’t get concentrated <galex-713>amz3: everything about scoping/macros/that-kind-of-complex-stuff <galex-713>I mean I would better learn reading code and doc but the doc is difficult to focus on and the code is difficult to find as long as I can’t make “source”’s geiser feature to work <amz3>learning by coding is slower to learn, but it allows to spread the learning curve over some time, it ease the pain of reading code or documentation. <amz3>galex-713: maybe that's a personnal preference <amz3>honestly people have trouble sharing, so it makes one good reason to share, even pastebins <taylan>amz3: oh hi, forgot to respond earlier. I don't think it's ugly. from what I could tell it's a small improvement over dynamic-link. but it's non-standard so I don't want my lib to rely on it... <galex-713>everything you said from “<amz3> or a wrong way to go?” <amz3>galex-713: honestly people have trouble sharing, so it makes one good reason <taylan>if others like it too they can make a bs:dynamic-link or so that works in a similar way. if a majority of people prefer it, I can add it to bytestructures <amz3>taylan: nobody commented on it yet, except you. <amz3>Actually I don't know a procedure that returns a procedure in guile stdlib except cut and cute <amz3>which are macros I think <amz3>so dynamic-link* stands out in this sens and maybe contradict the schemey way <amz3>galex-713: sorry, i've cut the sentence during c/p <amz3>galex-713: honestly people have trouble sharing, so it makes one good reason to share, even pastebins <amz3>ah ah `ftw' definition is big <amz3>ACTION will read that later... <galex-713>amz3: for example, I got habits with elisp I don’t know if I have to “find the right way” to do with scheme, or if I need to stop get used to that and change method, you see? <amz3>I stopped thinking about that, instead I code and then patch <amz3>patch the code I've written previously <galex-713>Yeah I think I got this maniac perfectionism problem… <amz3>If I always worry, about the quality of my code I'd never write anything <amz3>honestly, I feel that the bar is high in Guile but the good part is that almost any contribution can provide great value over time <amz3>compared to Python where it's crowded with already filled niches <amz3>Actually it seems the bar is high in Guile community, but it's not <galex-713>for exemple currently my head stopped understanding scoping <amz3>but for sure there is different kind of contributions, improving someone else work is goal of mine, but I don't succeed <amz3>galex-713: scoping like with `let' ? <galex-713>amz3: scoping like “if I use this undefined-at-this-point variable in this (lambda () […]) will it really refer to the variable that will be bound inside the let inside the let <amz3>the scoping is done so verbosely in scheme using let forms that you can't insert a bug in your code because of scope <galex-713>or things like “if I define an optional argument ‘<’ will it override the function ‘<’ as I want to inside the code” <amz3>it's explicit how namespaces are nested using let <galex-713>yeah but if I define a lambda referring a yet-undefined variable and this lambda is used later, will it refer the later-defined variable? <galex-713>Although in what order do “do” eval things? is it appropriate or complicating my code? <amz3>«<» => yes but only if you import the module where it's overriden <amz3>if you do in a file: (define-module (levenstein)) (define-public < (lambda (a b) (levenstein a b)) and the `(use-module (levenstein)' in another file «<» will be overriden by `levenstein' distance <galex-713>amz3: I mean I’m in a file where I’m importing nothing, and I define a function with an optional arg “<”: in the body of the function, will the standard “<” function be overriden with the optional arg if it’s specified at function call? and if it’s not, will “<” refer to the standard “<” function? <amz3>in the body of the function, «<» will be overriden but once you go outside the lambda, «<» is back to stdlib <amz3>galex-713: You can't refer to something if it's not defined yet, so I don't understand your question <amz3>are you speaking of fluids? <galex-713>amz3: and if the “<” isn’t specified, will it stay bound to stdlib inside the body? <galex-713>no I don’t know fluids yet (didn’t go that far in manual) <amz3>I don't think so, the default value of optional parameterse is #false <galex-713>I mean I do (define* (mysort array #:optional <) body) <amz3>you have to specify that «<» default value is «<» <taylan>can I add feature identifiers to cond-expand? 'provide' doesn't seem to do it <amz3>(define* (mysort array #:optional (< <)) body) <amz3>^ is the definition you meant to code <amz3>the second «<» is the default value of «<» inside the lambda <galex-713>amz3: is there a way so that (let ((var value) ((func arg) body)) body)? <amz3>what is ((func arg) body) meant to do? <amz3>you go in too other directions i think <amz3>let's solve the ((func arg) body) thing <galex-713>I’m trying to code that but it’s complicated because each elt of first let arg is either (var val) either ((fun arg ...) body) <amz3>and I don't know if you can redefine let in terms of let <galex-713>directly coding brings me many other problems :/ <amz3>galex-713: can you provide a paste with real code that runs <amz3>or at least with real procedure names <amz3>something like (let ((a 1) ((+ 2) (+ 3)) (+ 4)) <galex-713>you mean the piece of code that would run if I could redefine let that way? <amz3>they are several forms of let <galex-713>I thought if I redefined let, then let*, letrec and letrec* would be changed to support my feature because they’re probably defined after let <amz3>your use of ref is not valid I think <amz3>galex-713: I never use it <amz3>galex-713: I forgot about it <amz3>ref doesn't exist actually, is it a goops thing? <amz3>can you explain what you are trying to do? <galex-713>The idea is defining locally a function named “ref” (which doesn’t exist) with this thing instead of (let ([…] (ref (lambda (idx) (array-ref array idx)))) […]) <galex-713>So that ((ref idx) (array-ref array idx)) is a shortcut for (ref (lambda (idx) (array-ref array idx))) (much more readable isn’t it?) <galex-713>(inside the let binding variable list I mean) <galex-713>amz3: you asked me a piece of code that would work if I could redefine let/let*/etc. the way I want <galex-713>of course, that’s the piece of code *currently* working, but I was asking if it wasn’t possible to redefine let with syntax-rules so that my thing work <galex-713>amz3: you asked me to write code, but you meant standard r5rs scheme code without macros/new syntax-rules or with macros/new syntax-rules? <amz3>galex-713: you have to explain, why your syntax makes sens to write first :p <amz3>because I wrote the code using the default scheme syntax, why use another one? <galex-713>because the same way (define (fun arg ...) body) is equivalent to (define fun (lambda (arg ...) body)), but more readable/convenient, it would be more readable/convenient to write (let (((fun arg ...) body)) […]) equivalently of (let ((fun (lambda (arg ...) body))) […]), right? <galex-713>You said me not be fear NIH, well, I’m doing NIH :p <amz3>yes, it sound like something that can be done, but I don't know how <amz3>also I don't find it useful :) <galex-713>I’m tired of seeing (lambda () […]) everywhere <galex-713>Otherwise why the (define (fun arg ...) body) form would exist? <amz3>I don't nest much lambdas inside let <galex-713>I even thought we could let “let” define variables, functions, and macros together x) <galex-713>amz3: you understand why I was reading doc and speaking of macro stuff? :) <amz3>yes, it's probably a macro <amz3>I don't know which one tho <galex-713>I think I have either to know more about macros either do make nested macros (like macros inside macros), maybe with let-syntax <taylan>can I add feature identifiers to cond-expand? 'provide' doesn't seem to do it. <taylan>never mind, found cond-expand-provide (seems undocumented though) <galex-713>Anybody could help to find why it doesn’t compile? <wingo>i think that error is that guile's build on 32 bit is borken atm <wingo>i am not sure what the source of the problem is. i need to set up a 32-bit build environment. <galex-713>I’m using Thinkpad X60, would be great to have guile compile on that again ^^ <galex-713>that’s why debian testing guile package is still 2.0 <wingo>so it wouldn't go into debian yet anyway <galex-713>Except you’re doing the linux versionning things <wingo>as it offers no api or abi guarantee <galex-713>How can I know which macro is based on which macro in order to find the lowest level scheme forms? <galex-713>wingo: did you find out what the source of the problem is?