<middayc>
will there be any videos of at least sound recording + slides after event on web?
Snrrrub__ has quit [Read error: 110 (Connection timed out)]
<middayc>
I would love to see the lecture about Ocsigen
ygrek has joined #ocaml
postalchris has quit [Connection timed out]
thermoplyae has joined #ocaml
bluestorm has quit [Remote closed the connection]
<ttamttam>
I think they are trying to. Would be nice.
<ttamttam>
rwmjones: same answer as middayc for me
ttamttam has left #ocaml []
jderque has joined #ocaml
postalchris has joined #ocaml
<middayc>
great.. if you make videos or sound a conference can be so more "useful" ... I am still looking various such videos from conferences from years back
<cap>
middayc, where can i find those?
marmottine has joined #ocaml
jderque has quit [Read error: 113 (No route to host)]
<Snrrrub>
Can someone confirm this: two functions in the same module cannot refer to each other (unless they're using that syntax that I can't remember off the top of my head) whereas two functions in different modules can?
hkBst has quit ["Konversation terminated!"]
<pango>
I don't confirm
<pango>
functions from different modules can't refer directly to each other
<Snrrrub>
They have to use the module name (and the functions must be exposed through their respective modules' interface)
<pango>
you can only refer to things defined earlier, and modules can't both be defined before the other (short of using the experimental simultaneous and recursive modules definitions)
<Snrrrub>
Ah, so there's an order imposed on module order too.
<Snrrrub>
...module loading order
<Snrrrub>
The issue I'm having is the following: I have two functions that maintain shared state - one that updates the state variable and the other that maps the state to a function. The returned functions, however, need to update the state so I have a circular dependency. I'm not sure how one deals with that
<pango>
modules do not only contain code, but values too; The semantic of module linking/loading is that it's the same as if their content was evaluated; You can't use values before they're evaluated; Hence there's an other on modules.
<pango>
s/other/order/
<pango>
if you can define both in the same module, you can use simultaneous definitions, putting the shared value in their environment (closures)
<pango>
but that's just one way... I'm not sure what your problem really is
<Snrrrub>
Yes, I've done that. Let me give some pseudo-code that shows what the issue is. I'm just going to pastebin it.
postalchris has quit [Read error: 110 (Connection timed out)]
<Snrrrub>
the issue, though, is that my_handler and my_other_handler refer to set_state while get_handler refers to the handlers
<Snrrrub>
but I can't lexically separate set_state and get_handler
middayc has quit []
<Snrrrub>
Would it be better to create a class initialized with the handlers?
<pango>
never used OCaml's OO, so I can't tell
<pango>
it doesn't look much different
<Snrrrub>
Hmmm, okay, thanks. I'm just starting out with OCaml so, honestly, I'm not confident with any solution I might come up with.
Nutssh has quit [Read error: 104 (Connection reset by peer)]
Tetsuo has quit ["Leaving"]
Associat0r has quit []
kryptt has quit [Read error: 110 (Connection timed out)]
dramsay has quit ["Leaving"]
<bluestorm>
Snrrrub:
<bluestorm>
if you want to keep the circular depency, you can use mutually recursive functions
<bluestorm>
(that "syntax that i can't remember")
<bluestorm>
let rec foo = .... and bar = ...
<bluestorm>
("and" is the key to mutuality)
<bluestorm>
on the other hand you could break it by passing some of the functions as parameters to others
<Snrrrub>
Yeah, but I'd like to distribute the handlers to different modules at some point in time which precludes that solution.
seafood_ has joined #ocaml
<bluestorm>
hm
<Snrrrub>
bluestorm, hmm, that's a good point. For some reason, until you mentioned it, I always thought (for some unknown reason) that it would create more mutable state but it doesn't have to be mutable at all.
<bluestorm>
i'm afraid the situation is a bit too abstract know, i don't really see the intended use
<Snrrrub>
Basically I have an event loop. I have key/mouse handlers. I'm using a function to return the appropriate handlers to the event loop based on which page I'm on.
<Snrrrub>
Think of a wizard: press "n" to go to the next page, press "b" to go to previous page. So each page has different handlers but I don't want the event loop to worry about that state information.
<bluestorm>
(urgh, s/know/now/)
<bluestorm>
Snrrrub: isn't that equivalent to "one event loop per page" ?
thermoplyae has left #ocaml []
<Snrrrub>
Yes, except I don't want to rewrite the event loop and I'm not sure how to prevent that if I have an event loop per page...
<pango>
maybe Ocsigen design (continuation-based web framework) could give you some ideas... http://www.ocsigen.org/
Yoric[DT] has quit [Remote closed the connection]
<pango>
(mmmh I think older documentation version was easier to grasp)
kelaouch1 has joined #ocaml
<jonafan>
so can you guys think of any way to make an irc client with a gui that doesn't involve shared mutable data between UI and socket threads?
<Smerdyakov>
You can do anything in the pi calculus style, as you can simulate mutable variables and many other patterns.
<jonafan>
that's awfully vague
kelaouchi has quit [Read error: 110 (Connection timed out)]
bluestorm has quit ["Konversation terminated!"]
<jonafan>
is it really possible? i don't understand how you can make these two threads communicate with each other
<jonafan>
at times, the UI thread must be able to alter the way data coming from the socket is displayed
<Smerdyakov>
Do you know anything about message passing, like pi calculus, CML, the Event module of the OCaml Threads library, etc.?
<jonafan>
i'll look into the event module
<jonafan>
interesting...
kmeyer has quit [Remote closed the connection]
<jonafan>
tell me if i'm dumb: 1 thread listens to UI, 1 thread listens to socket, a 3rd thread listens for events from both?
kmeyer has joined #ocaml
<Smerdyakov>
That's one way of doing it.
<Smerdyakov>
You really want to be doing this with lightweight threads, so that you can create thousands without trouble, associating one with each logical variable, etc..