IRC channel logs

2016-04-28.log

back to list of logs

<lfam>Is there a Scheme equivalent to the Bourne shell's `touch`? Some procedure to idempotently create a file (ignoring the effect of `touch` on timestamps)
<davexunit>(call-with-output-file "foo.txt" (const #t))
<davexunit>something like that, though this may overwrite the file.
<davexunit>guix has a touch procedure somewhere
<lfam>Reading the file-ports section of the manual, I'm not sure which to use
<lfam>Oh, well this is for Guix, so I can just use that
<davexunit>(close-port (open-file "foo.txt" "a0b"))
<davexunit>open the file for appending and immediately close it
<lfam>Your first suggestion is what 'touch' is defined as in gnu/build/linux-container.scm
<lfam>Your second suggestion is in gnu/build/activation.scm
<davexunit>the latter seems most correct
<davexunit>the former seems like it works only because we are creating empty files, not touching existing ones
<datagrok>I've got a newbie question about modules in guile scheme-
<datagrok>in python, we frown upon "from <module> import *" because it can clobber existing identifiers and it makes it hard to discover where some identifier was defined. But seems like that's normal in scheme. (use-modules (ice-9 popen)) ; from ice-9.popen import *
<datagrok>do schemers generally not have the same troubles that pythoners do with this?
<datagrok>i am aware that there is syntax to import only specific symbols from modules, but i don't see it used often in code samples i'm reading
<random-nick>datagrok: there's also syntax to prefix all symbols with the module name
<datagrok>do we generally just rely on our editors to discover for us which module some imported symbol is defined?
<davexunit>datagrok: no, we use the repl to tell us
***xieyuheng is now known as xyh
***xyh is now known as cctv
***cctv is now known as cctv0
<civodul>good PR from the OCaml folks... mentioning wingo :-) https://lwn.net/Articles/683851/
<wingo>oddly ;)
<janneke>wingo: working on your comments, thanks again!
<wingo>janneke: thank you! having a mingw build pipeline that "just works" would be kinda amazing
<janneke>wdyt about my guile skip-invalid (2.0/2.2) .go patch?
<wingo>ooh, i need to review that one...
<wingo>will do so probably tomorrow
<janneke>wingo: we had that for LilyPond, somewhat ... and I wondered why that never really took off...
<janneke>thanks, guix is really amazing, though
<paroneayea>hi hi
<wingo>greets paroneayea :)
<janneke>hey paroneayea
<paroneayea>:)
<paroneayea>lisp game jam starts tonight
<paroneayea>gonna work on a MUD in 8sync
<wingo>nice!
<civodul>wingo: what about writing a similar article about Guile 2.2? :-)
***cctv0 is now known as xyh
<mejja>"The tragedy of optimization writers is that performance-sensitive code that already exists in the wild is often written in a style that specifically caters to the limitations of the existing optimizer, so it will not see much improvement from new optimization passes" -- https://lwn.net/Articles/683851/
<wingo>civodul: for lwn? hehe :)
<civodul>yes!
<davexunit>paroneayea: 43 registered participants in the lisp game jam!
<davexunit>lisp ain't dead!
<mejja>it just smells funny.
<janneke>ACTION ponders...why does it seem that the world's slowly wakening-up to functional programming, lisp and scheme conveniently coïncides with my own evolution?
<civodul>davexunit: neat!
<random-nick>lisp is the future of programming for almost 60 years now!
<paroneayea>davexunit: woo woo!
<ota>like GaAs computers, always in the future!
<rain1>but yuo can get started with lisp today :)
<paroneayea>arg, what on earth is with this bug
<paroneayea>ACTION can't reproduce it outside of his 8sync code :(
<paroneayea>trying to make a simpler model of it
<rain1>what is it?
<paroneayea>yo dawg I hear you like delimited continuations so I have a prompt inside a prompt except that instad of catch working anymore, I get a SIGABRT
<paroneayea>the pre-unwind-handler works fine
<rain1>oh god
<rain1>that soundns like it could be in the compilre
<paroneayea>but as soon as it tries to catch with the handler
<paroneayea>the whole thing SIGABRTs
<paroneayea>yeah possibly... if only I knew how to hack guile's compiler. It may be a bug I come back to another day ;)
<paroneayea>if I could reproduce it with simpler code, I feel like I could narrow it down. Right now I can't.
<rain1> https://lobste.rs/s/vslgbb/oh_a_unix_shell_built_around_scheme/comments/mgh7t0#c_mgh7t0 there is a lot of interest in scsh
<amz3>héllo :)
<rootwang>Hello everybody
<random-nick>hello
<rootwang>I have a problem
<rootwang>Can you help me?
<rootwang>When I using arrow , display ^[[A
<rootwang>It is not normal
<davexunit>rootwang: I assume you are in the REPL. guile's REPL doesn't come with GNU readline support activated
<davexunit>you need to enable it yourself
<davexunit>see https://www.gnu.org/software/guile/manual/html_node/Loading-Readline-Support.html#Loading-Readline-Support
<rootwang>yeah, I'm in the REPL
<rootwang>davexunit:thanks, it is normal now
***karswell` is now known as karswell
<davexunit>rootwang: you're welcome. happy hacking.
<amz3>paroneayea: I will happily try your MUD when it comes to life, I got interested lately in the genre, looking for recommendations
<paroneayea>amz3: :)
<paroneayea>amz3: if you really want to explore a world of interesting but kind of legacy stuff
<paroneayea>check out lambdamoo
<paroneayea>community scripted / hacked world running since like 1990!
<paroneayea>amz3: if you appear on lambdamoo, send me a page
<paroneayea>like: page paroneayea "hey what's up it's amz3"
<paroneayea>ACTION learns syntax-case
<paroneayea>hey! I remember a year and a half(?) ago when syntax-rules seemed completely daunting
<paroneayea>and now it's second nature :)
<paroneayea>so presumably I can make it through syntax-case :)
<davexunit>paroneayea: syntax-case is still a bit tricky for me, but each time I use it I get mroe comfortable
<davexunit>more*
<amz3>ACTION don't know syntax-case
<amz3>define-syntax-rule ftw! ;)
<amz3>it's less powerful...
<rain1>anybody on guix just now? :)
<jmd>What's the easiest way to pad a string to a fixed length?
<rain1>Scheme Procedure: string-pad s len [chr [start [end]]]
<rain1>Scheme Procedure: string-pad-right s len [chr [start [end]]]
<rain1> https://www.gnu.org/software/guile/manual/html_node/String-Selection.html#String-Selection
<random-nick>jmd: https://www.npmjs.com/package/left-pad
<jmd`>Is there a simple example of how to use with-throw-handler ?