IRC channel logs


back to list of logs

***_zxq9_ is now known as zxq9
<amz3>guile-clutter in the wild! hourra! :)
<daviid>amz3: tx!
<roelj>What exactly is "define*" / how is it different from "define"?
<cosarara>it has a star :)
<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
<taylan>koz_: ^
<taylan>see also this short blog entry about wisp by paroneayea
<koz_>taylan: OK, cool.
<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))
<taylan>oh, didn't know that
<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
<roelj>amz3: taylan: Thanks!
<amz3>lambda* at least is must be imported
<amz3>lambda* at least must be imported
<civodul>Hello Guilers!
<roelj>Hello civodul
<koz_>Hi civodul.
<artyom-poptsov1>Hello civodul (and other guilers)
<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>in a new session
<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.
<roelj>mthl: Ok, thanks.
<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
<mthl>roelj: :)
<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>Lol. Of course!
<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>or the after-next
<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?
<taylan> fictional material that takes over the world
<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.
<neiljerram>So it goes
<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>that would be great!
<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?
<davexunit>nothing on it's own
<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>ugh, how could I forget that macro?
<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.
<davexunit>roelj: is it quoted?
<roelj>Not sure.. The entire expression starts with a "`".. But that's all.
<civodul>roelj: looks like sxml no?
<davexunit>yup, it's xml
<davexunit>roelj: ` is the "quasiquote" operator
<davexunit>the stuff inside that expression is not evaluated as code
<davexunit>(unless you "unquote" it)
<davexunit>so in this case, '@' is just a symbol
<roelj>Let me guess, is unquoting done using a ","?
<roelj>Is ,@ a special operator?
<davexunit>that is "unquote splicing"
<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: contains some simple quasiquote examples, but very few...
<taylan>roelj: quasiquote is explained at the end
<roelj>taylan: Thanks
<roelj>taylan: Actually I read the entire page. Very interesting.
<roelj>taylan: Thanks a lot for writing this :)
<taylan>happy to help :)
<paroneayea>ArneBab: :)
<paroneayea>I should probably make a public repo for my async loop library
<paroneayea>not sure what to call it though
<paroneayea>my current working name is "loopy"
<paroneayea>which is somewhat inspired by
<paroneayea>davexunit: haha
<paroneayea>too long
<paroneayea>but funny
<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>amz3: daviid uses guile-clutter
<mark_weaver>I'm interested in it also, but haven't yet found the spare time