IRC channel logs

2022-11-06.log

back to list of logs

<dsmith>!nickometer wingo
<dsmith>!nickometer wingo
<dsmith>!nickometer wingo
<sneek>"wingo" is 0% lame
<dsmith>!nickometer WiNgO
<sneek>"WiNgO" is 17.69% lame, because 1 extraneous cap, 2 case shifts
<dsmith>Goodbot
<dsmith>sneek: botsnack
<sneek>:)
<cow_2001>ArneBab: hmm. so readline. is it a compile flag?
<cow_2001>wait, i can look it up on the internet!
<cow_2001>got it! https://www.gnu.org/software/guile/manual/html_node/Loading-Readline-Support.html
<cow_2001>fantastic :D
<edoput>hi all. I wrote some code and would like to write some tests. I don't really want to go through exporting all the possible functions defined as I am still exploring the problem space. Is there a way to write tests within the module hierarchy that I am missing?
<singpolyma>You can call not exported stuff with @ if you like
<edoput>I'm not sure how this plays out. I was thinking of nesting modules, e.g. (mymodule test), but I dont' know much about it.
<edoput>But @my-function would work from anywhere importing my module even though my-function is not exported?
<singpolyma>I forget the exact syntax for @/@@ it's in the manual
<unmatched-paren>singpolyma: (@ (foo bar baz) symbol)
<chrislck>!nickometer snee
<sneek>"snee" is 0% lame
<chrislck>!nickometer sneek
<sneek>"sneek" is 0% lame
<chrislck>!nickometer sneeK
<sneek>"sneeK" is 8.30% lame, because 1 extraneous cap
<chrislck>!nickometer SNEEJ
<sneek>"SNEEJ" is 97.37% lame, because 5 extraneous caps
<chrislck>!nickometer SNEEK
<sneek>"SNEEK" is 97.37% lame, because 5 extraneous caps
<chrislck>hm not quite 100%
<singpolyma>!nickometer !!11!!!
<sneek>"!!11!!!" is 99.99% lame, because k3wlt0k, 5 consecutive non-alphas, 5 extraneous symbols
<singpolyma>!nickometer GAR!!11!!!L0NSABLE
<sneek>"GAR!!11!!!L0NSABLE" is 100.00% lame, because k3wlt0k, 5 consecutive non-alphas, 5 extraneous symbols, 10 extraneous caps, 4 letter/number shifts
<nckx>!nickometer jeffbezos
<sneek>"jeffbezos" is 0% lame
<nckx>Garbage.
<nckx>sneek: later ask dsmith: Is this some undead left-over from debugging the metaphone?
<sneek>Got it.
<lilyp>!nickometer beilibivaepaetee
<sneek>"beilibivaepaetee" is 0% lame
<lilyp>hmm, it doesn't have a pwgen detector sadly :(
<lilyp>!nickometer xx69xx
<sneek>"xx69xx" is 99.99% lame, because k3wlt0k, matched special case /xx/, matched special case /69/, 2 letter/number shifts
<civodul>woow, didn't know sneek is this brilliant
<nckx>!nickometer hunter2
<sneek>"hunter2" is 99.99% lame, because k3wlt0k
<nckx>\o/
<lilyp>!nickometer sneek[m]
<sneek>"sneek[m]" is 25.65% lame, because 2 extraneous symbols
<lilyp>sneek: botsnack
<sneek>:)
<rlb>civodul: think are likely to be any more 2.2 releases? I'm guessing not, but just wondering when thinking about bug fixes.
<rlb>"think there are"
<civodul>rlb: i don't think so, it doesn't seem very useful to me
<civodul>WDYT?
<civodul>(but i'm all for a 3.0.9 real soon)
<rlb>wrt 3.0 if we want it in debian's next stable release, might *need* to be soonish, fwiw.
<rlb>wrt 2.2. no strong feelings - crossed my mind given that hashing fix. Though also, if there were time (not sure there is, and there definitely isn't unless things go differently this time), wondered whether we really wanted 2.2 in bookworm if it's (effectively longish been) EOL upstream (last commit 2020?).
<rlb>ACTION is going to check the reverse deps now...
<rlb>(even though there's likely no point :) )
<rlb>Removing guile-1.8 took *years*, though we could certainly have been more aggressive about it.
<rlb>Oh, and forgot to ask in my reply, but it sounded like you were inclined to move the test to the scheme side?
<civodul>rlb: yes, having the test in Scheme might be fewer lines
<rlb>Oh, that's why I was confused. At first, I actually thought we'd already removed guile-2.2 from sid, but when I looked it was still there (hence the release removal comments above), but now I see that it actually *has* been removed from bookworm (the next stable release), which is great. Now I think I just need to request its removal from unstable/sid.
<civodul>interesting
<rlb>fwiw https://packages.debian.org/search?keywords=guile-2.2
<rlb>I just saw sid there earler and "assumed", but then checked my mail because I thought I'd remembered the removal message (which was for testing) :)
<rlb>So not entirely crazy, just not paying sufficient attention.
<civodul>:-)
<mwette>Many kudos to rlb for maintaining Debian. Redhat is at 2.0.14, lol.
<sneek>Welcome back mwette, you have 2 messages!
<sneek>mwette, lechner says: Did you see this talk? https://10years.guix.gnu.org/video/guile-wlroots/
<sneek>mwette, dsmith-work says: what did you mean by "looking for origin"? Looking for the LaTeX source?
<rlb>Certainly welcome, and ouch(?) wrt 2.0.14.
<rlb>(Just filed the unstable "rm guile-2.2" with the ftp-masters fwiw.)
<rlb>ok, so reverse engineering from convert_module_name, scm_from_utf8_symboln must expect the byte count, not the unicode char count (what I'd expect, but we don't document it afaict).
<dsmith>Regarding the "nickometer" thing. The old "dpkg" bot in #debian freenode had that. I though it would be fun to convert to scheme at add to the bot.
<sneek>Welcome back dsmith, you have 1 message!
<sneek>dsmith, nckx says: Is this some undead left-over from debugging the metaphone?
<dsmith>nckx: Nope. Just a kind of fun thing an old bot used to have
<dsmith>Most people around here are sane resposible adults and need no prompting to choose a non-lame nick
<nckx>That didn't stop #guix from having a field day.
<nckx>Its rules sure are arbitrary and controversial! :)
<dsmith> https://github.com/w3c/infobot/blob/main/extras/nickometer.pl
<nckx>dsmith: Aha!
<old>sneek: later tell dthompson that the concept in Catbird look nice and that I will try to hack with it
<sneek>Got it.
<old>civodul: Last time I've checked, they were still on 2.2
<spk121>civodul: in this recent email to guile-devel, they say they're still on 2.2: https://lists.gnu.org/archive/html/guile-devel/2022-10/msg00062.html
<civodul>spk121: oh ok; then we should discuss it with them
<civodul>but in the end, someone will have to do the work :-)
<spk121>!nickometer spk121
<sneek>"spk121" is 99.99% lame, because k3wlt0k
<spk121>lol
<flatwhatson>!nickometer flatwhatson
<sneek>"flatwhatson" is 0% lame
<flatwhatson>8)
<RhodiumToad>!nickometer RhodiumToad
<sneek>"RhodiumToad" is 0% lame
<RhodiumToad>heh
<flatwhatson>good bot
<flatwhatson>sneek: botsnack
<sneek>:)
<ArneBab>cow_2001: that made me happy to read! Can I quote you on this? (???wait, i can look it up on the internet!???)
<KREYREN>> <@klugmathias:matrix.org> ```scheme... (full message at <https://libera.ems.host/_matrix/media/v3/download/libera.chat/a8829ef54dbf7aee4d0dcfd157acf21e3b0b5f8a>)
<w0ll3q1uszxabiwo>oops
<w0ll3q1uszxabiwo>Is there any sane reason to why guile doesn't recognize `.*\.ss$` ?
<w0ll3q1uszxabiwo>since scheme does
<ArneBab>w0ll3q1uszxabiwo: you can use -x .EXT to add another extension.
<w0ll3q1uszxabiwo>hmm ????
<w0ll3q1uszxabiwo>interesting
<w0ll3q1uszxabiwo>can you easily filter through these?
<w0ll3q1uszxabiwo>e.g. only load `.EXT` from dir
<lloda>there's %load-extensions variable. I suppose you can configure that in ~/.guile
<w0ll3q1uszxabiwo>oh cool
<w0ll3q1uszxabiwo>thanks
<w0ll3q1uszxabiwo>but like why is that not default if it's standard extension in scheme?
<cow_2001>ArneBab: yes
<nckx>dsmith: Feature request: consider moving the 'botsnack' match clause (or whatever) last. Sneek stole and ate a 'later tell' botsnack I left for someone else, showing no remorse, just a demented grin.
<dsmith>nckx: Ok.
<dsmith>ACTION looks
<nckx>It's a niche use case, but crime cannot be tolerated on this network.
<nckx>Gracias!
<nckx>ACTION didn't mean *right now*.
<dsmith>Heh. It's ok. I'm here.
<nckx>Plus, no -work suffix, so no excuse.
<dsmith>So, give that a try
<nckx>Now? Wow.
<dsmith>Sure.
<nckx>sneek: tell dsmith: let's see if this botsnack makes it to you without suspicious bite marks.
<sneek>dsmith:, nckx says: let's see if this botsnack makes it to you without suspicious bite marks.
<nckx>Yey!
<nckx>dsmith: Excellent fanservice, thank fou very much.
<nckx>y.
<dsmith>np!
<lloda>w0ll3q1uszxabiwo: there isn't any standard extension afaik. Each implementation does its own thing
<w0ll3q1uszxabiwo>hmm i see O.o
<w0ll3q1uszxabiwo>Can i declare anything i was as a property/meta-information to variables and procedures?
<w0ll3q1uszxabiwo>ACTION is working on a spec for his project management tool
<w0ll3q1uszxabiwo>*anything i want
<old>w0ll3q1uszxabiwo: You're refering to set-object-property?
<w0ll3q1uszxabiwo>yep.. struggling to set properties for immidiates
<old>object's properties are just alist associated to a object
<old>(set-object-property! 1 'foo 'bar)
<old>(object-properties 1)
<old>Now I don't see the usage of property on number, but typically you can do so on procedure and record
<w0ll3q1uszxabiwo>(define foo 2)
<w0ll3q1uszxabiwo>(set-procedure-property! foo 'something #t)
<w0ll3q1uszxabiwo>(procedure-properties foo)
<w0ll3q1uszxabiwo>what i have
<w0ll3q1uszxabiwo>oh you wrote things.. reading
<w0ll3q1uszxabiwo>old: what's an 'object' in this context?
<old>everything?
<old>I guess
<old>everything thas has an address
<old>(object-address (cons 1 2))
<old>(object-address 1)
<old>Here's an usage of mine to tag OOPS method
<old>(define-method (foo) ...)
<old>(set-object-property! foo #:my-tag value)
<old>Also for procedure, you can use the procedure-properties/set-procedure-property!
<w0ll3q1uszxabiwo>old: for context: i was forking potato-make and eventually made my own implementation from it and it has an in-direct implementation for immidiates so i want to have that tasks/rules that are expected to be always running run and i have handling to do metadata for nicer help message and scripting framework
<old>(define (make-tagged-identity name) (define the-identity (lambda (x) x)) (set-procedure-property! the-identity 'name name) the-identity)
<w0ll3q1uszxabiwo>old: i want it to work for like (define something (let [...] (display "hello"))) though?
<w0ll3q1uszxabiwo>so to get rid of requirement to maintain a separate alist processed through identifier names
<old>Okay. Well typically the set-object-property! and object-property should work just fine for anything in Guile
<old>Can you also use `make-object-property` to get a getter/setter procedure for a given property
<old>(define my-tag (make-object-property))
<old>(my-tag 1)
<old>(set! (my-tag 1) 2)
<old>(my-tag 1)
<old>Of course, you're free to use any object again
<old>However, it seems that `make-object-property` is a weak hashtable where the key is the object
<old>instead of an alist that is owned by the object
<old>So you can't get the `my-tag` property with `object-properties`
<old>Just so you know :)
<w0ll3q1uszxabiwo>hmm i see
<w0ll3q1uszxabiwo>seems as usable solution, but i need to research it more for the spec, thanks ^-^
<apteryx>is there no guile 3 in debian 10?
<apteryx>seems like there should be one in stable: https://packages.debian.org/bullseye/guile-3.0
<apteryx>for some reason on my debian 10 VM it's nowhere to be found
<apteryx>it's still using 'buster' instead of bullseye though,
<dsmith-work>{appropriate time} Greetings, Guilers
<dsmith-work>sneek: botsnack
<sneek>:)
<old>apteryx: See https://pkgs.org/search/?q=guile. Just put the distro filter to Debian
<old>From what I see, there's only guile-2.2 on buster
<old>Bullseye has 3.0.5 and sid has 3.0.8
<apteryx>thanks
<apteryx>I'm trying to update my VM from 10 to 11
<old>Talking about distro, somebody know why ArchLinux is still on guile-2.2 (expect from AUR)
<old>The "rolling model" is kind of slow on that part
<cow_2001>this guile thing is a whole nother world. been using python for a while and i can't find my arms and legs.
<cow_2001>reading about ice-9's ftw
<old>cow_2001: Feel free to ask us questions :-)
<rlb>civodul: wrt the hash test value - I can just hack up a call to print the value for that test sequence of bytes when passed to narrow_string_hash(). That should be the unoptimized result. Sound plausible?
<cow_2001>things i would like to do right now: subprocess.Popen(), requests.get()
<cow_2001>i see there's https://www.gnu.org/software/guile/manual/html_node/Web-Client.html
<cow_2001>but then i would need to figure out the json inside the http response
<cow_2001>(those functions are standard library functions of Python)
<cow_2001>err
<cow_2001>no, sorry. requests is not standard library ~_~
<cow_2001>oh, and i need to figure out http headers
<old>For `subprocess.Popen()`, there's the module `(ice-9 popen)`. See https://www.gnu.org/software/guile/manual/html_node/Pipes.html
<old>For parsing JSON, there's `guile-json` a third party library. It is not available on every distro though: https://github.com/aconchillo/guile-json
<old>Here's an example where I use `http-post` and `guile-json` together to serialize the body of the request.
<old> https://git.sr.ht/~old/guile-sourcehut/tree/master/item/sourcehut/endpoint.scm
<old>I also deserialize the response body with `(json->scm port)`. This works because I've put `#:streaming? #t` to the `http-post`.
<old>There's also an example of using Content-Type and Authorization headers in it :-)
<civodul>quizz! how can new scm_tc7_program objects with flags == 0 pop up while a program is running?
<dsmith-work>civodul: When there is a bug in Guile?
<civodul>dsmith-work: no, in general
<dsmith-work>;^}
<civodul>that happens any time a closure is allocated
<civodul>problem is that it's hard to trace because nowadays the generated bytecode that does this takes care of bit twiddling
<civodul>(as opposed to having a macro 'make-closure' instruction like in the old days)
<apteryx>would disabling JIT help?
<daviid>sneek: seen tohoyn
<sneek>tohoyn was last seen in #guile 10 days ago, saying: daviid: when I ran autoreconf -ivf in up-to-date g-golf devel in up-to-date debian testing I got the following error: https://paste.debian.net/1258548/.
<count3rmeasure>just logged in so double checking to see if that was hidden before
<dsmith>sneek: botsnack
<sneek>:)
<dsmith>!uptime
<sneek>I've been running for 11 hours
<sneek>This system has been up 1 week, 5 days, 22 hours, 23 minutes
<rlb>I just ran a "make clean", and it it took me back to "BOOTSTRAP(stage0) GUILEC ice-9/eval.go". I thought that should only happen on a "make distclean" or similar?
<rlb>
<rlb>(current main branch)
<daviid>rlb: make clean probably deletes all .go files, so ice-9/eval.go as well (?)
<rlb>Hmm, ok. I'd thought that you didn't have to re-bootstrap after a plain "clean". I'll have to keep that in mind. Definitely didn't expect the side-track.
<daviid>i am not sure, but ime, buildi9ng from the source, make clean always did clean 'everything' - maybe there is/are some diff checks and what is kept for those who uses tarball ...
<w0ll3q1uszxabiwo>How do i make a condition that checks if list contains `--help` and returns #t if it does?
<w0ll3q1uszxabiwo>the `--help` is a string so stored as `"--help"`
<rlb>If I understand you correctly, maybe (member "--help" some-list)
<w0ll3q1uszxabiwo>rlb: that seems to be it, thanks!
<rlb>That won't return #t specifically, but it'll return a "not false" value, i.e. the list begining with "--help".
<rlb>Certainly.
<w0ll3q1uszxabiwo>oh
<rlb>That'll still work with "if", etc.
<w0ll3q1uszxabiwo>oke
<rlb>Hmm, though, just a sec.
<rlb>OK, yeah, that should be fine.
<rlb>Wanted to check that it didn't return '() when the value was missing :) Just second guessing myself given a lot of clj.
<rlb>(though there () isn't false either I suppose, only false or nil)
<w0ll3q1uszxabiwo>will that work on `(command-line)` ? Not sure what kind of data-type that is, but seems like a procedure that returns a list?
<w0ll3q1uszxabiwo>ACTION can't test that easily atm
<rlb>yep, should work fine.
<w0ll3q1uszxabiwo>oke thanks! ^-^
<rlb>See also: srfi-37, maybe.
<rlb> https://www.gnu.org/software/guile/manual/html_node/SRFI_002d37.html
<rlb>depending on what you want
<rlb>(or (ice-9 getopt-long))
<rlb> https://www.gnu.org/software/guile/manual/html_node/getopt_002dlong-Example.html
<w0ll3q1uszxabiwo>i know about getopt-long, but doing custom management for the args
<w0ll3q1uszxabiwo>thanks for mentioning it though
<rlb>Ahh, ok.
<tohoyn>daviid: building g-golf works fine after I installed gettext
<sneek>tohoyn, you have 1 message!
<sneek>tohoyn, daviid says: AC_LIB_LINKFLAGS_FROM_LIBS is defind in lib-link.m4 which is provided by gettext - apt-get install gettext - should fix this problem
<spk121>janneke: I'm going to rebase the wip-mingw branch on the latest origin/main and force push it
<sneek>dsmith: Greetings :)
<dsmith>sneek: botsnack
<sneek>:)
<dsmith>Anyone know of any fuzz testing libs for guile?
<spk121>nope. But do you need something more complicated than sending random strings and catching errors?
<dsmith>That's about it. Max 9 char strings
<cow_2001>okay, a new day and a new attempt at understanding the http api
<dsmith>Alternatively, can anyone spot any (more) bugs in https://paste.debian.net/1259929/ ?
<cow_2001>i think i am just missing earlier stuff i should learn before attempting that :|
<cow_2001>aaaand i should really read things top to bottom??? ~_~
<dsmith>heh
<cow_2001>"the protocols themselves are textual (though the payload may be binary)" i love this situation where we have so many layers of data. it's like a Matriyoshka.
<old>cow_2001: HTTP is a indeed a textual protocol, but the content-type of the body can be anything. JSON, image, etc.
<old>The only thing you have to do is to use `(string->utf-8)` that is in the module `(rnrs bytevectors)`
<cow_2001>you know what these texinfo-ish manuals need in their one-page-per-node HTML output? a "next node" link which will take you to either the first node under the current node, or if there are no child nodes, to the next sibling node, and if that does not exist, to the next sibling node of the parent, and so on.
<old>That should work for any content-type that is textual like JSON
<old>dsmith: I use guile-quickcheck to generate "fuzzing" configuration of library but that's not a automatic fuzzing that generates new corpus
<dsmith> https://ngyro.com/software/guile-quickcheck.html
<dsmith>I'll check it out
<dsmith>old: Thanks!
<spk121>random strings https://paste.debian.net/1259934/
<cow_2001>is there a way of having something like module namespaces in guile? like in python's `import matplotlib.pyplot as plt`?
<spk121>cow_2001: when you import a module with use-modules, you can prepend a string to all the functions you import. Search the manual for #:renamer
<spk121>and symbol-prefix-proc
<nckx>Or just #:prefix.
<cow_2001>i have to say that it is refreshing reading a manual that is written like a book.
<cow_2001>not as an hodgepodge of howtos and reference
<dthompson>civodul: that heap profiler of yours is very cool! I didn't know about /proc/PID/maps.
<civodul>dthompson: heh thanks! i've been willing to have something like that for a while
<dthompson>also first time seeing things like visit-heap-tags from (system base types internal)
<dthompson>very neat
<civodul>it's great that the new (system base types internal) does all the heavy lifting
<civodul>yeah
<dthompson>oh it's new? that explains some things.
<dthompson>it's very cool. I didn't know that I could access that kind of information.
<civodul>wingo added it a while back, maybe in 3.0.0?
<dthompson>makes sense
<dthompson>a heap profiler would definitely come in handy for any long running guile program
<dthompson>leaks are sneaky things
<wingo>inspired by similar things in v8 etc
<dthompson>very cool.
<wingo>llvm's tablegen is terrible to debug but also good in this domain
<dsmith-work>{appropriate time} Greetings, Guilers
<nckx>o/
<old>cow_2001: Here's a quick example: (use-modules ((ice-9 ftw) #:prefix ice-9 #:select (file-system-fold)))
<old>s/#:prefix ice-9/#:prefix ice-9:/
<old>In the previous form, I import the module `(ice-9 ftw)` with a prefix for all imported binding of `ice-9:` and I only select the procedure `file-system-fold`.
<old>So now I can use `ice-9:file-system-fold` in the file where this form is
<old>Like spk121 mentioned, Guile allows you to implement your own renamer for renaming imported symbol. Much more powerful than Python :-)
<old>civodul: Can't the Boehm GC already do that kind of profiling or I am out of the loop here?
<dsmith-work>spk121: Thanks. That helped me find another bug
<cow_2001>fantastic. thank you old and spk121!
<cow_2001>i love being able to tab-complete stuff in the prompt
<cow_2001>so this would help a lot
<old>Are you working from a terminal or Geiser in emacs?
<cow_2001>terminal. but i want to get a bit better at emacsing, so maybe i should try this Geiser thing.
<old>Okay. For now you can perhaps use this configuration: https://paste.sr.ht/~old/b029e7e46cdc1de29c5377d15e141920fcfebe2d
<old>Put it in ~/.guile
<old>It will load `guile-readline` and `guile-colorized` if installed on your system
<old>So with `readline` you will have tab-completion but also prompt history like in bash
<old>and `colorized` will add some nice color to the sad gray terminal
<dsmith-work>cow_2001: And after you get to emacsing regularly, try paredit. Takes some getting used to, but lets you edit at a higher level.
<dsmith-work>Any ever used frobnicated in anger?
<old>Yes paredit is trully the best thing. Many editor has some sort of paredit variant
<dsmith-work>s/frobnicated/frobnicate/
<old>dsmith-work: What do you mean?
<dsmith-work>old: Sorry! I meant paredit-convolute-sexp
<dsmith-work> https://mumble.net/~campbell/emacs/paredit.html
<ArneBab>cow_2001: you have headers and then content-bytes of the length described in the header ??? parse the headers, then read the bytes for the body.
<cow_2001>then you have data inside json written as base64 which is a zip file holding who knows how many more layers???
<cow_2001>(i just appreciate the whimsical quality of this whole situation)
<dsmith-work>Back-In-The-Day, we had this cool protocol called "TCP" that let us send reliable byte streams. Now everything is HTTPP(S) (over TCP), because?
<dsmith-work>Anything not on port 443 is dangerous?
<civodul>ACTION doesn't give up! https://github.com/wingo/fibers/issues/65#issuecomment-1307485363
<cow_2001>dsmith-work: web pages cannot do tcp, so they do http and websocket and that udp-like protocol instead
<dsmith-work>Right. Not everything is a web page, but now, it is. Because a web browser is the only allowed client. (Yeah, I being cranky. ;^} )
<dsmith-work>I'm
<cow_2001>it's okay. i think contemporary IT is a crapsaccharine dystopia too.
<cow_2001>but it is nice to have a sandboxed OS where you can just download games and whatnot and not worry (a lot) about malware
<dsmith-work>ACTION checks his lawn. Again.
<cow_2001>dsmith-work: no whipper snappers on your lawn?
<dsmith-work>Seems to be safe. For now..
<chrislck>ACTION doesn't like paredit... vanilla emacs () is ok
<old>dsmith-work: I found myself only using raise-sexp, forward-slurp and kill.
<cow_2001>please excuse my weird indentation rules and the non-use of standard library functions. i am trying to write a function that would use-modules, but with prefixes. https://0x0.st/oEky.txt
<cow_2001>(use-modules-prefixed '(ice-9 readline)) would make prefix all symbols of that library with ice-9:readline:
<cow_2001>would make it prefix
<cow_2001>but it doesn't???
<dsmith-work>old: Yes! I think those are the ones I use mostly too.
<old>cow_2001: 1. `use-modules` is a syntax (macro). Thus I would also make your `use-modules-prefixed` as syntax also.
<old>2. The form for a prefix when using `use-modules` is something like `(use-modules (module #:prefix prefix))` and not `(use-modules module #:prefix prefix)` This is because you can choose prefix for different modules
<old>3. #:prefix takes only a symbol to use as a prefix I think. For a general purpose procedure that rename the symbols, you have to use #:renamer
<dsmith-work>use-modules *must* be a macro. Otherwise things like (ice-9 foo) would be evaluated as a function call.
<old>Yes
<old>cow_2001: Hold on I will give you a paste that does what you want
<old> https://paste.sr.ht/~old/ba124ff5f2614717e729922a061536d2842df4d3
<old>Using that macro, you simply pass to it modules without the ice-9 and it will import them all with prefix ice-9:
<old>So something like `(use-modules/ice-9 readline ftw match)`
<old>Here's the same thing but with #:renamer
<old> https://paste.sr.ht/~old/0542cd1f53bf70d8c543191443c84198618de9c0
<cow_2001>oh right. it really did seem strange to me that there is no single quote before the parenthesis.
<cow_2001>there is a certain amount of RTFMing one needs to do in order to venture into an entirely new way of doing things, and i haven't done that RTFMing. ~_~
<cow_2001>We're not in C-like language anymore, Toto.
<RhodiumToad>I believe another reason for (use-modules) to be syntax is that it needs to run at compile time
<cow_2001>ah!
<dsmith-work>True, though use-modules has been around long before the compiler. Since at least 1.3 I think.
<dsmith-work>Yeah, v1.1 had use-modules
<old>What's mind blowing is that since it's syntax, anybody is free to implement its own abstraction. You don't have to bow to the language designer. You're free to roll your own importer
<dsmith-work>Like from 1997, 25 years ago?
<old>Complete oposite of what Python is IMHO
<old>But use-modules and define-modules is probably the sanest module abstraction I've seen
<dsmith-work>It's been fine tuned for 25 years! (actually, the internals have changed but the interface is mostly the same)
<dsmith-work>I don't remember. Does Guile have some nice functions for comparing runtimes of things?
<cow_2001>"??? When some part of the documentation is not clear and does not make sense to you even after re-reading the section, it is a bug." i love it.
<dsmith-work>Ahh yes. time in (ice-9 time)
<cow_2001>why would you have both `define` and `set!`? what happens internally when you (define x "1") and then (define x "2") one after the other?
<cow_2001>oh, of course there is a part of the manual dedicated for that.
<cow_2001>okay. here is the relevant bit: Another noteworthy difference to top level definitions is that within one group of internal definitions all variable names must be distinct. Whereas on the top level a second define for a given variable acts like a ???set!???, for internal definitions, duplicate bound identifiers signals an error.
<cow_2001>(use-modules ((a b c) #prefix #:a:b:c:)) is **so** comfortable.
<cow_2001>err
<cow_2001>(use-modules ((a b c) #:prefix #:a:b:c:)) is **so** comfortable.
<dsmith>sneek: botsnack
<sneek>:)
<dsmith>sneek: seen fredg
<sneek>Not as far as I can remember.
<nckx>sneek: botsnack
<sneek>:)
<dsmith>Yey.
<dsmith>nckx: So the metaphone monster is now under control
<nckx>Oh, not just ripped out?
<dsmith>Fixed
<nckx>Fancy.
<dsmith>If I repped it out, all the "seen" and "tell" tables would need to be redone.
<nckx>sneek: seen nckx
<sneek>nckx was in #guile 0 seconds ago, saying: sneek: seen nckx.
<nckx>sneek: seen ncks
<sneek>Nope.
<nckx>sneek: seen nkx
<sneek>Sorry, no.
<dsmith>I tried to convert them, but was too scary
<nckx>I think I'm immune to metaphones.
<dsmith>(metaphone "nckx") -> "nkkks"
<dsmith>(metaphone "nkx") -> "nkx"
<dsmith>(metaphone "nckkx") -> "nkkks"
<dsmith>
<dsmith>sneek: seen nckks?
<sneek>Sorry, no.
<dsmith>sneek: seen ncks?
<sneek>Sorry, no.
<nckx>sneek: seen nkkks
<sneek>Nope.
<nckx>sneek: seen nckkx
<sneek>I think I remember nckx in #guile 0 seconds ago, saying: sneek: seen nckkx.
<nckx>So metaphones are not fixed points, which is wild.
<dsmith>sneek: seen ncks?
<sneek>Sorry, no.
<dsmith>sneek: seen nckks?
<sneek>Sorry, no.
<nckx>sneek: seen nckxs?
<sneek>Sorry, haven't seem 'em.
<nckks>Hey
<nckx>Hey.
<nckx>I resemble that.
<dsmith>sneek: seen nckks?
<sneek>nckks was last seen in #guile 12 seconds ago, saying: Hey.
<dsmith>sneek: seen ncks?
<sneek>nckks was in #guile 21 seconds ago, saying: Hey.
<dsmith>Yeah, it def works on the metaphone
<dsmith>It so happned that "sneek" and "seen" had the same metaphone.
<dsmith>So the bot responded to lots of mesages that ended in "seen"
<dsmith>seen rlb, sneek?
<dsmith>seen rlb, sneek
<dsmith>sneek: seen rlb?
<sneek>rlb?, pretty sure was seen in #guile 18 hours ago, saying: Ahh, ok..
<nckx>sneek: seen botsnack?
<sneek>Sorry, haven't seem 'em.
<nckx>Damn rite.
<dsmith>I guess it's supposed to handle misspellings?
<nckx>Honestly, sneek ~= seen is not the bestest of algorithms??? and that's just for English.
<dsmith>"fred" and "freed" -> "frt"
<nckx>But hey, it doesn't crash, so progress has been made on this day.
<nckx>sneek: seen lekkere freedjes?
<sneek>Nope.
<dsmith>The bot only specifically responds to "sneek" now.
<nckx>snack: seen bot?
<dsmith>OR whetver it's nick is.
<dsmith>seen: botsnack
<dsmith>THat used to actually poke the bot
<dsmith>NO more
<nckx>seen: sneek?