IRC channel logs

2023-01-19.log

back to list of logs

<civodul>uh, pushed a Gnulib update but now i realize additional modules are needed, roughly one per posix_spawn-related function
<cow_2001>oh no. there's no srfi-78
<cow_2001>oh, there's srfi-64
<flatwhatson>mirai: peg-string-compile isn't exported, what are you trying to achieve?
<mirai>flatwhatson: I'm trying to restrict the "scope" of the peg strings like this (https://paste.centos.org/view/8798d15d)
<mirai>instead of using define-peg-string-patterns
<flatwhatson>mirai: ah. you can achieve that by using (define-peg-string-patterns ...) inside a lexical scope where (define ...) forms are valid
<flatwhatson>so eg. (let () (define-peg-string-patterns ...) ...)
<flatwhatson>but it can be better to just structure your code so the peg patterns are defined in a module of limited scope, and just export what you need
<mirai>do the 'or', 'and' sexp patterns accept more than 2 arguments? That is, can I write the peg string 'a <- X Y Z W' as (or X Y Z W) ?
<mirai>and***
<flatwhatson>yes
<mirai>it should have been an (and ....) pattern
<mirai>I wasn't aware that define forms could be used inside a (let ...)
<mirai>thanks
<daviid>sneek: later tell akirakyle i pushed a series of patches that fix both callback procs and vfunc methods arg values, and updated the peg-solitaire example ... when you have some time, please pull, make, install, try and let me know - i will now work to add the 'Unimplemented type - array; (c -1 #f 1 interface)', will let you know when done ...
<sneek>Got it.
<pottsy>Hi folks, I want to match a pattern like: (atom [#:key val]... rest ...) my attempt is here: https://dpaste.org/DjU4u but I need to somehow remove the parens around the attribute/values
<Wurt>Hi, anyone knows why `(use-modules (srfi srfi-19)) (string->date "10:21:00" "~H:~M:~S")` produces an exception? How can I parse a date with that format?
<lloda>i guess "10:21:00" doesn't define a date
<lloda>the error is p bad tho
<drakonis>Wurt: check if the format string is correct
<drakonis> https://srfi.schemers.org/srfi-19/srfi-19.html
<drakonis>oh
<drakonis>you have to pass the template first
<drakonis>oh wait no
<drakonis>im a dumbdumb
<drakonis>well, this is horribly confusing.
<lloda>"10:21:00" just isn't a date. How is the function supposed to figure out year/month/day if you don't give them
<drakonis>the template string
<drakonis>(string->date "input string" "template string")
<drakonis>i'm not sure why the function isnt reading the input string?
<drakonis>oh yeah, right
<drakonis>its an hour lol
<drakonis>lloda: to be fair, the srfi gives you the means to not have to declare a date
<drakonis>the complaint is related to the type
<Wurt>Thanks. I read an example in the racket documentation that reads an hour and I think that guile could do it too. What is the recommended struct to store an hour? POSIX time? A custom record?
<lloda>this could still be a bug in Guile idk. You should be able to store an hour in the date type, just with y/m/d set to #f. Probably Guile tries to do something with those even tho they aren't set
<lloda>if you pick a y/m/d as reference that could be a workaround
<civodul>ACTION still fiddling with Gnulib to get --target=x86_64-w64-mingw32 builds to pass
<mirai>is there any way I can improve the unfold here? https://paste.centos.org/view/91323214
<mirai>It looks a bit "wasteful" doing (search-for-pattern entry x) on each of the functions it's taking in
<lilyp>mirai you could probably define a peg pattern that has several entries, or several noise-separated entries
<lilyp>other than that I think this is rather unsuited for unfold
<mirai>lilyp: what's the adequate replacement for unfold here?
<dadinn>hi all
<dadinn>I have written the following macro: https://termbin.com/ss5a7
<dadinn>unfortunately, I've realized that it reverses the order of the expect clauses. (also the bindings end up in reverse order, but that shouldn't be a functional issue in itself)
<dadinn>what is the way to reverse the final syntax list? Somehow #,(reverse #'clauses-with-bindings) doesn't work
<dadinn>it throws an error when I try to expand this: (tree-il->scheme (macroexpand '(expect ((lambda (x) x) (display "FOO1") (display "BAR1")) ((= 42 shit) (display "FOO2") (display "BAR2")))))
<dadinn>khm... tried to replace all the vulgarities before posting... but it seems I just can't stop my turrets :/
<dadinn>at any rate, the reason for this macro is that it seems that the current expect implementation executes the test expression on each reading of a new character, therefore specifying the lambda means a new lambda is created on each call. I've realized this because I had a matcher-lambda-factory procedure there before, which logged something before creating the matcher-lambda. Not sure if this contradicts the
<dadinn>expected behavior, but I would consider it a bug. Nevertheless my macro is intended to workaround this by evaluating the expression before, and the referring to the already initialised matcher procedures via bindings.
<dadinn>argh!... is there a max character limit per line on IRC? Is this Twitter or what! :'D
<lilyp>mirai: I think a named let is most likely to work, but you could also look into srfi 43 streams
<mfiano>dadinn: The IRC RFC specifies 510-character max, but it includes your hostmask, so it is actually a variable limit below this value.
<mfiano>Conforming clients will split messages into multiple.
<mfiano>Actually IRC predates the Web, so you could say Twitter copied IRC :)
<lilyp>sounds like IRC set up a deliberately high limbo bar and folks at twitter were like "I can go below that"
<dadinn>fair enough... it's definitely more complete picture, when put into historical perspective ;)
<old>510 seems a very arbitrary constant
<civodul>flatwhatson: hi! do you still have that nlocals=0/debugger patch we were discussing the other day?
<old>why not 512. Make it align on a power of two at least
<dadinn>Any suggestion on how I could revert that syntax list... Or use some sort of appending aggregation instead of consing each item on the front?
<count3rmeasure>struggling to understand what I'm doing wrong here, this is a piece of the script I'm working on, that I've isolated to get to the bottom of this error I keep getting. linked are the script and the error message with a piece of the output script: https://dpaste.com/28TSKHCYU error msg: https://dpaste.com/AAHS7FSC4
<count3rmeasure>its part of gdb extension in guile, and here I'm attempting to wrap and capture the output of "info proc mappings"
<count3rmeasure>it appears to choke on the call to infoprocmappings on line 44 within the actual command
<old>count3rmeasure: looks like infoprocmappings is a string and not a procedure
<old>Calling it resulti in applyting a string, which is not possible
<count3rmeasure>on my goodness I think you're right *facepalm*
<old>(execute "info proc mappings" #:to-string #t)
<old>You're explecitely asking for a string ^^
<count3rmeasure>and I can just capture that inside of the command itself and pass that to the following procedure
<count3rmeasure>thank you so much
<old>(sort-ipm-lst (string-tokenize (execute "info proc mappings" #:to-string #t)))
<old>Or you would use some `let' if you want local variable for easier reading
<old>np
<count3rmeasure>old:much appreciated
<mfiano>old: It's actually 2^9 but CR/LF is the message delimiter token, so I didn't include those 2 characters.
<old>Oh okay make sens
<mfiano>512 minus length of nick/hostmask minus CR minus LF
<old>Ehh CR/LF really
<old>Did CR was actually useful at the exception of typewritter
<old>That and some crap OS that use it
<mfiano>:)
<civodul>in other news, "main" successfully cross-builds to x86_64-w64-mingw32
<civodul>(whether it runs, i don't know :-))
<dthompson>civodul: heh that was going to be my question!
<dthompson>maybe I'll have to test that out sometime
<civodul>someone with Windows or some Wine setup will have to tell
<civodul>and! it also appears to build fine with Clang
<civodul>(still running, but libguile built fine)
<dthompson>I am going to copy the guix command you posted on mastodon
<civodul>with these "edge cases" done, should be able to push rc1 soon
<dthompson>and see if I can run the result with fine
<civodul>that'd be great!
<civodul>it takes a while because it builds Guile twice: the native one first, and then the MinGW one
<civodul>you need Guix from today too because i fixed a couple of things in the 'guile-next' package
<dthompson>civodul: ah that explains the failure I just got. thanks.
<dthompson>it would be good for spritely if we could ship guile programs to windows machines.
<dthompson>ACTION runs guix pull
<civodul>your house will get warmer
<dthompson>well hopefully now that I have thermald running my laptop won't shut off
<dthompson>I'm pretty sure I killed my old thinkpad x220 by compiling guile
<dthompson>the fact that the mingw build works without disabling threads or jit is promising
<civodul>yeah i was surprised actually
<civodul>we're pulling tons of Gnulib code, it's gotta be useful :-)
<dthompson>in a couple years, when this build is done, I'll give it a go in wine and see what happens ;)
<civodul>perhaps you'll have forgotten by then what it was you wanted to test
<civodul>there's always a risk :-)
<dthompson>looks like we're done the native build. :)
<dthompson>40-45 mins for a build, I guess. seems about right from past experience.
<flatwhatson>civodul: hi! yes, here's the diff: https://paste.debian.net/1267841/
<flatwhatson>i haven't come up with a test for it yet sorry
<flatwhatson>happy to make a proper patch if you'd like
<dadinn>back to my point about my expect macro, I've figured how to reverse the accumulated syntax: https://termbin.com/yawov
<dadinn>I have noticed though that there is definetely something off with the official ice-9 expect macro...
<dadinn>the docs say that expect should not be possible to be called without at least one clause: https://www.gnu.org/software/guile/manual/html_node/Expect.html
<dadinn>in but actually you can: (tree-il->scheme (macroexpand '(expect-old)))
<dadinn>my macro also fixes that: if it's called with no argument that's an error. It would be because my let bindings would end up an empty list, which is an error anyway!