IRC channel logs

2022-10-01.log

back to list of logs

***nckx is now known as nckhexen
***LoupGris is now known as Lycanthropy
***Lycanthropy is now known as Haematophage
<rillian>Hi. I'm following the tortoise tutorial for C integration at https://www.gnu.org/software/guile/docs/guile-tut/tutorial.html
<rillian>I was trying to make it work without using globals for the C-side program state. Is there a way to pass a context pointer into the proceedures guile calls?
*civodul found a bug in the baseline compiler: https://issues.guix.gnu.org/58217
<civodul>looks like the fix is easy
***NullPointerErro1 is now known as NullPointerError
<flatwhatson>that fix looks good to me, fwiw :)
***Noisytoot_ is now known as Noisytoot
<civodul>flatwhatson: thanks for taking a look!
<civodul>i think we have patches of yours to process BTW
<civodul>flatwhatson: do you have a reproducer for https://issues.guix.gnu.org/57948 ?
<civodul>would be nice to turn it into a test case
<flatwhatson>civodul: i did try briefly, but didn't have any luck. i'll have another look at it
<flatwhatson>meanwhile writing tests for the exception locations fix, shows that it's not that simple. sometimes we spend 2 frames in raise-exception, sometimes 3!
<flatwhatson>and "throw" gets inlined, so doesn't need to add #:skip-frames 1 at all. i had a feeling that one was too easy...
<flatwhatson>i guess the optimiser will cause trouble for any hard-coded frame counts. the other approach i considered is to scan backwards for raise-exception frames
<flatwhatson>actually, i think i've pinned it down, it's re-raising from with-exception-handler adding the extra frame
<tohoyn>has anybody created menus with G-Golf and GTK4?
<tohoyn>radio menu items, in particular
<sektor[m]>Is there a way to force import a entity from a module so I don't have to (22 (foo bar baz)) for each nonexported item?
<sektor[m]>s/22/@@/
<tohoyn>IMHO @@ is not good programming style
<sektor[m]>It's a lot to listen to, especially when there are a lot of such things?
<antipode>sektor[m]: Using define-public instead of define can be useful to avoid addiional exports
<tohoyn>can't you export such items in the appropriate modules?
<sektor[m]>I am aware of defin-public for things I am in direct control of, but I'm consuming a module currently.
<tohoyn>ok
<ft>Hm. I wrote a macro that explodes into a bunch of definitions. The names involved get some sort of hex suffix, though. The minimal example I can come up with is: (define-syntax-rule (quux) (define baz #t)), which at the REPL: ,exp (quux) → (define baz-12705caaf33de1cf #t) — What am I missing?
<ft>…I was pretty sure I did something like that before…
<mwette>ft: I think guile macros not working in that case. IIRC, it's a hack to deal with module scoping. I tried your example on 2.0 and 2.2 and 2.0 works, 2.2 does not. The way to get around is to make your macro hygenic: (define-syntax-rule (quux sym) (define sym #t))
<ft>mwette: Thanks. The actual code is a bigger syntax-case macro, that generates the name via (with-syntax ...). And that exhibits the same issue.
<mwette>you can get around with syntax-case: (define-syntax abc (lambda (x) (syntax-case x () ((_) #`(define #,(datum->syntax x 'abc) #t)))))
<ft>mwette: That's what I thought I did. But… it doesn't work for me: http://paste.debian.net/1255626/ — I must be missing something.
<ft>mwette: I realise the outer with-syntax isn't required, but even when removed, the issue remains.
<civodul>lloda: i'm looking at the much welcome fix in c0004442b7691f59a0e37869ef288eb26382ad9e :-), and i think it'd be nice to have a test case so it doesn't come back to haunt us
<civodul>(in general i think it's good to commit a test alongside each fix)
<ft>mwette: This is more complete, with the number->symbol utility as well, and a smaller example expansion, that just uses one encoder/decoder pair: http://paste.debian.net/1255628/
<ft>(pasted the wrong width in the expansion, that's 128 vs. 32 — but other than that it's correct).
<ft>…I'm giving up for today. Maybe I'll post something minimised to guile-user tomorrow.
<mwette>ft: I tried to play. I ran into similar issue years ago and ended up wity hygenic. This issue is deep in the bowels of ice-9/psyntax.scm
***NullPointerErro1 is now known as NullPointerError