IRC channel logs

2025-06-08.log

back to list of logs

<mwette>evilsetg: not sure but note (eq? "baz" "baz") -> #f; also the sxml procedures assumes all strings (as well as lists) are not eq?
<mwette>so `(foo ,z ,z) where z is "foo" is `illegal'
<mwette>(but I think the assumption is more important when z is '(bar "baz")
<apteryx>wingo: "Mutating the returned bytevector mutates the memory pointed to by POINTER, so buckle your seatbelts." thanks for the the playful writing in the Guile Reference manual; it's a small detail that makes reading it more enjoyable.
<apteryx>how can I do a (non-arithmetic) left or rigth bitwise shift?
<apteryx>OK, I do not need a non-arithmetic version as I'm dealing only with positive integers.
<apteryx>so I can use 'ash'.
<evilsetg>mwette: thanks, that was my mistake. I should have been using equal? instead of eq?. I wonder though why it worked with eq? at all in the case of using a literal tree.
<apteryx>is (ash x -5) supposed to be faster than (quotien x 32) in Guile ? I don't see it with ,time
<mwette>evilsetg: eq? would work if the compiler optimized it that was (e.g., common subexpression elimination -- cse)
<mwette>apteryx: The optimizier could be turning quotient into ash. Try w/o optimization?
<apteryx>good idea; can I turn these off at the REPL?
<apteryx>ah, it's a parameter...and it goes all the way to... 9!
<mwette>Look at `define-binary-primcall-reducer' in language/cps/type-fold.scm. That looks like something.
<apteryx>default-optimization-level from (system base compile) behaves oddly: (default-optimization-level 0) -> 2 (default-optimization-level 1) -> 0, (default-optimization-level 9) -> 2.
<apteryx>that's odd
<apteryx>it's like I have to set it twice for the value I want to take effect
<apteryx>even with optimization at I'm not seeing a difference.
<apteryx>at 0
<mwette>you could guild compile -O0 file.scm
<mwette>(default-optimization-level L) returns the previous-level
<apteryx>is it not supposed to set it, the way parameters work?
<apteryx>if I just wanted to know the current level, I'd do (default-optimization-level).
<apteryx>is the current behavior documented as such? I didn't see that in the manual.
<apteryx>but it seems what you found would imply that Guile knows to optimize these things :-)
<identity>apteryx: all parameter accesses (including mutation) return the current (or previous) value
<apteryx>ah! I had forgotten about this parameter behavior. Thanks.
<wehlutyk>Hello all
<sneek>wehlutyk, you have 2 messages!
<sneek>wehlutyk, daviid says: guile-cv doesn't offer any webcam nor scanner image(s) capture api, you have to capture using other tool/lib ... including microscope/tomography apps ... it's called cv, so in the long run the name remanes valid, but in its current state, it is more a (scientific) image processing lib (then a computer vision) - i am not aware of what guile-gocv - if you want to use gstreamere, use g-golf
<sneek>wehlutyk, daviid says: i recently became aware of the existence of a Gimp typelib, so you can use it using g-golf: fire guile, then ,use (g-golf) and (gi-import "Gimp"), assuming you installed the gir1.2-gimp-3.0 package of your distro - the api doc is here https://developer.gimp.org/api/3.0/libgimp/