***_zxq9_ is now known as zxq9
<amz3>guile-clutter in the wild! hourra! :) <roelj>What exactly is "define*" / how is it different from "define"? <taylan>roelj: with define* you can define a procedure with optional and keyword arguments, like (define* (foo #:optional (bar default-bar-value) baz #:key qux (bat default-bat-value)) ...) here baz and qux don't have default values, so they'll default to #f. <taylan>roelj: same with lambda and lambda* <taylan>if anyone's wondering about bubu^'s question, I don't think there's much interest in SRFI-110 in Guile, but SRFI-119 has a Guile implementation in its repo <koz_>Thanks for letting me know. <amz3>roelj: taylan: it also allows to define procedures that can be curried: (define* ((add a) b) (+ a b))) instead of (define (add a) (lambda (b) (+ a b)) <amz3>you call it like that (map (add 1) (iota 5)) <amz3>I almost never use tho, because it's not properly highlighted in emacs :/ <taylan>I guess it's less nice than in properly curried languages though, since you can't just (add 3 4), you have to ((add 3) 4), right? <amz3>taylan: yes, it would be nice to have free currying I think <amz3>lambda* at least is must be imported <amz3>lambda* at least must be imported <roelj>So I loaded a module with (use-modules (module-name)).. Now when I try to call a function exported by that module using #:export (function-name), the REPL tells me the variable is unbound. <roelj>How can I verify that the module was loaded? <civodul>you could (set! %load-verbosely #t) before doing (use-modules ...) <civodul>that will show you exactly which files are loaded <roelj>Thanks, that will be very helpful <koz_>I sometimes really wish I had the ability, time and inclination to learn how to design games. <mthl>roelj: you can use ',use' in the repl to see what modules are used. <roelj>mthl: Thanks. Does it only show modules loaded directly? The module I'm loading should load several other modules as well, which I don't see in the output of ,use. <amz3>koz_: what's the problem with the following (game) development method: write code, fix it, repeat <koz_>amz3: Because it's not to do with the code part. It's to do with the design of the actual game mechanics etc. <koz_>Note I said 'design' above, not 'code'. :P <mthl>roelj: The modules "used" by the module your are using with (use-modules (foo)) are not exposed. <mthl>roelj: Maybe what is confusing you, is that "using" a module is not the same "loading" <mthl>roelj: it used to confuse me :) <roelj>mthl: It confuses me all the time. :) It's so efficient compared to what I was used to. <mthl>roelj: Since you are a C programmer maybe it will help you to think at 'use-module' like when you #include a header so that it gives you access to the public interface of the module nothing more. <roelj>mthl: I noticed it loaded stuff at the time I called a function that really needed the functions. Only then I realized "using" is not equal to "loading".. <roelj>mthl: Well, the idea that code doesn't have to be compiled and linked, before it is executed is what I still don't fully understand the consequences for. <roelj>mthl: That's a nice explanation though <roelj>mthl: Was it so obvious I am/was a C programmer? <mthl>I know you are the maintainer of InklingReader because I have review you package for Guix. ;) <roelj>Is there a JSON parser library or SRFI available for Guile? <taylan>there's guile-json on github and there's (ice-9 json) which will be in the next Guile release IIRC <taylan>AFAIK guile-json uses hash tables to represent JSON objects and relies on a macro to represent them in s-expressions. (ice-9 json) means to address these issues. <taylan>(apart from having no sexpr representation, hash tables are also very imperative in nature. they may lead to blockades in functional programming style.) <koz_>Wheredid the ice-9 name come from? <koz_>Oh nice, a Kurt Vonnergut reference. I approve. <koz_>ACTION is a growing fan of sci-fi literature. <koz_>I've just started reading all the Nebula winners in reverse chronological order. <koz_>You know what would be really nice? If Guile had a library for zippers (like, for functional tree structures). <ArneBab>paroneayea: sicp by-sa is great! Thank you for telling me! That means, everything in it can be used in GPLv3 programs… <ArneBab>koz_: srfi 119 is wisp: minimal representation of parens with indentation. srfi 110 is readable: not quite minimal representation of parens with indentation (I’m the author of wisp, so I’m biased :)) ***jan_____ is now known as jsynacek
<taylan>ACTION finds SRFI-119 much more "readable" than SRFI-110 :) <koz_>It'd be nice to have SRFI 119 in Guile. <taylan>ArneBab: maybe it could be part of the next Guile release? <ArneBab>If there’s something I can do to make that easier, I’ll gladly do it <ArneBab>(one step is already done: the releases no longer rely on Python for bootstrapping) ***mario-go` is now known as mario-goulart
<roelj>What does the "@" mean in scheme? <civodul>in Guile, (@ (some module) some-variable) means "access public variable 'some-variable' in module (some module)" <civodul>"@@" does the same, but even for private variables <davexunit>I was thinking "well, it means something when used with unquote, but not on its own" <roelj>Well, the form I'm looking at, looks like: (@ (id "packages")). So I don't think it refers to a module here. <roelj>Not sure.. The entire expression starts with a "`".. But that's all. <davexunit>the stuff inside that expression is not evaluated as code <roelj>Let me guess, is unquoting done using a ","? <roelj>Now it makes a little more sense <roelj>Do you have a link to some place where quasiquoting is explained with very simple examples? <taylan>(to be pedantic: , and ,@ aren't actually operators. ` just scans for them and acts upon them.) <taylan>roelj: quasiquote is explained at the end <roelj>taylan: Actually I read the entire page. Very interesting. <roelj>taylan: Thanks a lot for writing this :) <paroneayea>I should probably make a public repo for my async loop library <amz3>Am i the only one interested in guile-clutter? <ArneBab>amz3: I guess every system needs an early adopter… <ArneBab>For my case, I currently don’t have a GUI to write <mark_weaver>I'm interested in it also, but haven't yet found the spare time