freenode/#clim - IRC Chatlog
Search
9:43:22
beach
s/Function should/The function should/ (singular nouns usually take an article in English)
9:52:51
jackdaniel
that is the problem - it is not specified. That's what I want to address. A convenient (to me) interpretation would be: wait-function is called before we try to get an event, then we try to read event from a display server (with a timeout), during this time port may but doesn't have to (because it may block), call wait-function and if we timeout, we check the wait-function again
9:53:27
jackdaniel
in pseudocode it would be: (or (funcall wait-function) (read-event-from-display-server :timeout timeout) (funcall wait-function))
9:56:07
jackdaniel
as of why would there be no need for processing the next event -- if we already have events in the queue, then we don't need to source the next event
9:56:38
jackdaniel
but when we run in single-threaded mode, it is called from event-queue protocol functions
9:58:28
jackdaniel
I've meant by that: try to read from a display server (i.e from a socket) - potentially blocking operation
9:59:57
jackdaniel
i.e event-queue-read-with-timeout (this is part of internal McCLIM protocol used to implement sheet input mixins)
10:02:28
beach
And what does "at least" refer to? Does it mean that it can be invoked in other situations as well?
10:04:54
jackdaniel
by invoked by the port I mean: backend may call it at its own discretion when it tries to read the event (that's also an answer to the "at least" question) -- i.e when we process events passed from clx not all result in "clim event" being created, but the read unblocks, so we may check if wait-function returns T and return early
10:06:57
jackdaniel
timeout is either NIL (then there is no timeout), or a number of seconds after which we should give up if no event is read
10:12:43
beach
I think the original "the predicate should wait until..." lead me to believe that the wait-function waits.
10:13:43
jackdaniel
I think you've came to the same conclusion with regard of wait-function purpose (given your annotation in the original specification)
10:16:16
jackdaniel
the backend is supposed to implement a method which is specific to its inner workings
10:17:12
jackdaniel
as I've said, backend implements a method for process-next-event, so it "receives" the wait-function when the function is called
10:18:35
beach
And what about "the port"? Is that the same thing as the backend, which is the same thing as the method on process-next-event?
10:19:33
beach
So, maybe "is called by the port" should be "is called by the port-specific method on this generic function"?
10:19:49
jackdaniel
maybe I should replace "the port" references with "a backend".. port is a protocol class and it represents a logical connection to a display server
10:21:21
jackdaniel
it may be called by some other function which is called from a method on this generic function. would "called by the backend" be more clear? or still we should write "by the port-specific method"?
10:27:25
beach
You really need to work on your singular nouns. I suggest you re-read whatever you write, look at each singular noun, and make sure it has an article. Proper nouns don't take articles, so you can remove "the" in "If THE wait-function.." because wait-function is a proper noun here.
10:28:38
jackdaniel
how should I phrase that wait-function may be called while reading the event (i.e before timeout)
10:29:39
beach
You can't say "while reading" because that suggests that the wait-function is doing the reading. So it would be a "dangling participle". Let me think...
10:30:33
jackdaniel
maybe "wait-function may be called more times while the process-next-event method tries to read the next event."
10:37:27
jackdaniel
OK, then I will integrate it into the specification and make a pull request. Thank you for going through this with me.
10:40:55
jackdaniel
interesting fact: in silica process-next-event did *not* have a wait-function parameter
10:45:18
jackdaniel
I'll also include the last paragraph from the original spec: "A port implementation must provide a method for this function …"