IRC channel logs


back to list of logs

<joolean>Hi Guilers! If I'm reading characters from a port and buffering them for subsequent use (e.g., parsing a double-quoted string and looking for a closing quote) is it more efficient to cons them to a list or write them to a string output port?
<ArneBab>amz3`: glad to:)
***shinra-chiron_ is now known as shinra-chiron
<mekeor>hello OrangeShark :)
<mekeor>... and all the others :)
<schemer7>hello. which project should I look at, to setup a guile-2.2/c project with autotools?
<daviid>schemer7: you have both scheme and C code (or scheme code only)?
<schemer7>both C and scheme code
<daviid>ok, here is an example (there are others out there..)
<daviid>schemer7: what is your project about?
<schemer7>daviid: it is a gui using guile-gnome, to plot sensor data over serial
<schemer7>as a side-note guile-gnome was updated to use guile-2.2 in guix and now it's broken, so i'm trying to get around that atm
<daviid>that is strange, the person who updated it did not try it on guix prior to publish the new package?
<schemer7>dunno, most dependencies were updated to use guile-2.2, except for g-wrap it seems. i'm trying to fix that atm
<daviid>schemer7: we also have guile-clutter fwiw, might be cool to look at it as well (though not integrated with guile-gnome, we do not have clutter-gtk bindings, either gtk, gdk, or clutter ...)
<schemer7>daviid: i'm using (gnome glade)
<daviid>but g-wrap works fine with 2.2 so it sounds strange that who did this did not update g-wrap as well
<daviid>schemer7: yes, but glade is for the design of the interface... for info, I wrote some examples using guile-clutter, here
<schemer7>daviid: thanks. I'll take a look into those.
<daviid>schemer7: wc! good luck
<schemer7>btw, in order to get g-wrap to build with guile-2.2, it needed indent, which is not listed on its website
<daviid>schemer7: I don't have it installed on my machine and g-wrap compiles fine
<daviid>schemer7: it is not listed in its file either, I wonder what make you think it depends on it
<schemer7>daviid: there was a warning somewhere: "sh can't find indent", and the build was failing for another reason, but having indent, it built without failure
<schemer7>daviid: well, sorry for that, indent is definitely not needed. I did two changes at once, and the other one was the one that fixed the issue
<daviid>schemer7: it's ok
<random-nick>is there access to a monotonic clock in guile?
<cmaloney>Is there a way to use lists in guile that mimic a set (as in Racket / Python)?
<cmaloney>(this is more for curiousity than actual application)
<amz3`>cmaloney: there is lset look at srfi-1
<cmaloney>That does set-like operations, but it doesn't mimic a set
<amz3`>can rephrase your quetion, because i don't understand. What does Python's set have that lset don't have
<cmaloney>eg: (lset-intersection eqv? '(1 3 4 4 4) '(4 3 2))
<cmaloney>>>> set((1,3,4,4,4))
<cmaloney>{1, 3, 4}
<cmaloney>(in Python)
<cmaloney>whereas in guile: (lset-intersection eqv? '(1 3 4 4 4) '(4 3 2)) => (3 4 4 4)
<amz3`>in your example the first list is not an lset
<cmaloney>Right, I would like to know how to make a set though
<amz3`>you have to make it an lset before computing the intersection
<cmaloney>and one would do that how? :)
<spk121>cmaloney: delete-duplicates, I guess
<cmaloney>ah, that might be an approach
<cmaloney>(reason I asked was because Racket and Clojure have a set type and wondered how to port that to Guile)
<daviid>amz3: our manual also uses duplicate values in some lset-* examples, why do you say it is not an lset?
<OrangeShark>cmaloney: your python example and guile example are not the same?
<cmaloney>Python has a built-intype called set that holds one of each value
<spk121>cmaloney: (jokingly) one could use char-set-intersection. It has the behavior you want.
<daviid>I think that these are very restricted sets :)
<spk121>(char-set->list (char-set-intersection (list->char-set '(#\\1 #\\3 #\\4 #\\4 #\\4)) (list->char-set '(#\\4 #\\3 #\\2))))
<cmaloney>set((1,1,2,2,3,3,4,4)) and set((1,2,3,4,5)) = set([1, 2, 3, 4, 5])
<spk121>ans = (#\\3 #\\4)
<cmaloney>spk121: And I could remove my eyes out with a melon-baller. Going to avoid that if possible.
<amz3``>héllo amz3, amz3` and amz3``
<amz3``>something weird happened, I was talking about hacking and then my laptop crashed..
<newb>how do I create a guile program with multiple files? -- I tried define-module and then using it, and adding -L $(pwd) option when calling guile... tho it doesn't seem to work.
<daviid>newb: look for guile scripting in the doc, then structure your code into modules that hold appropriate functionality, then write a script that use these modules and 'runs your program' ...
<newb>daviid : that's what I did -- I have a "main.scm" file with "(use-modules mymodule)(hello)" and in the same directory I have "testmodule.scm" with "(define-module testmodule ... etc)" -- but I get error: "unknown location: source expression failed to match any pattern in form (testmodule)"
<newb>Since I want all the module files in the project directory, I tried the -L option passing it $(pwd). that didn't work either...
<newb>is there an example guile repo with multiple files I could look at perhaps?
<daviid>newb: the error is a syntax error (probably) in your source code