jcreigh has quit [Read error: 110 (Connection timed out)]
er has quit []
shawn_ is now known as shawn
Smerdyakov has quit ["Leaving"]
slipstream-- has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
piggybox has left #ocaml []
<flux__>
now, one can write:
<flux__>
class a = object method foo = () end class b = object inherit a method bar = () end let foo (a : a) = () let bar (a : < foo : unit; .. >) = ()
<flux__>
and make a call like foo (new a)
<flux__>
foo (new b) will fail
<flux__>
bar (new a) and bar (new b) both succeed
<flux__>
is there a way to write a function that takes 'all of a plus ..'?
Submarine has joined #ocaml
<flux__>
without spelling out all the methods
Sir_Diddymus has joined #ocaml
<pango>
foo (new b :> a) works
<flux__>
well, yes
<flux__>
but my point was to make that trick to the function definition
<flux__>
if one is not going to make an alias (let a' = (a :> a)), which can be confusing to the reader, calling function always with foo (z :> a) .. seems a bit taxing and redundant :)
<flux__>
and the type system itself appears to allow functions that can take objects with more methods than required
<flux__>
it is just that for some reason that isn't the default
<flux__>
performance reasons maybe?
__DL__ has joined #ocaml
<flux__>
actually I was hoping for some syntax like let z (a : < #a; .. >) = () but that doesn't work :)
<pango>
let z (a : < foo: _; .. >) = ()
<flux__>
hey, that's nice
<flux__>
now I need to iterate only the methods I use which is much less of a bother :)
<flux__>
thanks!
<flux__>
and for the .mli I can still use the interface generator of ocamlc
_jol_ has joined #ocaml
Tachyon76 has joined #ocaml
smimou has joined #ocaml
_jol_ has quit ["leaving"]
__DL__ has quit [Remote closed the connection]
<ski>
flux__ : 'let foo (a : #a) = ()' ?
<ski>
you want to enforce that the methods in 'a' is present (with right types), but don't disallow there being more methods present (and visible, instead of explicitely hidden with ':> a' in each call) ?
Submarine has quit ["Leaving"]
Submarine has joined #ocaml
Narrenschiff has joined #ocaml
pango is now known as pangoafk
pangoafk is now known as pango
bluestorm has joined #ocaml
_jol_ has joined #ocaml
_jol_ has quit ["leaving"]
ski_ has joined #ocaml
ski has quit [Nick collision from services.]
ski_ is now known as ski
Submarine has quit [Killed by Idoru. (Sorry, tor connections to freenode are temporarily blocked due to abuse.)]
descender has quit ["Why has elegance found so little following? Elegance has the disadvantage that hard work is needed to achieve it and a good e]
dbueno has joined #ocaml
<dbueno>
I have a file Foo.mli for which I'd like to write multiple implementations. If I wrote Foo1.ml, is there something I can put in it to make ocamlc know that it should conform to the Foo.mli module type?
er has joined #ocaml
<dylan>
well, if you used a functor...
<dbueno>
dylan: without creating a nested module... (I'm coming from SML/NJ-land)
zagzig has joined #ocaml
er has quit []
Submarine has joined #ocaml
mikeX has joined #ocaml
er has joined #ocaml
er has quit []
<pango>
a symlink :)
<pango>
I was thinking of using "include", but don't see how to make it work with 'separate compilation modules'
<pango>
dbueno: maybe like this: define your common module signature somewhere, say in signature.ml:
<pango>
module type FooSig = sig ... end
<pango>
then in foo.mli and foo1.mli, just put 'include Signature.FooSig'
Smerdyakov has joined #ocaml
er has joined #ocaml
er has quit [Client Quit]
Schmurtz has joined #ocaml
er has joined #ocaml
<Smerdyakov>
Anyone submitting to the ML workshop this year?
<dbueno>
pango: I wasn't aware of include; thanks.
descender has joined #ocaml
mattam has quit [Read error: 104 (Connection reset by peer)]
mattam has joined #ocaml
bluestorm has quit [Read error: 113 (No route to host)]
bluestorm has joined #ocaml
_jol_ has joined #ocaml
Revision17 has joined #ocaml
pango is now known as pangoafk
mikeX has quit ["later"]
pangoafk is now known as pango
dbueno has quit ["Leaving"]
Sir_Diddymus has quit [Read error: 110 (Connection timed out)]
er has quit []
er has joined #ocaml
bluestorm has quit [Remote closed the connection]
Revision17 has quit [Read error: 104 (Connection reset by peer)]
finelemon has joined #ocaml
Schmurtz has quit ["Plouf !"]
Revision17 has joined #ocaml
_jol_ has quit ["co'o"]
finelemo1 has quit [Read error: 110 (Connection timed out)]
finelemo1 has joined #ocaml
finelemon has quit [Read error: 110 (Connection timed out)]
bluestorm has joined #ocaml
mikeX has joined #ocaml
<flux__>
ski, thanks, that's exactly what I was looking for, but the syntax was something I missed
<ski>
np
er has quit []
cyyoung has joined #ocaml
cyyoung has quit ["Leaving"]
cyyoung has joined #ocaml
Narrenschiff has quit [Read error: 104 (Connection reset by peer)]
er has joined #ocaml
cyyoung has quit ["Leaving"]
zagzig has left #ocaml []
<er>
is there a way to communicate b/w processes in ocaml?
<er>
eg. by defining a memory region that's shared between processes?
<Submarine>
not directly
<Submarine>
you can use threads, though
<smimou>
but it will be useless on an SMP...
<Submarine>
yes
<er>
there's a REALLY nice function in the Unix library called "establish_server"
<er>
which lets you implement a concurrent TCP server in 3 lines of code
<er>
but the problem is that there's no way of sharing state across connections
<dylan>
I find using a postgres database a nice way around that.
<dylan>
Not a very... efficient way, but, ahem...
<er>
hm. hold on, what would happen if the connection-handling function were to be a closure with a ref argument...
<dylan>
nothing, processes live in different address spaces.
<er>
right
<er>
*grumble*
<er>
and there's no mmap in the Unix library
<dylan>
use a database for shared state? :)
<flux__>
you could have a process that marshals messages in and out..
<flux__>
but it will not be trivial
<pango>
there's a mmap module in the cdk
<er>
flux__: that's my ad-hoc solution
<Submarine>
well... mmap is difficult to use with caml
<Submarine>
the parallel version of Astrée is a bit dodgy
<flux__>
establish_connection, as it is, is not very easy to use for real servers
<er>
pango: thanks for the info. *looking*
<flux__>
maybe if there was an easy-to-use message passing primitive that would work between processes, something like the Event-module
<Submarine>
marshalling...
<flux__>
well, writing a process that uses non-blocking in_channel/out_channel and marshalling can be a challenge..