IRC channel logs


back to list of logs

<nalaginrut>morning guillers~
<yuqian>I want to get the GCD of a list of integer. But "(gcd (list 6 9 18 42))" is error. Who knows how to make the parentheses disappear? (I'm learning scheme :p)
<amz3`>make the parentheses disappear?
<Riviera>(gcd 6 9 18 42) is what he wants
<ft>(apply gcd (list 6 9 18 42))
<amz3`>(define (gcd* . rest) (apply gcd rest))
<yuqian>Oh, it works, thank you all.
<amz3`>or you can use
<amz3`>ooops, it's ok I said nothing :)
<yuqian>It's very useful for a green hand.
<tj__>you guys know how can i read from stdin? i'm piping some scripts together. i tried reading from current-input-port, but nothing came up... maybe i messed up somewhere...
<C-Keen>echo 123|guile -c '(display (read (current-input-port)))(newline)'
<C-Keen>works here
<C-Keen>how are you reading from current-input-port?
<tj__>yaw, C-Keen
<tj__>wait a min
<tj__>#! /usr/bin/guile
<tj__>-e main -s
<tj__>(use-modules (ice-9 rdelim))
<tj__>(define (main args)
<tj__> (let*
<tj__> ((standard_in (current-input-port))
<tj__> (first_line (read-line standard-in)))
<tj__> (display first_line)))
<tj__>that's it...
<tj__>cat a_file | ./guile_script.scm
<artyom-poptsov>tj__: Hi. It seems that you forgot to add '\\' after '/usr/bin/guile'.
<tj__>yes, yes i did
<tj__>it works now, thanks alot artyom-poptsov and C-Keen
<artyom-poptsov>tj__: You're welcome.
<C-Keen>my pleasure
<artyom-poptsov>Happy hacking ;-)
<tj__>i'm trying some functional sound synthesis, thanks : D
<dsmith-work>Morning Greetings, Guilers
<davexunit>update: guile-sdl2 0.1 release is imminent
<davexunit>I have successfully ported Sly to it
<davexunit>if anyone is interested in testing, here is the guile-sdl2 repo:
<davexunit>if you have guile 2.0.9 or greater, SDL2, SDL2_image, SDL2_mixer, and SDL2_ttf, you can easily compile it.
<davexunit>./bootstrap && ./configure && make
<davexunit>and then run the example program to verify it works
<davexunit>cd examples; ../pre-inst-env guile hello.scm
<davexunit>Guix users can just run 'guix environment -l guix.scm' to get all of the dependencies
<madsy>davexunit: Cool. Is it a low-level wrapper, or are pointers and such abstracted away?
<davexunit>madsy: there are low-level bindings, but there are also high-level wrappers on top.
<davexunit>so, it's recommened that you use the high-level stuff
<davexunit>but all of the low-level things are available should you need them.
<davexunit>in the (sdl2 bindings) namespace
<davexunit>if anyone is interested in testing a tarball for me...
<davexunit>signature for those that want it:
<davexunit>it works for me, and my Guix package built successfully, so I think it's good
<davexunit>nope, that tarball is bad!
<davexunit>this is why we test.
<rjmacready>i would test if i were at home
<rjmacready>is that cross platform, linux-only, ... ?
<davexunit>rjmacready: should work on any platform supported by Guile and SDL2
<davexunit>I'm going to rebuild the tarball and generate a new signature
<davexunit>removed the tarball and sig
<davexunit>another bug was found
<davexunit>happy to have these things discovered *before* release
<rjmacready>so if i were to look for official guile modules / libraries, where is the official place to look?
<rjmacready>or should any scheme library work? (as in, does guile implement guile-only stuff?)
<rjmacready>not sure if im making any sense
<davexunit>some scheme libraries are portable and they will work with guile
<davexunit>many are implementation-specific
<davexunit>we are trying to compile the known libraries on the Guile website:
<rjmacready>ah nice
<rjmacready>is CLOS avoided altogether, or are you aware of any usable implementation for scheme?
<davexunit>guile has a CLOS-like OOP system named GOOPS
<davexunit>comes with guile
<rjmacready>oh ince
<amz3>my guile-fuu becomes rusty, I need to pratice ;)
<davexunit>I've released guile-sdl2 0.1.0
<davexunit>sent a notice to guile-user
<civodul>davexunit: woohoo!
<civodul>SMOB quiz!
<civodul>all my recognition to whoever provides clues or fixes for that one!
<paroneayea>hello #guile friends