IRC channel logs


back to list of logs

<dthompson>guile-hoot v0.3.0 has been released :)
<mwette>So is convention r7rs lib's over guile modules?
<civodul>dthompson: yay! congrats to y’all!
<civodul>looking forward to meeting some of you in Brussels!
<dthompson>civodul: thanks! say hi to christine, robin, and jessica at fosdem!
<freakingpenguin>Is it possible to create a macro that can insert multiple replacements at the same nesting level? i.e. a macro that can pull off
<dthompson>freakingpenguin: no. macros expand to *an* expression, not multiple.
<freakingpenguin>Darn, thanks.
<Arsen>freakingpenguin: hmm, why do you need more than one expr?
<freakingpenguin>Funnily enough the question came from looking at your blog's code and trying out a different way of specifying multiple stylesheets haha.
<dthompson>I'm not sure a macro would help :)
<dthompson>in your example you're using an unquote, if you wanted to splice in multiple things you could use unquote-splicing instead
<dthompson>`(a b ,@(list 'c 'd 'e)) produces the list (a b c d e) for example
<Arsen>^ right
<freakingpenguin>Ah! That seems like that could work quite well! Split the list of stylesheets into the sxml.
<dthompson>`(head ,@(map (lambda (url) `(link (@ (rel "stylesheet) (href ,url)))) '("foo.css" "bar.css")))
<dthompson>I just looked at my blog code to refresh my memory. I only have 3 css files so I didn't see a need to use 'map' and preferred a more declarative style.
<freakingpenguin>Yeah I have something like Very arguably not worth it but I'll keep telling myself it's pretty! :)
<Arsen>qookie: did you end up also using ,@ for something?
<dthompson>freakingpenguin: do what makes you feel good! but just fyi it's not necessary for stylesheet nor stylesheets to be macros
<freakingpenguin>Haha, I was thinking that. When dealing with problems that can be solved with either macros or functions, is the rule of thumb to prefer functions?
<dthompson>macros are not applicable, for one thing. you couldn't do (map stylesheet '("foo" "bar" "baz")) with your code
<dthompson>macros are also more complicated to write.
<qookie>Arsen: w.r.t. haunt i have a function that transforms '(section name body...) into '(section (a (@ ...) (hN name)) body...) where N depends on the nesting
<Arsen>hm, must've misrecalled then
<qookie>and i use ,@ to splice in the result of mapping the transformation function over the body
<freakingpenguin>dthompson: Thanks for the wealth of knowledge!
<dthompson>yw hope it helps :) have fun with haunt