Amorphous has quit [Read error: 110 (Connection timed out)]
Ched- has quit [Connection timed out]
Ched- has joined #ocaml
pango has joined #ocaml
authentic has joined #ocaml
palomer has joined #ocaml
<palomer>
so...hashtbl is mutable
<palomer>
anyone written a Hashtbl.map ?
<palomer>
or a Hashtbl.keys ?
jlouis has quit [Read error: 110 (Connection timed out)]
<palomer>
let hashtblkeys t = Hashtbl.fold (fun a _ c -> a :: c) t [];; <--if anyone is interested
seafood has joined #ocaml
ixdy has joined #ocaml
marmotine has quit ["Quitte"]
RobertFischer has joined #ocaml
netx has joined #ocaml
jbarbero has joined #ocaml
<jbarbero>
Hi! I am wondering how I would use Str.regexp to parse a string into a type (which is just a 20-tuple). What I am trying to do is parse in a 20-column csv into a tuple instead of a list.
seafood has quit []
netx has quit [Remote closed the connection]
orbitz has quit [Read error: 110 (Connection timed out)]
ixdy has quit [Read error: 104 (Connection reset by peer)]
ixdy has joined #ocaml
RobertFischer has quit []
netx has joined #ocaml
<flux>
well, there is no great way to do it (as there aren't great ways to manipulate 20-tuples), but you can extend this: Scanf.sscanf "1,2,3" "%[^,],%[^,],%[^,]" (fun a b c -> (a, b, c))
<ixdy>
the only other way I could really think of doing it involves converting a list to a tuple, which is both painful and inefficient
Snark has joined #ocaml
ygrek has joined #ocaml
seafood has joined #ocaml
<palomer>
how do open ExtLib in the toplevel?
vbmithr has joined #ocaml
<palomer>
detecting cycles in CFGs is no trivial task
palomer has quit [Read error: 110 (Connection timed out)]
dabd has joined #ocaml
filp has joined #ocaml
Linktim has joined #ocaml
ygrek has quit [Remote closed the connection]
gnilias has joined #ocaml
<gnilias>
Hello, how can I return a record from a function, if the type of the record is not in scope?
ygrek has joined #ocaml
authentic has quit [Read error: 113 (No route to host)]
<tsuyoshi>
where is the type?
<qwr>
gnilias: like { Foo.something = 42 } ?
jonafan_ has joined #ocaml
<gnilias>
qwr, I've tried that, it doesn't seem to work, it gives me a syntax error on the equals. The record that I am trying to create is an OptParse.Opt.t
<gnilias>
it works fine if I do "open OptParse.Opt" .. I just don't want to bring too many modules in scope...
<gnilias>
never mind :-) thanks for the help
<qwr>
gnilias: what it was?
ygrek has joined #ocaml
<gnilias>
qwr, sorry, I don't understand your question
* qwr
thinks, that the ModuleName.field should work, but did it?
jonafan has quit [Read error: 110 (Connection timed out)]
<gnilias>
ahh, now I got it :-)
<gnilias>
thanks, it works
<gnilias>
I was doing Opt.t.option_set rather than Opt.option_set
<qwr>
ah, ok
<mfp>
is this supposed to block? let ch = Event.new_channel () in ignore (Event.send ch 3); Event.sync (Event.receive ch)
<mfp>
hmm I guess receive & send block until the other end has been sync'ed too
jlouis has joined #ocaml
Ched- has quit [Remote closed the connection]
Ched- has joined #ocaml
<flux>
yes, it blocks
<flux>
and it is mighty annoying
bluestorm has joined #ocaml
LordMetroid has joined #ocaml
Yoric[DT] has joined #ocaml
szell has quit [Read error: 110 (Connection timed out)]
<Smerdyakov>
flux, it's not annoying. That's the CML semantics: rendezvous channels.
<Smerdyakov>
flux, in real CML, it's no problem, since asynchronous channels are easy to implement on top without appreciable overhead.
smimou has quit ["bli"]
tomh has joined #ocaml
<flux>
smerdyakov, without of with a separate thread of control?
<Smerdyakov>
flux, restate? (I think you had a typo.)
<flux>
without _or_ with..
<flux>
I can see (and I've done it) a buffering thread is simple to implement
<flux>
but would it be possible with guards and wraps too?
<flux>
a separate thread in ocaml would definitely be a too big resource to waste to just get asynchronous messaging
<flux>
in my opinion synchronous messaging is simpler to implement with asynchronous messages than vice versa, so I prefer the latter. perhaps you can point out how it isn't so.
<Smerdyakov>
Asynchronous messaging is a much better building block for a wider variety of services.
<Smerdyakov>
I was thinking of an implementation with a thread per synchronous channel, which is almost cost-free in Concurrent ML.
szell has joined #ocaml
authentic has joined #ocaml
<flux>
I actually have an Event-like module with asynchronous interfacing. it also supports closing channels, which allows to raise an exception when sending to one (mainly a debugging aid)
<flux>
but if one happens to send to a message to a synchronous channel which nobody is listening anymore, the thread gets stuck.
<Smerdyakov>
I hate the idea of closeable channels. It's taking a step back to the horrible word of manual UNIX resource management.
<flux>
I don't think it is
<flux>
because closing a channel doesn't really free anything
<flux>
it just tells the other end that it's an application logic error to send messages to this channel.
<flux>
so it's wholy optional.
<flux>
s/l/ll/
<Smerdyakov>
I don't like having to think about state.
<flux>
now that I think of it, though, I think there's a bug.. it is possible to close a channel that has messages waiting.
<flux>
hm, how can you not if you're sending messages?
<Smerdyakov>
My point is that you add extra state with this closed-ness.
<Smerdyakov>
In CML, processes waiting for events that can never happen are garbage collected.
<Smerdyakov>
That's a nice way for unneeded channels to go away.
<flux>
what happens to processes that want to send messages to channels nobody can receive from?
<flux>
(that gc-thingy is neat, though)
<Smerdyakov>
The same.
<flux>
hmm..
<flux>
but if the processes have other channels they can send messages to..
<Smerdyakov>
A process waiting for any event that can never happen is GC'd. This includes waiting in a send event.
<flux>
so the processes can't simply disappear
<Smerdyakov>
There is no GC'ing of processes simply for waiting on events that could be triggered by impossible sends, but that also have other, possible triggers.
<flux>
let's say I have n processes that each serve a connection over the network
<flux>
than I have a maintenance connection process, that passes messages from its clients to the aforementioned processes
<flux>
maintenance process gets a message "send message to abc123", and it retrieves a connection handle to the process somehow
<flux>
and then it tries to synchronize a message down the channel, but it never will because at that point the other process was removes (perhaps its connection was dropped)
<flux>
was removed, even
<Smerdyakov>
If "the other process was removed," then this should be reflected in the handle mapping.
<flux>
it would be removed at that point, but the handle could have been retrieved from the connection table before that
<Smerdyakov>
You can avoid that with proper synchronization.
<flux>
if the connection table process doesn't both maintain the table and pass messages to the connection processes, wouldn't it become a bit complex?
<flux>
perhaps the handle one gets from the connection table process would include a synchronized mechanism for passing down messages
<flux>
for me it just seems simpler to "retrieve handle, send message, oh I couldn't because it's already gone, well report error"
<Smerdyakov>
Processes shouldn't go away until they receive "OK to go away" messages from the manager.
<flux>
so would the connection table process also keep track of who can access its handles?
<Smerdyakov>
Alternatively, I would say the processes should never "go away;" they just start returning "I'm gone" message responses.
<flux>
such as messages "acquire handle" "release handle"
<Smerdyakov>
The manager can remove a process from the table when it gets "I'm gone," and that should lead to the process being GC'd.
<flux>
sometimes the processes should truly go away, I think. for example if the resource they are in charge of is eliminated from the system. (including databases, etc)
<flux>
of course, it is still one possible solution.. processes can be created, but not removed. doesn't seem quite perfect to me, though.
<Smerdyakov>
flux, no, I don't agree that processes should go away in that case.
<Smerdyakov>
flux, they just become "zombies" that always return "I'm gone."
<flux>
smerdyakov, but the sequence was: 1. process A acquires message channel from manager 2. process decides to die, sends a message to the manager 3. manager sends ack to process 4. process A attempts to send a message to the channel and gets stuck
<Smerdyakov>
That wouldn't happen. Processes always stick around long enough to reply to all messages.
<flux>
smerdyakov, I actually hadn't thought of that approach as a solution to this problem before this discussion, but actually these days I actually do have that approach, sort of
<Smerdyakov>
(Also, your original description was of messages to the sub-processes coming only from the network, which doesn't allow the scenario you just described.)
<flux>
of course, it would not be that great in ocaml, which doesn't gc threads that way
<flux>
I may have misrepresented the issue: the processes I am talking about are in the single operating system process, each (except manager) with their own external network connections, and then internal connections (to the manager)
<Smerdyakov>
It's quite possible to implement CML (with lightweight threads) with a monad in OCaml, though.
<flux>
that's very close what I have now, except it's asynchronous ;)
<flux>
+to
<flux>
but I have a capability to retrieve list of processes.. so atleast something has references to the tasks, and they won't get gc'd unless they explicitly exit. I need to think if that would be feasible to add, because it could be very convenient at times.
<flux>
wak arrays might do it
<flux>
weak, even
<flux>
hm, I hadn't noticed the Weak-module also featured hash tables. not perhaps in a very useful form, though, perhaps it's useful for merging non-identical (physically) but equal strings together.
<flux>
soo, ocaml-java reached version 1.0. pretty interesting, although I'm not much of a java-guy.
love-pingoo has joined #ocaml
comglz has joined #ocaml
Linktim has quit [Remote closed the connection]
Linktim has joined #ocaml
bzzbzz has joined #ocaml
<flux>
heh, this must be what the guy was asking for: <g1615o$jj8$1@aioe.org>
comglz has quit ["Lost terminal"]
ixdy has quit [Read error: 104 (Connection reset by peer)]
<mqtt>
Hi everyone. Could someone have a look at this code and tell me why it isn't well typed? It seems really weird : http://hpaste.org/8173
<bluestorm>
mqtt:
<bluestorm>
because "type 'a t" defines an abstract type
<bluestorm>
that is, once you forced the signature T on a module, the types get abstracted and isn't accessible from the outside anymore
<bluestorm>
if you want to overcome this limitation, you can say :
<bluestorm>
module A : T with type 'a t = 'a list = struct ...
<bluestorm>
this will "make public" the 'a t declaration, and thus allow you to do your unification outside the module
<mqtt>
oh ok! you're right, i'm gonna try this
<mqtt>
thank you!
<bluestorm>
(but you don't have an abstact type anymore, wich is useful and meaningful in some situations : hiding the type representation is actually good most of the times)
<mqtt>
here not really. The "with type ..." was exactly what i was looking for.
hsuh has joined #ocaml
dabd has quit [Read error: 110 (Connection timed out)]
ixdy has joined #ocaml
smimou has quit ["bli"]
hsuh has quit [Read error: 110 (Connection timed out)]
rwmjones has quit ["Closed connection"]
dabd has joined #ocaml
palomer has joined #ocaml
mqtt has quit [Read error: 113 (No route to host)]
dabd has quit [Read error: 110 (Connection timed out)]
jedai has joined #ocaml
ixdy has quit [leguin.freenode.net irc.freenode.net]
Mr_Awesome has quit [leguin.freenode.net irc.freenode.net]
mbishop has quit [leguin.freenode.net irc.freenode.net]
pattern has quit [leguin.freenode.net irc.freenode.net]
mattam has quit [leguin.freenode.net irc.freenode.net]
svenl has quit [leguin.freenode.net irc.freenode.net]
ikatz has quit [leguin.freenode.net irc.freenode.net]
acatout has quit [leguin.freenode.net irc.freenode.net]
mbishop has joined #ocaml
acatout has joined #ocaml
svenl has joined #ocaml
mattam has joined #ocaml
ixdy has joined #ocaml
Mr_Awesome has joined #ocaml
pattern has joined #ocaml
ikatz has joined #ocaml
ixdy has quit [Connection reset by peer]
ikatz has quit [leguin.freenode.net irc.freenode.net]
Mr_Awesome has quit [leguin.freenode.net irc.freenode.net]
pattern has quit [leguin.freenode.net irc.freenode.net]
RobertFischer has joined #ocaml
Mr_Awesome has joined #ocaml
pattern has joined #ocaml
ikatz has joined #ocaml
ixdy has joined #ocaml
jedai has quit [No route to host]
Snark has quit ["Ex-Chat"]
ixdy has quit [leguin.freenode.net irc.freenode.net]
ikatz has quit [leguin.freenode.net irc.freenode.net]
Mr_Awesome has quit [leguin.freenode.net irc.freenode.net]
pattern has quit [leguin.freenode.net irc.freenode.net]
ixdy has joined #ocaml
Mr_Awesome has joined #ocaml
pattern has joined #ocaml
ikatz has joined #ocaml
ixdy has quit [Connection reset by peer]
ixdy has joined #ocaml
shortcircuit has quit [leguin.freenode.net irc.freenode.net]
gim has quit [leguin.freenode.net irc.freenode.net]
mlh has quit [leguin.freenode.net irc.freenode.net]
fremo has quit [leguin.freenode.net irc.freenode.net]
shortcircuit has joined #ocaml
gim has joined #ocaml
mlh has joined #ocaml
fremo has joined #ocaml
<palomer>
so hot!
mlh has quit [Remote closed the connection]
mlh has joined #ocaml
tomh has joined #ocaml
palomer has quit [leguin.freenode.net irc.freenode.net]
LordMetroid has quit [leguin.freenode.net irc.freenode.net]
bluestorm has quit [leguin.freenode.net irc.freenode.net]
struk|busy has quit [leguin.freenode.net irc.freenode.net]
jeremiah has quit [leguin.freenode.net irc.freenode.net]
xevz has quit [leguin.freenode.net irc.freenode.net]
TaXules has quit [leguin.freenode.net irc.freenode.net]
gildor_ has quit [leguin.freenode.net irc.freenode.net]
palomer has joined #ocaml
LordMetroid has joined #ocaml
bluestorm has joined #ocaml
struk|busy has joined #ocaml
jeremiah has joined #ocaml
xevz has joined #ocaml
TaXules has joined #ocaml
gildor_ has joined #ocaml
gildor_ has quit [leguin.freenode.net irc.freenode.net]
palomer has quit [leguin.freenode.net irc.freenode.net]
LordMetroid has quit [leguin.freenode.net irc.freenode.net]
bluestorm has quit [leguin.freenode.net irc.freenode.net]
xevz has quit [leguin.freenode.net irc.freenode.net]
TaXules has quit [leguin.freenode.net irc.freenode.net]
struk|busy has quit [leguin.freenode.net irc.freenode.net]
jeremiah has quit [leguin.freenode.net irc.freenode.net]
palomer has joined #ocaml
LordMetroid has joined #ocaml
bluestorm has joined #ocaml
struk|busy has joined #ocaml
jeremiah has joined #ocaml
xevz has joined #ocaml
TaXules has joined #ocaml
gildor_ has joined #ocaml
gildor_ has quit [leguin.freenode.net irc.freenode.net]
palomer has quit [leguin.freenode.net irc.freenode.net]
LordMetroid has quit [leguin.freenode.net irc.freenode.net]
bluestorm has quit [leguin.freenode.net irc.freenode.net]
xevz has quit [leguin.freenode.net irc.freenode.net]
TaXules has quit [leguin.freenode.net irc.freenode.net]
struk|busy has quit [leguin.freenode.net irc.freenode.net]
jeremiah has quit [leguin.freenode.net irc.freenode.net]
palomer has joined #ocaml
LordMetroid has joined #ocaml
bluestorm has joined #ocaml
struk|busy has joined #ocaml
jeremiah has joined #ocaml
xevz has joined #ocaml
TaXules has joined #ocaml
gildor_ has joined #ocaml
gildor_ has quit [leguin.freenode.net irc.freenode.net]
palomer has quit [leguin.freenode.net irc.freenode.net]
LordMetroid has quit [leguin.freenode.net irc.freenode.net]
bluestorm has quit [leguin.freenode.net irc.freenode.net]
xevz has quit [leguin.freenode.net irc.freenode.net]
TaXules has quit [leguin.freenode.net irc.freenode.net]
struk|busy has quit [leguin.freenode.net irc.freenode.net]
jeremiah has quit [leguin.freenode.net irc.freenode.net]
palomer has joined #ocaml
LordMetroid has joined #ocaml
bluestorm has joined #ocaml
struk|busy has joined #ocaml
jeremiah has joined #ocaml
xevz has joined #ocaml
TaXules has joined #ocaml
gildor_ has joined #ocaml
gildor_ has quit [leguin.freenode.net irc.freenode.net]
palomer has quit [leguin.freenode.net irc.freenode.net]
LordMetroid has quit [leguin.freenode.net irc.freenode.net]
bluestorm has quit [leguin.freenode.net irc.freenode.net]
xevz has quit [leguin.freenode.net irc.freenode.net]
TaXules has quit [leguin.freenode.net irc.freenode.net]
struk|busy has quit [leguin.freenode.net irc.freenode.net]
jeremiah has quit [leguin.freenode.net irc.freenode.net]
palomer has joined #ocaml
LordMetroid has joined #ocaml
bluestorm has joined #ocaml
struk|busy has joined #ocaml
jeremiah has joined #ocaml
xevz has joined #ocaml
TaXules has joined #ocaml
gildor_ has joined #ocaml
RobertFischer has quit []
gildor_ has quit [leguin.freenode.net irc.freenode.net]
palomer has quit [leguin.freenode.net irc.freenode.net]
LordMetroid has quit [leguin.freenode.net irc.freenode.net]
bluestorm has quit [leguin.freenode.net irc.freenode.net]
xevz has quit [leguin.freenode.net irc.freenode.net]
TaXules has quit [leguin.freenode.net irc.freenode.net]
struk|busy has quit [leguin.freenode.net irc.freenode.net]
jeremiah has quit [leguin.freenode.net irc.freenode.net]
palomer has joined #ocaml
LordMetroid has joined #ocaml
bluestorm has joined #ocaml
struk|busy has joined #ocaml
jeremiah has joined #ocaml
xevz has joined #ocaml
TaXules has joined #ocaml
gildor_ has joined #ocaml
gildor_ has quit [leguin.freenode.net irc.freenode.net]
palomer has quit [leguin.freenode.net irc.freenode.net]
LordMetroid has quit [leguin.freenode.net irc.freenode.net]
bluestorm has quit [leguin.freenode.net irc.freenode.net]
xevz has quit [leguin.freenode.net irc.freenode.net]
TaXules has quit [leguin.freenode.net irc.freenode.net]
struk|busy has quit [leguin.freenode.net irc.freenode.net]
jeremiah has quit [leguin.freenode.net irc.freenode.net]
palomer has joined #ocaml
LordMetroid has joined #ocaml
bluestorm has joined #ocaml
struk|busy has joined #ocaml
jeremiah has joined #ocaml
xevz has joined #ocaml
TaXules has joined #ocaml
gildor_ has joined #ocaml
gildor_ has quit [leguin.freenode.net irc.freenode.net]
palomer has quit [leguin.freenode.net irc.freenode.net]
LordMetroid has quit [leguin.freenode.net irc.freenode.net]
bluestorm has quit [leguin.freenode.net irc.freenode.net]
xevz has quit [leguin.freenode.net irc.freenode.net]
TaXules has quit [leguin.freenode.net irc.freenode.net]
struk|busy has quit [leguin.freenode.net irc.freenode.net]
jeremiah has quit [leguin.freenode.net irc.freenode.net]
palomer has joined #ocaml
LordMetroid has joined #ocaml
bluestorm has joined #ocaml
struk|busy has joined #ocaml
jeremiah has joined #ocaml
xevz has joined #ocaml
TaXules has joined #ocaml
gildor_ has joined #ocaml
rwmjones has joined #ocaml
smimou has joined #ocaml
Axioplase has joined #ocaml
<hcarty>
palomer: Here as well
thelema has joined #ocaml
ahf has quit [Client Quit]
gildor_ has quit [leguin.freenode.net irc.freenode.net]
palomer has quit [leguin.freenode.net irc.freenode.net]
LordMetroid has quit [leguin.freenode.net irc.freenode.net]
bluestorm has quit [leguin.freenode.net irc.freenode.net]
xevz has quit [leguin.freenode.net irc.freenode.net]
TaXules has quit [leguin.freenode.net irc.freenode.net]
struk|busy has quit [leguin.freenode.net irc.freenode.net]
jeremiah has quit [leguin.freenode.net irc.freenode.net]
palomer has joined #ocaml
LordMetroid has joined #ocaml
bluestorm has joined #ocaml
struk|busy has joined #ocaml
jeremiah has joined #ocaml
xevz has joined #ocaml
TaXules has joined #ocaml
gildor_ has joined #ocaml
ygrek has quit [Remote closed the connection]
Jedai has joined #ocaml
ixdy has quit [leguin.freenode.net irc.freenode.net]
ikatz has quit [leguin.freenode.net irc.freenode.net]
Mr_Awesome has quit [leguin.freenode.net irc.freenode.net]
pattern has quit [leguin.freenode.net irc.freenode.net]
ixdy has joined #ocaml
Mr_Awesome has joined #ocaml
pattern has joined #ocaml
ikatz has joined #ocaml
ixdy has quit [Remote closed the connection]
ixdy has joined #ocaml
thelema has quit [Read error: 110 (Connection timed out)]
Jedai has quit [leguin.freenode.net irc.freenode.net]
gildor_ has quit [leguin.freenode.net irc.freenode.net]
palomer has quit [leguin.freenode.net irc.freenode.net]
LordMetroid has quit [leguin.freenode.net irc.freenode.net]
bluestorm has quit [leguin.freenode.net irc.freenode.net]
xevz has quit [leguin.freenode.net irc.freenode.net]
TaXules has quit [leguin.freenode.net irc.freenode.net]
struk|busy has quit [leguin.freenode.net irc.freenode.net]
jeremiah has quit [leguin.freenode.net irc.freenode.net]
Jedai has joined #ocaml
palomer has joined #ocaml
LordMetroid has joined #ocaml
bluestorm has joined #ocaml
struk|busy has joined #ocaml
jeremiah has joined #ocaml
xevz has joined #ocaml
TaXules has joined #ocaml
gildor_ has joined #ocaml
rwmjones has quit ["Closed connection"]
Linktim has quit [Remote closed the connection]
dabd has joined #ocaml
authentic has quit [Remote closed the connection]
authentic has joined #ocaml
LordMetroid has quit [Read error: 110 (Connection timed out)]