IRC channel logs

2020-09-12.log

back to list of logs

<str1ngs>leoprikler: (enum->value (gi-cache-ref 'enum <enum>) <symbol>) should work as daviid mentioned. but it's nothing like what the GTK documentation has. so defiantly this needs some higher level code to make it easier to use. take gtk_window_set_position(window_p, GTK_WIN_POS_CENTER); vs scheme (set-position window (enum->value (gi-cache-ref 'enum 'gtk-window-position) 'center)) also as daviid mentioned about my example (gi-cache-ref 'enum
<str1ngs>'gtk-window-position) should be throw an error if the enum is not found. it returns #f when it can't find something.
<daviid>str1ngs: wouldn't (set-position window 'center) work?
<str1ngs>actually it does, but that's inconstant with (gtk-button-new-from-icon-name "gtk-go-back" 3) which takes a int
<str1ngs>3 should be an enum value of GtkIconSize . so in C you would use GTK_ICON_SIZE_SMALL_TOOLBAR
<pinoaffe>Hi Guix! so I want to run some shell command and capture its output in a string, I think something along the lines of (with-output-to-string (lambda () (system "echo bar"))) should do the trick, but it's not working (bar is still just printed, and the expression returns the empty string) - what am I doing wrong?
<daviid>str1ngs: the inconstance is in the gnome/gtk designm these run-dialog, and gtk-button-new-from-icon-name are exceptions though, in my xperience and for the alter, you should b able to use make <gtk-button> #:image ... or something close ...
<str1ngs>pinoaffe: maybe this would be better? (read-line (open-pipe* OPEN_READ "echo" "bar")) ? you will need to (use-modules (ice-9 rdelim) (ice-9 popen))
<pinoaffe>str1ngs: aight, that seems to work
<pinoaffe>any idea why with-output-to-string doesn't?
<brendyyn>the output is not what is echot but the return value 0, i think
<brendyyn>looks like it ends up as the empty string
<pinoaffe>oh, I think with-output-to-string doesn't redirect stdout, it just ensures that guile functions such as write and display write to a temporary port rather than to the regular stdout
<str1ngs>daviid: I just use my helper functions.
<pinoaffe>in other words: subprocesses don't necessarily get assigned the current output port, I think that that's a bug
***jonsger1 is now known as jonsger
***jonsger1 is now known as jonsger
<RhodiumToad>subprocesses can't be assigned the current output port if it's not a file
<manumanumanu>stis: Ahoy! You should take all the lessons learned from the python bytevector-as-strings and dive head first into the discussion over at: https://srfi.schemers.org/srfi-207
<leoprikler>it's 2020 and people still talk about ISO 8859-1
<leoprikler>when will this nightmare stop?
<str1ngs>only when morale improves leoprikler.
<stis>manumanumanu: well noted. I compiled a tiny repository of scheme-python tools in https://gitlab.com/tampe/scheme-python
<stis>this is standalone and should not need any dependencies apart from guile itself
<stis>contains the python string operations for bytevectors.
<stis>I do have a regular expression library for bytevectors as well, but that needs dependencies so I skiped that
<stis>for doc see http://c-lambda.se/python-on-guile/
<manumanumanu>leoprikler: they were wonderful times, at least for the person doing teh programming.
<manumanumanu>imagine! o(1) efficient random acces into strings, without having to do anything extra
<manumanumanu>no indexing structures, no wasted space.
<manumanumanu>the downside was of course that people had huge issues communicating with eachother, but to be frank: unicode only solved the superficial part of that problem
<leoprikler>which is "only the superficial part"?
<manumanumanu>leoprikler: it removed all the weird stuff that arose from people having different character encodings. As a species, however, we seem utterly incapable of understanding eachother...
<leoprikler>Well, true, but at which level do you stop when considering shallow vs. deep?
<leoprikler>My computer is able to talk to any Japanese computer without producing mojibake. Doesn't help me if I suck at Japanese tho.
<leoprikler>And even if both I and a person I talk to both fluently speak a language, there can still be misunderstandings [not least to the type 2 nature of human languages].
<manumanumanu>What I jokingly tried to imply was that it wouldn't matter if you knew japanese, the people you spoke to would still misunderstand
<manumanumanu>i should have added an emoji, but the interpretation possibilities of those seem endless.
<manumanumanu>Anyway: what are you guys up to?
<leoprikler>Misunderstandings at the human level can typically be resolved through effort, though 😉️
<leoprikler>still reading SRFI 207 comments
<leoprikler>tbh I'm not vibing that syntax at all
<manumanumanu>why not? It is just a simple extension of the already widely supported #vu8(...) syntax.
<manumanumanu>minus the v
<manumanumanu>I am mis-using parameters.
<manumanumanu>and macros.
<leoprikler>IIRC vu8 doesn't have string literals inside tho
<manumanumanu>Well #u8"A" is the same as #u8(65). It is the same as racket bytestrings, but with a slightly different reader syntax.
<leoprikler>u8"A" might be u8(65) in most most encodings, but in my hypothetical troll encoding, lower and upper case are swapped, so u8"A" is u8(97)
<manumanumanu>Meh. IIRC srfi-207 mandates ASCII-characters only, which sort of implies you would in your case be left with the bytevector syntax.
<leoprikler>srfi 210 has some nice things
<leoprikler>i like multiple values :)
<RhodiumToad>any of the gobject-introspection experts around and willing to answer an off-topic question, to whit: how do I stop g-ir-scanner from deleting its temp files on failure?
<leoprikler>GI_SCANNER_DEBUG=save-temps
<stis>Yeah scheme-python compiles and runs, quick as a fox to install
<RhodiumToad>leoprikler: thanks!
<manumanumanu>stis: ?
<stis>just the scheme part of python-on-guile
<stis>in a repo of its own
<stis> https://gitlab.com/tampe/scheme-python
<stis>doc: http://c-lambda.se/python-on-guile/
<stis>manumanumanu: ^^
<rekado>stis: for packagers does this mean that python-on-guile depends on scheme-python?
<manumanumanu>stis: great!
<stis>rekado: not for now, but I think that it is logical next step to take to avoid duplicating development
<manumanumanu>still can't get over the fact that the for loops are so... mutable. is there a reason you don't express them as a kind of fold? I guess it is a python thing.
<stis>it is a python thing, mutability is deep in the design
<stis>but if we can find a way to do it in another way then great
<manumanumanu>I will play with it and have a look. I just discovered foof-loop. It is amazing, and I believe it is at the very limits of what someone would want to express using syntax-rules :D
<stis>lol
<stis>yea foof loop is a great lib
<stis>hes the one behind ice-9 match
<stis>and also the fmt library
<manumanumanu>srfi-166 is my new favourite srfi.
<manumanumanu>irregex, show, foof-loop. r7rs small chair? He's amazing
<manumanumanu>stis: you should have a look at taylor campbell's syntax-rules implementation. it is madness
<manumanumanu>I am extending and changing it slightly, with support for racket-like subloops, but I am writing it procedurally with parameters to pass the syntax objects around.
<stis>cool
<manumanumanu>That way, we need explicit accumulators instead of (for a (listing ...)). Hopefully I can clean up the iterator protocol a bit
<manumanumanu>(for a (listing ...)) becomes (accumulate a (listing ...)).
<manumanumanu>good night.
<stis>looks ok, good night.