IRC channel logs


back to list of logs

<pallagun>No idea which people wrote the manual for guile but it's awesome.
<yngccc>is there a short way to check previous value for #f in a let*. Like (let* ((a (make-a)) (b (if (a) (make-b)) #f) (c (if (b) (make-c) #f)) ...) ...).
<mark_weaver>yngccc: use 'and'. (and (b) (make-c)) is equivalent to (if (b) (make-c) #f)
<mark_weaver>yngccc: 'and-let*' (SRFI-2) might also be useful for you. see Guile Modules > SRFI Support > SRFI-2 in the manual.
<yngccc>thats cool, I was using (when ...) then I realized it return unspecified...
<mark_weaver>btw, apologies if you already know this, but (if (a) (make-b)) will call the procedure 'a' with no arguments and see if the result of that call is 'a'. not sure if that's what you meant.
<mark_weaver>*see if the result of that call is true (anything other than #f)
<yngccc>and-let* is exactly what I need...
<yngccc>ya I know that
<mark_weaver>okay, happy hacking!
***Sgeo is now known as Mikuru
***Mikuru is now known as Sgeo
<nalaginrut>morning guilers~
<civodul>Hello Guilers!
***karswell` is now known as karswell
<mark_weaver>civodul: could you take a quick look at ? seems reasonable to me, and probably better than our previous solution (before 76a8db2). WDYT?
<mark_weaver>or maybe it's overkill for, dunno :)
<lloda>overkill would be checking uname and doing cases ;p
<mark_weaver>(sorry to bug you with this, but I feel weak in the area of the build system)
<janneke>how do i split a string like "one two" (ie multiple spaces or tabs)
<janneke>into ("one" "two")
<janneke>ie, simple whitespace split
<civodul>mark_weaver, lloda: done
<janneke>(string-split "one two" char-set:whitespace) gives many "" strings
<nalaginrut>janneke: just split it with space and try string-trim-both
<civodul>lloda: the thing had that uname check in the past
<civodul>not particularly elegant, but no big deal IMO
<janneke>nalaginrut: in python it's just 'foo bar'.split ()
<mark_weaver>this reminds me that it's time to get cracking on SRFI-115
<mark_weaver>our regexp API is horrible :-(
<nalaginrut>oh, it's not the case
<civodul>mark_weaver: the good thing is that it's as horrible as everyone else's ;-)
<civodul>but yeah, SRFI-115 would be awesome
<janneke>nalaginrut: and then filter on (negate string-empty)?
<mark_weaver>janneke: string-tokenize is slightly different than what you're asking for, but maybe still applicable.
<nalaginrut>there should be a way to trim the whitespace when calling string-split
<nalaginrut>janneke: my solution is not correct
<nalaginrut>civodul: not in this case
<mark_weaver>actually, you could make 'string-tokenize' do exactly what you want, just pass it a character set that has everything but whitespace.
<mark_weaver>(it might even be just right for you by default, dunno)
<nalaginrut>janneke: (regexp-split "[ ]+" "one two") would be great for your case
<janneke>mark_weaver: thanks
<nalaginrut>but regexp-split doesn't integrate into Guile
<janneke>nalaginrut: yup, do integrate harder! ;-)
<janneke>using string-tokenize with char-set:graphic is fine
<nalaginrut>you can copy it to your code
<janneke>nalaginrut: thanks
<nalaginrut>np ;-)
<janneke>might be handy for splitting on newline and crnl that i also need
<nalaginrut>"[ \\n]+"
<nalaginrut>hmm...and \\r
<nalaginrut>well...three years later, now I found that I can't understand the code I wrote, regexp-split...
<rlb>mark_weaver: just uploaded guile-2.0 -8 with all your recommended patches. Thanks again.
<paroneayea>rlb: oh, are you the guile debian maintainer?
<rlb>paroneayea: yep
<rlb>(and sometimes upstream contributor -- though not much in recent years)
<paroneayea>rlb: cool
<mark_weaver>rlb: sounds good, thanks!