<sneek>daviid, str1ngs says: thanks will check this out ASAP. ***dsmith` is now known as dsmith
<dsmith>Ooo.. Sounds like 3.0.1 is immanent! ***apteryx is now known as Guest95484
***apteryx_ is now known as apteryx
<manumanumanu>civodul: there is a bug in how sxml handles CDATA. I submitted a guile patch, but it should probably be updated upstream. <manumanumanu>I did it just as an intellectual curiosity, so I didn't bother actually subitting it upstream <manumanumanu>Does anybody know of an rrb-tree fector for scheme or guile? I only know of "regular" fectors. I have read enough about them to be able to implement them myself, so I might give it a shot <manumanumanu>It passes the internat ssax tests, but I did not verify it more than just playing around with it. It is a rather straight-forward patch: IIRC I simply removed the handling of & from CDATA, which is the correct way to handle it anyway. The complexity of the patch comes from the changes to the test suite, which were NOT straight-forward to do since guile does not write out what went wrong or which test was <civodul>are you sure there's no upstream fix? <civodul>i'd rather avoid diverging from upstream <civodul>especially in a file that contains "upstream" in its name :-) <civodul>(it might be that there really isn't an "upstream" anymore) <manumanumanu>I'll shoot an email to oleg or whoever is in charge of the repo <civodul>manumanumanu: oh there's also this srfi-171 patch of yours that's still pending <civodul>i see you have a copyright assignment on file, great <dftxbs3e>hi! I'll ask again since this was unanswered, is it possible to launch services with shepherd while GNU Guix is running on top of another distro, say a minimal install of Gentoo with OpenRC? <civodul>i think that's the wrong channel :-) <civodul>but the short answer is yes, Shepherd is not Guix-specific <civodul>however, you'll have work to do to define your services <civodul>you won't be able to use the Guix System infrastructure <str1ngs>hello daviid, (gtk-application-get-active-window app) does not seem to work right if no active window exists. It should return NULL or in the case of scheme #f. You could test this by not calling activate and trying to open files. something like ./open.scm ./foo ./bar. if no default application is running or active window exists this will throw 'wrong-type-arg. For now I just catch 'wrong-type-arg and create a frame if needed. But <str1ngs>typically in C I would just use something like this. if (!gtk_application_get_active_window (GTK_APPLICATION (app))) { create frame here... } <civodul>(it's a recurring theme this week-end) <mbakke>any news on the ARM/AArch64 issues? <RhodiumToad>civodul: re. the sxml thing, I mentioned the bug on the supposed "upstream" sourceforge repo, but no response (not all that surprising since there had been no messages for 4 or so years) <civodul>mbakke: the ARM JIT issue is not fixed, but we can still --disable-jit <civodul>the AArch64 issue is "fixed" as a side effect of some other change <civodul>but the root cause may still be there <rekado>I’m confused about port encodings when using the web server. The port encoding of (current-output-port) is set to ASCII. Is it okay to set that to UTF-8 or will that lead to problems when sending responses to the client? <rekado>This is motivated by broken file name encoding when handling form data. <mwette>civodul: congrat's on the release ***jao is now known as Guest17867
<civodul>rekado: shouldn't it be a function of "content-encoding"? <rekado>civodul: content-encoding is for compression. Do you mean content-type? <rekado>content-type here is multipart/form-data <RhodiumToad>encoding could be different for each part, then, at least in theory <rndd>i have a question. A newbe one. Suppose I have a character that may be a member of the list, and if my character is a member, i need to know its index in list. How i can do such thing in guile? <RhodiumToad>list-index from srfi-1 seems like a good place to start? <RhodiumToad>though if you do this a lot, then maybe lists aren't the best data structure to use <rndd>RhodiumToad: maybe, i'm just practising new language. thanks, it seems list-index fits my needs <rekado>apart from the content-type: in the server handler I use “(open-file "ä" "ab")” and then write a bytevector to the file; the file that is created, however, is called “?”. <rekado>I’m ignoring whatever might come from the form. <rekado>I look at the current directory in a shell <rekado>there is a new file “?” when I run “ls” <RhodiumToad>ls will have an option to display file names with escapes for non-ascii characters, try it <rndd>RhodiumToad: sorry, maybe i dont understand, but when i enter example from manual "(list-index odd? '(2 4 6 9))" in repl, i get an error "In procedure car: Wrong type argument in position 1 (expecting pair): #<procedure odd? (_)>" <sirgazil>rndd: You need (use-modules (srfi srfi-1)) <rekado>rndd: run ,use(srfi srfi-1) frist <RhodiumToad>there's a list-index in base that isn't in the manual? <RhodiumToad>yeah, and it looks like it has a completely different calling convention <rndd>guys, where i can find source code of these moduls in guix& <RhodiumToad>ya, found it; ice-9 boot has a definition of (list-index l k) that just uses eq? for comparison <rekado>here’s a test case for a ’?’ file: <rekado>(import (web server)) (run-server (lambda _ (open-file "ä" "ab")) 'http) <rekado>after making a request to localhost:8080 you should have an empty ’?’ file. <RhodiumToad>what encoding is that a-umlaut in, though, when you typed it? <rekado>it seems to me that the default port encoding is set to ASCII inside the web server. <RhodiumToad>make sure you're not specifying any -q option to ls anywhere (e.g. via alias) <rekado>can someone else reproduce my little test case? <RhodiumToad>just (open-file "ä" "ab") should be a sufficient test <sirgazil>sneek: later tell rekado: I can't reproduce the problem. I get a file named ä. <rndd>guys! Assume i want return integer from function, how to do it in scheme? <sirgazil>Eh! There is no "Procedure" term in the Concept index?! <sirgazil>rndd: Example: (define (square x) (* x x)) <rndd>sirgazil: will read, thanks <sirgazil>The information about creating procedures is one of the parts of the manual I think is complicated for beginners. It starts with lambda instead of (define (name [arg1 [arg2 …]]) body ...) <mbakke>rekado: I also can't reproduce the umlaut example (using en_US.utf8 locale). <mbakke>what are good ways to serialize a sexp for transporting over the wire? scm->json-string from guile-json can not work with completely arbitrary sexps. <rekado>RhodiumToad: but it is not sufficient in my case. Just (open-file "ä" "ab") works fine. <sneek>Welcome back rekado, you have 1 message. <sneek>rekado, sirgazil says: I can't reproduce the problem. I get a file named ä. <rekado>(and visiting localhost:8080 with Icecat; haven’t tested any other client yet) <rekado>visiting with wget I do get a file named “ä”. <rekado>I wonder if perhaps icecat is running in a different locale… <mbakke>rekado: I get the umlaut also when using IceCat. <rekado>icecat runs with LANG set to en_US.UTF-8 <rekado>and it’s fine with a newly started icecat. I wonder if there’s something special about the way the former icecat instance was started. <rekado>gah, it’s much simpler… I ran my server in a pure Guix environment. This means that LANG was not set in the environment where the server ran. That’s all. <rekado>thanks everyone for trying to reproduce this! <civodul>rekado: ah yes, maybe that was content-type <civodul>perhaps (guix scripts publish) contains useful hints <civodul>i always forget what needs to be done <manumanumanu>civodul: thanks for the feedback! I will try to do it all within a week or two. <rndd>guys! how to return boolean from function? <civodul>the boolean values are #true and #false <civodul>but note that all Scheme values except #false have truth value <rndd>civodul: could you show an example? =) <rekado>rndd: (define (this-is-false) #false) <rekado>(define (this-is-also-true) #true) <rekado>these procedures both return a truthy value when called. <rndd>(define (this-is-false) #false) <rndd>rekado: ok, got it. thank you! <rndd>trying to get index of list argument (list-index (= 2) '(1 2 4)) ;; => Wrong type argument: #t. <rndd>dont really understand what is wrong <rekado>(= 2) is not a procedure, it’s a value <rekado>evaluate it in a REPL and you’ll see. <rekado>so what you’re actually trying to evaluate here is (list-index #t ’(1 2 4)) <rekado>you want a procedure that takes a single value as an argument and compares that with 2. <rekado>for example: (lambda (value) (= value 2)) <rekado>or after (import (srfi srfi-26)) you can do (cut = <> 2) <rndd>well, (list-index (lambda (value) (= value 2)) '(1 2 4)) is works =| <rndd>as i understand (list-index) takes values from list and put it inside procedure <rndd>well, thank you very much. <rekado>procedures that take a value and return either a truthy value or #false are called predicates. <rekado>in the manual this is often abbreviated as “pred”