IRC channel logs


back to list of logs

<bobbejaantje>I don't know much about unix domain sockets, but is there a way to have a socket where process A is listening on as a server, process B sends character data to which process A handles and then later 'responds' to whichB then recognizes as a response to that message in guile?
<bobbejaantje>While in the mean time A may have done the same with other processes to determine what response to send?
<bobbejaantje>Ideally just something like a function (listen-socket ...) which would return a pair, the message and some id and (respond-socket id response) would return a response to that specific id over the socket
<bobbejaantje>And on the other send B would just use something like (talk-to-server msg) and get the response as return of that function call which can block indefinitely until the response has been delivered
<amz3`>IIUC what you are describing is sockets, you just don't know it yet ;à
<zaquest>bobbejaantje, just make process A assign and id to the message, and process B send response with that same id.
<bobbejaantje>zaquest, I can't parse what you just write
<bobbejaantje>Or do you mean 'assign an id'
<zaquest>yes, sorry
<bobbejaantje>so unix domain sockets can dot his easily?
<bobbejaantje>Like ensure that the response goes back to whatever sends th emessage and keeping it clear what response is to wht message?
<zaquest>bobbejaantje, that's up to your application. include id in the message from A, and make B put the same id in the response. in that case A will know to exactly what message B is replying
<bobbejaantje>Ahh, okay
<bobbejaantje>so the socket itself only sees 'to' and 'from'
<zaquest>yes, it's 2 streams (in/out) of bytes (for tcp) or 2 streams of packets for datagrams
***micro` is now known as Guest52887
***Guest52887 is now known as micro_
<sapientech1>hi all, is there a reason guilers don't use foof-loop in there code? i think it is pretty cool, but not sure if i should use it if no one else does :/
<alezost>well, I think someone does :-) But it's probably not so popular as it is not a part of Guile
<sapientech1>alezost: thanks for getting back :) curious whether some people don't use it cause its hard to debug or slow, or something
<daviid>playing with the MOP, I found out that our '8.11.6 Customizing Class Definition' example fails: this example of a custom def for compute-get-n-set calls (make-closure-variable), which is not only not exported from goops.scm, but has arity 2 and calls an other inner procedure, class-slot-init-value, rendering this unusable for this example anyway
<daviid>so, to patch, I need to define make-closure-variable, here is what I came up with
<daviid> which does not work, obviously, because (make-closure-variable) always uses the var created at compile time: how do I solve this?
<daviid>no need to know goops to answer my quiz :) just read the lines 10 -> 13 of the above paste: how to make things so that (make-undefined-variable) is called at every execution of (make-closure-variable), and the result 'grabbed' so I can use it in subsequent lambda ...
<amz3`>I'm playing with biwascheme to get started with scheme in the browser, if you are interested you can find the result of my experiment in this thread!topic/biwascheme/URurpsiLrr0
<stis>daviid: I don't understand. the variable is created at each executoin of make-closure-variable
<stis>when do you need to create it?
<daviid>stis: I don't think so, but then could you try: save thye module some wghere and import it, then execute what is in the comment
<daviid>(make-closure-variable) is called every 10's instance creation, as an example of a mop usage, so that this closure 'slot variable' is shared among 10 instances ...
<avoine>amz3`: that is indeed the coolest way to do client side programming. have you experiment with scheme -> javascript compiler?
<avoine>I'm asking because I was searching on reactive programming in the web and found this:
<stis>ahh ok
<avoine>I can't really read haskell but it looks like the same code is use on server and client side
<daviid>stis: you may add pk and check for yourself the var is the compiled time var
<janneke>amz3`: how does that work?
<janneke>do you need a patched browser?
<stis>yah, used in define-class
<avoine>janneke: no, it's a scheme interpreter written in javascript
<daviid>stis: I don't understand your comment, it has nothing to do with define-class?
<stis>which for defines the var object then
<janneke>avoine: ah
<stis>which sexp
<daviid>stis: forget about goops for this moment, how do I 'force' (make-closure-variable) to create a new var at all incantation?
<stis>it does create a var at each evaluation of (amke-closure-varable)
<daviid>stis, no
<daviid>stis: not sure now :) added pk and slot-ref returns the same var, would that be a bug in another part of this example maybe
<stis>I though that the (make-closure-varible) would be executed in the making of each each class
<stis>note that you have an o in the argument, that is the object where you shouhlhd place the var
<stis>you can make a hash associatoin between the o and the var if you want to keep it outside of the object
<stis>but that is ineffective
<daviid>stis: let's focus on the exact example: every 10 instances, #:batched allocated slots should share the same value
<stis>(if (
<amz3`>avoine: I did not experiment with javascript -> scheme compiler yet
<stis>daviid compute-get-n-set is evaluated only once
<stis>probably at the class generation using the metaclass
<daviid>hum, I've been driven on a wrong road by the definition of this problem I think: compute-get-n-set is not called at instance creation, but at class creation time, hence (make <class-using-batched-slot> does not increase batch-allocation-count and all instances share the same variable... this example probably never worked
<stis>yes thats my analysis as well after trying a few pk's
<daviid>stis: yep, this example never worked, I'll think about this and re write it
<stis>fun anyways
<daviid>stis: thanks for your help
<daviid>yes, fun
<stis>hmm maybe initialize generic could be used
<daviid>stis: yes, this problem can't be solved by specializing compute-get-n-set, it has to be done at instance allocation time
<kori>hey! I can't find any guides or similar on how to write bindings for libraries in C
<kori>is there anything like that?
<daviid>kori: read the manual, 6.20.6 Dynamic FFI, and grab an exaple, there are tons of exampoles on the web of guile C libraries bindings ..
<kori>daviid: alright cool thanks
<daviid>here is one example for a start ...