IRC channel logs

2021-07-19.log

back to list of logs

***cadmium.libera.chat sets mode: +o ChanServ
<tohoyn>this is a test. please ignore.
<tohoyn>I'll repost the following messages since they don't appear in the log:
<tohoyn>manumanumanu: w.r.t. srfi-171 I suggest you to read about functional iterators: http://xahlee.info/comp/Iterators_Signs_of_Weakness_in_Object_Oriented_Languages__Henry_G_Baker__1992.txt
<tohoyn> manumanumanu: Theme-D implements functional iterators as a module
<chrislck>I'm always confused when matching lists: (match lst ((a . b) etc)) vs (match lst ((a b ...) etc))
<flatwhatson>i'm fairly sure those are equivalent
<RhodiumToad>hm?
<flatwhatson>> (match lst ((a . b) etc)) vs (match lst ((a b ...) etc))
<RhodiumToad>(a . b) matches a proper or improper list, whereas (a b ...) matches only a proper list
<RhodiumToad>i.e. (1 . 2) will match the first but not the second
<flatwhatson>ah, right you are
<chrislck>ahh thx
<chrislck>(a . b) faster then
<RhodiumToad>if b is a long list, then presumably so, yes
<dsmith-work>Hey Hi Howdy, Guilers
<chrislck>match again: what's the deal with these "ooo" or "***"
<chrislck>ok: ooo is placeholder for ... ..1 or ___ O_o
<chrislck>ok: FAO any web resource maintainers -- can https://web.archive.org/web/20190805024202/http://ceaude.twoticketsplease.de/articles/an-introduction-to-lispy-pattern-matching.html be archived somewhere?
<chrislck>(it's now offline)
<dsmith-work>Sad how often that happens. Stuff just goes away.
<leoprikler>chrislck: those are just extra ellipses IIRC
<RhodiumToad>in the description of the match syntax, ... is part of the metasyntax whereas ooo means a literal ...
<RhodiumToad>i.e. (pat_1 ... pat_n pat_n+1 ooo) in the metasyntax means something like (foo bar baz ...)
<RhodiumToad>*** means literally *** as far as I know
<RhodiumToad>the one that took me ages to work out was not in match but rather in syntax rules, where ... ... is special
<RhodiumToad>good luck finding _that_ one in the docs
<leoprikler>wait, how does ... ... even work?
<manumanumanu>yeah, the first time you see that one it is a bit of a mindfuck
<RhodiumToad>leoprikler: in the template part of a syntax rule, (... BLAH) means the same as BLAH but without ... being treated specially
<RhodiumToad>so (... ...) puts a literal ... in the output
<leoprikler>oh, I see
<manumanumanu>now that r7rs syntax-rules has an extra ellipsis argument, the need for that has been drastically reduced
<RhodiumToad>still, there's an example in the docs which _uses_ it, without explanation
<RhodiumToad>(see syntax-parameterize)
<manumanumanu>ah yes, that is the first place I actually found it
<RhodiumToad>basically the inner syntax-rules wants to be [(return vals ...) (escape vals ...)] but since it's inside an outer syntax-rules, it uses (... ...) in place of ...
<RhodiumToad>that example probably should have been using call/ec, too
<manumanumanu>that one could be rewritten using srfi-46-styled ellipsis as well.
<RhodiumToad>indeed