IRC channel logs
2021-08-12.log
back to list of logs
<jgart>> Return a newly created fluid, whose initial value is DFLT... <vijaymarupudi>dflt stands for default, which represents the value it will otherwise be initialized to if you provide it <jgart>maybe that should be changed to default instead of dflt to avoid confusion for others giving it a quick read <jgart>I can send a patch if it makes sense <jgart>I don't think dflt is standard <jgart>I thought it meant something more technical than default <jgart>like some acronym or something <jgart>I think it would only help new readers of the docs <daviid>sneek: later tell vijaymarupudi '... Stop wasting time and just exit alread.'- you should, however, keep track and unref instances if your app 'consumes' and 'releases' many instances while running ... <vijaymarupudi>daviid: While I acknowledge that cleanup is not necessary for simple examples, that was where I expected this kind of information to be presented, that I would have to cleanup <sneek>vijaymarupudi, you have 1 message! <sneek>vijaymarupudi, daviid says: '... Stop wasting time and just exit alread.'- you should, however, keep track and unref instances if your app 'consumes' and 'releases' many instances while running ... <vijaymarupudi>daviid: Besides, I feel one of the advantages of Scheme is that I don't have to think about cleanup too often, it's just cognitive load I'd rather not deal with. And I think with guardians and a gc-hook, it's possible to automate it in Guile! <jgart>can anybody recommend some high level async library for guile 3.0? <jgart>something that doesn't require creating sockets at a lower level <jgart>is there such a thing currently for guile 3.0? <jgart>daviid, have you used it before? <jgart>do happen to know if it's production ready more or less? <daviid>no, i perso didn't, but imo very production ready, and fwiw, it uses g-golf for the version that offers the event loop based on GLib ... <daviid>jgart: which you don't need (g-golf), unless you want to, guile-a-sync3 has other event loop(s) <civodul>hey apteryx! it's blocking if the port is in blocking mode (which is the case by default) <apteryx>Hello! oh, a non-blocking port. That's news to me, I'll read on it; thank you! <civodul>in short, non-blocking i/o is not very useful if you don't use it together with something like Fibers <apteryx>hmm, I see. It's in the context of an event loop that is already using select on the file descriptors to know if there's something to read, so I guess I could do with blocking calls on the fds that are ready to read? <vijaymarupudi>One problem I see there is if there is no newline in the incoming stream, then get-line will block until there is one <civodul>apteryx: in that case you can select on that port and only call get-line on it when select told you there's data available to read <apteryx>OK. get-line would still block when there's no newline in the available data to read, as vijaymarupudi hinted at, right? <apteryx>indeed; and scm_getc blocks when there's nothing to be read? <muradm>today i had an issue which i couldn't get <muradm>(define lst1 '(#f #t #f)) (apply or lst1) <muradm>this does not works, apply can't apply or? <ft>‘or’ can't be implemented as a function, since it has different semantics (short-circuit), so you can't hand it to apply. <ft>But you can use ‘any’ from srfi-1 to do something like that: (any identity lst1) <muradm>is there anything that can be used in stead of (apply or lst1)? currently i came up with this, but it looks dirty https://paste.rs/m9c <ft>Like I said, ‘any’ can do something like that. <muradm>another question, (string-tokenize ...) takes token_set, there is no example and explaination is not clear what should go there, i want to split string on "\n" only <apteryx>It seems like implementing a non-blocking get-line is non trivial? I'd have to use seek + peek-char (I think), and seek is lseek in my case (file descriptor) so the offsets are in bytes while I'm interested in characters. So I'd have to wrap my head around the encoding used and decode the raw data. <apteryx>muradm: I think it takes a character set, so (char-set #\newline) if I'm not mistaken <ft>Maybe just string-split in that case. <muradm>(string-tokenize does trim also in one step, but (split-string then (map trim also possible, i will try both, thanks <apteryx>for string-tokenize you'd have to use (char-set-complement (char-set #\newline)) <muradm>ah... string-tokenize trims only the token_set char, not as default call to trim <muradm>(split-string them (map trim should be more clean <muradm>is there something like "is list empty" or better "is list not empty"? <apteryx>I guess for my "non-blocking" get-line, I'll just read-char, dump everything available to a string, keep the result in a global variable attached to the file descriptor and post-process it locally. <apteryx>the goal is to have every line of a child process output prefixed by some information <yoctocell>muradm: there is null? for checking if a list is empty <vijaymarupudi>You can just search for the ascii newline byte in the bytevector read from a port <vijaymarupudi>if there is one, combine with buffer contents and emit a line <vijaymarupudi>If there is not one, add to the buffer, and then suspend until next read <vijaymarupudi>You can do this because in utf-8, all multi-byte characters have a 1 in the highest bit of their bytes <atka>hi guile, how do I use ice-9 debug? <atka>or how do I activate it? <atka>I don't have debug.scm listed in .guix-profile/share/guile/3.0/ice-9/ <atka>ok, looks like I can just use ,trace