<leoprikler>can we do something about the name tho? fash sounds a little fashy <dokma>I'm having issues posting to this channel. Can anyone see this? <sneek>dokma, lfam says: With Guix, install the gcc-toolchain package in order to compile things by hand <dokma>Back to my issue. I'm trying to figure out how to shutdown a server started by run-server from the repl module. <dokma>I don't see any way to do it from the source. <dokma>I've embedded the repl into my C++ app and it works as expected. But I cannot shut it down. <dokma>I have tried (stop-server-and-clients!) from the repl but all it does is it closes my current repl session and I can connect right back in. In other words, run-server is still running. <dokma>leoprikler: it just closes my current repl session. <dokma>It doesn't stop run-server. I can connect right back. <dokma>I suppose that there should be a way to shutdown the repl server properly without killing the C++ host? <leoprikler>I think you need to run stop-server-and-clients! on the server side somehow, but I'm not sure whether that power is handed to every connecting repl <leoprikler>it also shuts down if you somehow find the port and close it, apparently <leoprikler>Perhaps the comment in L38 hints at the culprit tho <leoprikler>or no, the server-socket is probably never closed, because it's not in open-sockets <leoprikler>well, nope, it's the first to be added to *open-sockets* <dokma>leoprikler: I've implemented a C++ function that I can call from the repl. <dokma>I can call stop-server-and-clients! from there. <dokma>But I don't see how that would make a difference as opposed to just calling it from the repl. <leoprikler>I'm not sure, but the server might think you no longer care about the evaluation if your client exits and thus stop early <dokma>leoprikler: I totally didn't understand this last line <dokma>I'm a scheme noob. Just for the record. <leoprikler>Try to do good ol' printf debugging in stop-server-and-clients! <leoprikler>in particular make it spit out the sockets it closes on your server <leoprikler>apparently the server socket is also closed when you throw sigint on the server side <dokma>Can I throw sigint from the repl? <leoprikler>you have a guile repl, you can probably get shell access through it too <dsmith>leoprikler: "fash the stampede" ? <sandwich>i'm writing some procedures in c to use as callbacks. i want them to share local variables without having a userdata pointer passed. in scheme, i could just use closures. but what do I do here? i could just make wrapper procedures in scheme that use closures and pass the local variable to the c functions, is that the best way? <ArneBab>Please let us NEVER EVER do something like Python3. I just lost another important local tool, because I have no time to convert it to py3 and cannot easily run it with py2, because it’s started with a custom runner. <ArneBab>It’s never OK to push work onto maintainers — many useful tools have exactly zero maintainers. <dokma>leoprikler: (kill (getpid) SIGINT) works! This is the only way to stop the server from the repl for now. <dokma>Is this a clean shutdown though? <leoprikler>dokma probably not, but you're one step closer to understanding what's going on, hopefully <dokma>leoprikler: if I understand correctly accept is called with call-with-sigint so wouldn't SIGINT simply stop accept from waiting for a new connection? <dokma>I'll try debugging to see if control returns to C++. <dokma>leoprikler: the server socket is there just to accept new connections no? <dokma>If I do (kill (getpid) SIGINT) from the last active repl it seems to be a clean shutdown to me. Will do some tests. <leoprikler>sure, but the server socket is the thing that doesn't get closed by you report <dokma>leoprikler: it wasn't getting closed by calling (stop-server-and-clients!) or (close-port port). ***rt is now known as robin
<dokma>I've never seen this in Scheme. But I've been learning Scheme for only the past week. <dokma>leoprikler: are you still here? <leoprikler>oh, this is a variant of cond that takes whatever the condition evaluates to (unless it's #f) and passes it on to a procedure <ft>Yeah, the right hand side of the arrow must evaluate to a procedure and the result of the test is passed to it and the result of that application is the result of the cond. <ft>The same thing exists for case. <dokma>I've never seen it. Is that some recent addition or? <dokma>Is that arrow some special syntactic sugar or just a symbol that gets passed to cond? <ft>I'm pretty sure it's been in Guile for a while. Not sure if it's part of the standard. <dokma>Thanks a bunch guys. You're really helping me out. <ft>It's in r7rs, and I bet in previous versions too. <dokma>But I supposed that => is nothing special syntax wise? Just a symbol the goes into cond ? <dokma>leoprikler: it's a special token? <leoprikler>meaning it has a special meaning and can't be used as a symbol in that context <dokma>leoprikler: outside of that context? <ft>It's in r5rs too, at least for cond. Can't see it in case's description in it. But I just skimmed the document. <dokma>So it's not some special token recognized everywhere. Just in cond <dokma>leoprikler, ft: well if what you guys told me is true and if I understand stop-server-and-clients! correctly it will never close the server socket because it closes a socket only if there is a pair of them. Since the server-socket is the first one added, it will never be closed by this function? <dokma>server-socket should actually be the first one to get closed <dokma>pushes new sockets to the front of the list <dokma>So I can't figure out why (kill (getpid) SIGINT) shuts the server down but stop-server-and-clients! doesn't. <dokma>After (stop-server-and-clients!) from the repl the server-socket is still opened and I can connect back in. <leoprikler>which is why I hypothesize, that stop-server-and-clients! erroneously exits early <daviid>vijaymarupudi: did you see my yesterday's msg, i pushed a fix ... <vijaymarupudi>daviid: I did, thank you! I responded but it looks like IRC bugged out. <vijaymarupudi>Basically, I can't seem to figure out how to get and use TreePath <daviid>you need to set-cursor ... see the gtk manual .. for cursor i mean <daviid>vijaymarupudi: GtkTreePath is an opaque struct, not an object <daviid>you need to set-cursor, so that get-cursor returns, right in that descrption you pasted ... try to ask for help or example on #gtk maybe? <vijaymarupudi>This might be a misconception on my part, will get back to you <vijaymarupudi>daviid: I think this might be a bug, here's a fairly equivalent Python program. If you observe stdout, you can see that it prints the TreePath and focus_column to stdout, but the g-golf version always prints false. <vijaymarupudi>Make sure you click on some of the treeview entries to see the events happen <chrislck>hmm I think there's a nested fold in here <manumanumanu>chrislck: I would use the colloquial "good" flatten (which is a tree fold) <manumanumanu>which happens to be what you shold use instead of all the ugly flatten versions out there using append. <manumanumanu>chrislck: and of course I didn't read longer than my own nose. You solved it yourself :) <manumanumanu>go search for "flattening a list in scheme" and all solutions you find will use append. <daviid>sneek: later tell vijaymarupudi ok, will look into the problem and let you know ... <daviid>sneek: later tell vijaymarupudi both paste you posted 'privetely' expired (but no problem, i know what/where to look at the problem,tx) - <leoprikler>for the record, i think your version might not do proper tail recursion <leoprikler>(foldts (const '()) (lambda (s0 s1 t) (append s1 s0)) xcons <list>) should only have call depth tree depth + 1, IIUC fold correctly <manumanumanu>daviid: well, you wrote that after I sent you mine and gave you the permission to do whatever you wanted with it, iirc :) <manumanumanu>leoprikler: which for guile means faster, since no reverse at the end. <manumanumanu>the largest problem with it is that it accepts improper lists without complaint <leoprikler>idk if Guile's map is a right fold, it's probably implemented in C and I don't have the C code here atm <manumanumanu>yup. I had a look at it recently when fixing vector-map/for-each in the r6rs module <manumanumanu>And I'm pretty sure (as in: I know) that it is a right fold. <manumanumanu>in C it could not be, of course, since it would stack overflow unless you start doing voodoo. <manumanumanu>there is a much nicer version of map in the r6rs module. The boot-9 version relies on (length ...) to check that the list is proper. <daviid>manumanumanu: yes :) i quoted 'mine' because while pasting now, i didn't remember who helped me at the time, butichecked and i did thank you in the commit msg 537e8cc12fe2f3095f065084ea2b9376d548b6e6 - i pasted because you said 'all scheme versions 'out there' use append' ... but it's all yours :) <daviid>manumanumanu: yeah,but i like to thank who helpsmeinmy logs ... sorry i didn't mention your name here 'now' ... <manumanumanu>I would like to be the kind of guy that just lets that slip :( <manumanumanu>It is a moral obligation to be the best you can be, and I lapse constantly :D :D <manumanumanu>I like to read other people's "collected stuff that might be good to have". <sneek>vijaymarupudi, you have 2 messages! <sneek>vijaymarupudi, daviid says: ok, will look into the problem and let you know ... <sneek>vijaymarupudi, daviid says: both paste you posted 'privetely' expired (but no problem, i know what/where to look at the problem,tx) -