IRC channel logs


back to list of logs

<rebiw>anyone using guile-sdl ?, I have an issue with geiser, the keyboard events do not seem to be detected when evaluating code. The program works fine when launched from the terminal.
<Kolev>Can't get it to build.
<apteryx>how can I write an xpath to select the elements h1 and all of their children for h1 containing text "a", "b" or "c" ?
<apteryx>I experimented with something like: (sxpath `(// h1 ,(xfilter section-of-interest?) //))
<apteryx>but that doesn't do what I expect
<apteryx>ah! my expectation was not met because I didn't look at the HTML structure carefully
<apteryx>h2 is not a child of h1... but at the same level
<Kolev>Well, I don't know how to customize my site, but at least it's in Guile now.
<apteryx>looks like I'll need some ugly loop
<apteryx>oh, maybe using the ellipsis in a sxml-match wil do
<apteryx>haven't figured it yet
<apteryx>sxml-match seems tricky to get right
<apteryx>like, this works: (sxml-match '(e 3 f 5 6 7) ((e 3 ,i ... 6 7) `(,i ...)) (,otherwise #f))
<apteryx>but this fails: sxml-match '(e 3 f 5 6 7) ((,any 3 ,i ... 6 7) `(,i ...)) (,otherwise #f))
<apteryx>seems the leading element of a pattern must not be unquoted
<RhodiumToad>apteryx: in xslt there are standard techniques for dealing with hN-delimited sections - you tag everything with the id of the most recent header of the desired level and then select based on the tags
<RhodiumToad>I've never tried to translate that concept to sxpath
<RhodiumToad>but I've used it in xslt to do things like generated table-of-contents
<roptat>Kolev, you have two keywords in a row, that can't work
<roptat>Kolev, move #:default-metadata after the lambda, or the metadata before #:make-slug
<apteryx>does srfi-71 support named let too?
<roptat>you need some srfi for that to work
<roptat>(use-modules (srfi srfi-19))
<roptat>that's from (haunt post)
<apteryx>RhodiumToad: thanks; I've used a named let loop:
<Kolev>roptat, hooray! 😀 I just needed `(haunt post)`!
<apteryx>what was the sxml aide in visiting all nodes recursively to apply transformations?
<apteryx>is there something called sxml-fold?
<fjl>One thing I always wanted to ask is why default way of use-modules in Guile is `(use-modules (srfi srfi-1))` instead of `(use-modules ((srfi srfi-1) #:select (take))` ? It looks like ideal source of confusion and frustration, vide `(haunt post)` problem above.
<apteryx>Guile produces warnings in case things clash, so in practice it's not a big problem
<fjl>But when you read code it would be nice to easily follow provenance of procedures.
<apteryx>maybe a recursive use of sxml-match (it has support for that)
<apteryx>fjl: you can; load it at the REPL
<apteryx>then ,a identifier
<apteryx>to know where it came from
<fjl>I like REPL but I also like explicit code.
<mirai_>apteryx: apply-templates?
<apteryx>fjl: if you prefer, you may be interested ot use the define-library R7RS interface to define your library
<apteryx>Guile supports it although it's not documented
<fjl>`#:select` is fine if I want to pin procs
<Kolev>Now, if only I could figure out how to apply CSS to my Haunt site.
<fjl>Cf examples on
<Kolev>fjl, yeah, I've been looking at those. I tried importing dthompson2_'s theme but it did not work.