IRC channel logs
2024-01-30.log
back to list of logs
<mwette>So is convention r7rs lib's over guile modules? <civodul>looking forward to meeting some of you in Brussels! <dthompson>civodul: thanks! say hi to christine, robin, and jessica at fosdem! <dthompson>freakingpenguin: no. macros expand to *an* expression, not multiple. <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>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 <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. <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 <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