IRC channel logs

2021-06-25.log

back to list of logs

***cadmium.libera.chat sets mode: +o ChanServ
***cadmium.libera.chat sets mode: +o ChanServ
<dsmith>Ya, see the comment for SCM_MATCHES_BITS_IN_COMMON in scm.h
<rlb>sneek: later tell taylan Have you seen https://www.gnu.org/software/guile/manual/html_node/Nil.html
*rlb never remembers how that works...
<rlb>leoprikler: if I'm not around when taylan is, might also be plausible to mention my original motivation to fix the change in 3.0.7, i.e.
<rlb> https://git.sr.ht/~rlb/lokke/tree/main/item/mod/lokke/base/util.scm#L61 which is used in methods like this: https://git.sr.ht/~rlb/lokke/tree/main/item/mod/lokke/base/collection.scm#L712
<rlb>
*rlb looks at that again to make sure he's not just doing it wrong...
<rlb>I'm actually not sure I understand why that fails, and/or how it'd OK for it to fail, if the problem is the handling of that (eq? #nil arg).
<rlb>s/it'd/it'd be/
<dsmith>Anyone know how to kill a tcp client program in such a way that it doesn't shudown the socket cleanlly? Want to simulate pulling an ethernet cable out or powering off a switch. (Testing keepalives)
<dsmith>Sorry not Scheme related...
<flatwhatson>dsmith: maybe add an iptables rule to drop packets on that port?
<dsmith>Yeah, that might do it. But iptables. (Ugh)
<dsmith>flatwhatson: Using iptables worked great! Thanks.
<flatwhatson>no worries :)
<emanuele6>part
<daviid>dsmith: sneek is sleeping?
<dsmith>sneek: botsnack
<dsmith>:(
<dsmith>sneek: botsnack
<sneek>:)
<dsmith>daviid: thanks
<daviid>welcome!
<tohoyn>Happy Midsummer Eve
<leoprikler>rlb tbh i don't understand what this code is trying to achieve
<rlb>leoprikler: the require-nil syntax? It's just used elsewhere in calls like (define-method (foo (x <boolean>)) (require-nil ...) ...) to make sure that foo reports an error if x is not #nil, i.e. foo should not work for #t or #f.
<leoprikler>I… don't understand the rationale behind doing such a thing
<leoprikler>is this for stuff that really wants x to be a list, but must also accept x being #nil?
<rlb>leoprikler: if I understand what you're asking, nil in clj is somewhat like it is in elisp, but even broader, i.e. in many places it acts like an empty collection.
<rlb>i.e. empty vector/set/list/map etc.
<rlb>so (empty? nil) is true, but (empty false) should be an error.
<leoprikler>ah, i misspoke, of course #nil ought to be the empty collection or false in Clojure semantics
<rlb>guile's current policy wrt nil worked well wrt a clj dialect.
<leoprikler>I'm just worrying whether you can really apply goops here
<leoprikler>is there a way of providing your own checker for is-a?
<rlb>Hmm, what's the problem you're thinking of?
<rlb>(So far, using goops seems to have worked fairly well.)
<leoprikler>imho (is-a? #nil <null>) should return #t
<leoprikler>so that in the code above you could (define-method (blah (x <null>)) ...)
<rlb>iirc null is intentionally only EOL, but I may be remembering wrong.
<leoprikler>I don't know how GOOPS works tbph
<rlb>And i do use <pair> and <null> in other places.
<leoprikler>but it feels weird that <null> and null? work differently
<leoprikler>(same with <list> and list?)
<rlb>In any case, perhaps you saw it, but this was the only real problem I was having atm, i.e. the fact that 3.0.7 broke this: https://paste.debian.net/hidden/18ce7c3c
<rlb>I haven't seen any issues with the goops-related bits yet.
<rlb>Oh, and I don't think it matters what the argument to foo is, i.e. iirc (foo 'x) would also crash.
<leoprikler>ahh, i think that may be related to emacs lisp where (defun frob nil ...) is valid syntax
<leoprikler>hum, that's weird, but I'll try in a repl
<rlb>I found the commit - that's what I was asking about earlier, but I need to delve a bit more on my own first..
<rlb>0cc799185576712d69f11fc794454f2f5447bef7
<rlb>Didn't try the repl, but loading that file via "guile foo.scm" is how I was able to reproduce it.
<leoprikler>I think ice-9 match has a similar issue where (match #nil clauses) throws
<rlb>Right, I think the suggestion was that it may have been related to recent syntax/reader/or-similar changes.
*rlb has to wander off soon.
<leoprikler>rlb: (define foo (match-lambda (#nil #t) (_ #f)))
<leoprikler>matches #nil or '()
<leoprikler>I don't know whether match is acceptable in your context
<leoprikler>and of course if you drop the _ part, you get a match error :P
<kitzman>yay so I wrote my first scheme utility. https://git.disroot.org/kitzman/lieferhund . i guess adding it to guix will be better when it will have more features
<kitzman>(constructive) criticism is needed
<leoprikler>lieferhuendchen should be lieferhündchen
<leoprikler>I think using a peg parser might be more appropriate than string-replace-substring
<leoprikler>basically, you want to get to something similar to what you'd pass to Guix' mixed-text-file, e.g. '("Title: " title "\nContent: " content)
<leoprikler>where title and content are then replaced by the actual title and content
<leoprikler>I think doing this with lists and symbols directly might also be beneficial
<leoprikler>no need to do the text parsing
<leoprikler>but if you want you can translate "Title: ~~TITLE~~" to (list "Title: " title)
<kitzman>peg parser on the issue list now ^^
<kitzman>ah, i knew about the umlaut - maybe i can use the correct spelling in the README while using the "latinized" one in the script
<kitzman>btw - i only lived few years there, and mostly in english-speaking communities - isn't substituting "ä" with "ae" non-official but still acceptable?
<leoprikler>In terms of computing it's an antiquated practise hailing from the age of dinosaurs
<leoprikler>we call them welpen if you need something without umlaut
<leoprikler>well, perhaps there's some different between welpen – puppies and hündchen – small dogs, but the analogy probably still works
<kitzman>"lieferwelpe" sounds cute ^^ i'll go with that
<dsmith-work>Happy Friday, Guilers!!
***apteryx_ is now known as apteryx
<roptat>is there a way to give a property to a procedure, so that I can read it later with procedure-properties?
<roptat>(it's enough for me if it's limited to adding properties when defining the procedure)
<roptat>ah, set-procedure-properties! I should have read the manual