gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
dnolen has joined #ocaml
mnabil has quit [Ping timeout: 240 seconds]
tauntaun has quit [Quit: Ex-Chat]
arubin has joined #ocaml
mo3b1us has joined #ocaml
<EM03> someone mind helping me read ocaml docs?
<thelema> which doc
<EM03> val connect : string -> string -> string -> string -> int -> int
<EM03> what exactly is this saying?
<thelema> takes 4 strings and one integer and returns an integer
<EM03> so the last thing is the return?
<thelema> well, if you give it one string, it returns (string -> string -> string -> int -> int)
<EM03> how can you tell?
<thelema> each -> is a return (technically), but in the simplest sense, you're right, the final value is the return type
<thelema> s/value/type/
<EM03> ok
tauntaun has joined #ocaml
<EM03> reading docs is everything for me :P
<_habnabit> Every function is unary. You can just call successive functions easily!
<_habnabit> You could think of the -> chain as being right-associative.
<EM03> cool cool
<EM03> you would be surprised how reading docs can really make you productive
<EM03> i want to become really productive with ocaml
<EM03> does ocaml have a bright future?
<EM03> it seems like the inria with bigloo scheme sorta put it on the backburner
joko has quit [Ping timeout: 248 seconds]
schmrkc has quit [Ping timeout: 250 seconds]
sepp2k1 has quit [Quit: Leaving.]
mo3b1us has quit [Quit: Lost terminal]
tauntaun has quit [Quit: Ex-Chat]
schmrkc has joined #ocaml
schmrkc has quit [Read error: Operation timed out]
schmrkc has joined #ocaml
kerx has joined #ocaml
npouillard has quit [Ping timeout: 248 seconds]
smerz has quit [Quit: Ex-Chat]
npouillard has joined #ocaml
myu2 has quit [Remote host closed the connection]
tauntaun has joined #ocaml
lopex has quit []
joewilliams is now known as joewilliams_away
cthuluh has quit [Read error: Operation timed out]
arubin has quit [Quit: arubin]
lamawithonel has joined #ocaml
vivanov has joined #ocaml
tauntaun has quit [Quit: Ex-Chat]
myu2 has joined #ocaml
metasyntax has quit [Ping timeout: 248 seconds]
metasyntax has joined #ocaml
joewilliams_away is now known as joewilliams
kmicinski_ has joined #ocaml
Associat0r has quit [Quit: Associat0r]
ulfdoz has joined #ocaml
vivanov has quit [Quit: leaving]
vivanov has joined #ocaml
Yoric has joined #ocaml
joewilliams is now known as joewilliams_away
sgnb has quit [Remote host closed the connection]
sgnb` has joined #ocaml
dnolen has quit [Quit: dnolen]
Cyanure has joined #ocaml
myu2 has quit [Remote host closed the connection]
myu2 has joined #ocaml
philtor has quit [Ping timeout: 255 seconds]
dnolen has joined #ocaml
kmicinski_ is now known as kmicinski
Cyanure has quit [Remote host closed the connection]
ulfdoz has quit [Ping timeout: 250 seconds]
philtor has joined #ocaml
myu2 has quit [Read error: Connection reset by peer]
dnolen has quit [Quit: dnolen]
ygrek has joined #ocaml
Snark_ has joined #ocaml
Snark_ is now known as Snark
Yoric has quit [Quit: Yoric]
myu2 has joined #ocaml
kmicinski has quit [Read error: Connection reset by peer]
philtor has quit [Ping timeout: 255 seconds]
<kerx> why are there no good published books on ocaml?
edwin has joined #ocaml
<vivanov> Jason Hickey
<vivanov> his book is pretty good
<vivanov> but not published yet -- u re right
Pepe_ has quit [Ping timeout: 252 seconds]
ygrek has quit [Ping timeout: 246 seconds]
ygrek has joined #ocaml
Pepe_ has joined #ocaml
Yoric has joined #ocaml
Pepe_ has quit [Ping timeout: 276 seconds]
Pepe_ has joined #ocaml
Oejet has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
eye-scuzzy has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
avsm has joined #ocaml
eye-scuzzy has quit [Quit: leaving]
eye-scuzzy has joined #ocaml
ikaros has joined #ocaml
ygrek has joined #ocaml
HoraseLunums has joined #ocaml
_andre has joined #ocaml
rup has quit [Remote host closed the connection]
Oejet has quit [Read error: Connection reset by peer]
Oejet has joined #ocaml
korya has quit [Ping timeout: 246 seconds]
korya has joined #ocaml
ftrvxmtrx has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
boscop has joined #ocaml
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 276 seconds]
ftrvxmtrx_ is now known as ftrvxmtrx
kerx has quit [Read error: Connection reset by peer]
kerx has joined #ocaml
HoraseLunums has quit [Remote host closed the connection]
vivanov has quit [Read error: No route to host]
kerx_ has joined #ocaml
mnabil has joined #ocaml
rup has joined #ocaml
kerx has quit [Ping timeout: 248 seconds]
sepp2k has joined #ocaml
Oejet1 has joined #ocaml
Oejet has quit [Ping timeout: 276 seconds]
clog has quit [Ping timeout: 248 seconds]
clog has joined #ocaml
ounit has joined #ocaml
<ounit> how can i check with ounit if my testprogram raises an assert?
kerx__ has joined #ocaml
<flux> it's an exception
<flux> I would imagine it has a way for checking raised exceptions
lamawithonel has quit [Remote host closed the connection]
<gildor> ounit: assert_fail ?
<gildor> assert_raises in fact
<gildor> or you want to catch the fact that one assert of ounit has failed ?
lopex has joined #ocaml
<gildor> (i.e. assert_equal has failed and you want to know it)
ounit has quit [Ping timeout: 246 seconds]
ounit has joined #ocaml
<ounit> any idea about how to test with ounit for a raised assert
kerx_ has quit [Ping timeout: 246 seconds]
rup has quit [Ping timeout: 246 seconds]
<gildor> ounit: you can go through the result list and check the status of a particular test
lamawithonel has joined #ocaml
ounit has quit [Ping timeout: 246 seconds]
rup has joined #ocaml
Associat0r has joined #ocaml
HoraseLunums has joined #ocaml
HoraseLunums has quit [Remote host closed the connection]
mnabil has quit [Ping timeout: 250 seconds]
dnolen has joined #ocaml
dnolen has quit [Excess Flood]
mnabil has joined #ocaml
dnolen has joined #ocaml
eelte has joined #ocaml
avsm has quit [Ping timeout: 248 seconds]
vivanov has joined #ocaml
vivanov_ has joined #ocaml
vivanov_ has quit [Client Quit]
mnabil has quit [Ping timeout: 240 seconds]
vivanov has quit [Ping timeout: 250 seconds]
vivanov has joined #ocaml
avsm has joined #ocaml
<vivanov> i am inserting inner lock into a hash table - what data structure to choose: module vs record? are there any performance penalties and how do people usually do ?
mnabil has joined #ocaml
<thelema> vivanov: inner lock = per-entry locking?
vivanov has quit [Ping timeout: 252 seconds]
vivanov has joined #ocaml
mnabil has quit [Ping timeout: 252 seconds]
<thelema> vivanov: inner lock = per-entry locking?
<vivanov> yes
<vivanov> per every operation
<thelema> you're going to lock the whole table per operation?
mnabil has joined #ocaml
<thelema> if so, I don't understand your question about module vs. record
<thelema> maybe it's just clear to me that a module is much more clearly the right option for a locking hashtable
<vivanov> yeah -- i did that with a module
<vivanov> and was thinkking bout other options
<vivanov> with a module that works just fine
<mrvn> The question makes no sense. If you use a module what do you put into that mdoule then? If you need a record then in the module you still need the record.
<thelema> mrvn: well, you could use a tuple, but that's just a record without named
<mrvn> All the module does is put the type and functions into a different namespace.
<thelema> *names
myu2 has quit [Remote host closed the connection]
<mrvn> thelema: sure. tuple vs record makes sense.
<mrvn> 'module M = struct type t = int * int end' and 'type t = int * int' are quite equivalent other than the namespace issue.
<thelema> mrvn: actually, modules are very similar to records in implementation
<vivanov> http://pastebin.com/w3s6waTw -- thats what i have now
myu2 has joined #ocaml
<mrvn> thelema: do you mean the new local modules?
<vivanov> record is a better option?
<mrvn> vivanov: why not just use Mutext.t as is?
<vivanov> what do u mean?
<gildor> vivanov: you should not use a simple lock
<gildor> vivanov: but a rw-lock
<mrvn> vivanov: why do you need a functor over LockSig?
<vivanov> so that for each hash table ill create a separate lock and functions locking and unlkocking the lock each time
<vivanov> for each hash tbl ill create a separate module
<gildor> vivanov: if you need to operate for each table, you should put the code into the create function of the hashtabl
<thelema> vivanov: separate module? eww.
<mrvn> vivanov: the way to do that is to 1) create the Mutex when creating the hashtbl or 2) require one as argument
<gildor> you don't need separate module
<thelema> vivanov: I agree with gildor
<thelema> and mrvn
<vivanov> :)
<mrvn> How does the functor even give you seperate locks?
er98052 has joined #ocaml
<mrvn> What if you create 2 hashtbl with the same LockSig module?
<vivanov> with different
<mrvn> or 10 or 100?
<thelema> mrvn: I think each instantiation of a functor gives you a new module
<thelema> even if it's instantiated with the same module as input
mnabil has quit [Ping timeout: 255 seconds]
<mrvn> thelema: doen't it just have references to the input module?
<mrvn> "Mutex.lock L.lock" should lock the same mutex if the input L was the same.
<thelema> mrvn: yes, for this code, where the lock itself (not the whole lock module) is passed in, you're right
<vivanov> ok -- so what i should do is : 1) implement this data structure as record 2) add a create function that creates the record with a lock already ?
<thelema> I didn't look at the code and expected him to have passed in Mutex itself as a paremeter and had a global variable in his locking_hashtable module (another not-so-good implementation)
<vivanov> thelema : yeah - i have it like that
rwmjones has quit [Read error: Operation timed out]
<thelema> vivanov: one module for locking_hashtable, no functor, just pass in the mutex as a parameter to [create]
<mrvn> virtuoso: type ('a,'b) dict = { lock:Mutex.t; dict : ('a,'b) Dict.t; } let create x y z ... = { lock = Mutex.create (); dict = Dict.create x y z ... } or something
<thelema> keep that mutex with the hashtable as a pair (or a record)
<mrvn> vivanov: type ('a,'b) dict = { lock:Mutex.t; dict : ('a,'b) Dict.t; } let create x y z ... = { lock = Mutex.create (); dict = Dict.create x y z ... } or something
<mrvn> vivanov: replace_first should use lock_wrap and lock_wrap should catch all exceptions, unlock and reraise.
cthuluh has joined #ocaml
<mrvn> vivanov: or are you 100% sure all wrapped functions are exception free?
<vivanov> mrvn: no not sure
<mrvn> I would guess find throws Not_found for example.
<vivanov> ok -- ill cope with excveptions like u said
<mrvn> vivanov: I think you also have to handle Dict.find_all returning [] in replace_first.
<mrvn> # List.tl [];;
<mrvn> Exception: Failure "tl".
<mrvn> in line 51
<vivanov> mrvn: yes i see -- ure rigth
avsm has quit [Quit: Leaving.]
<vivanov> mrvn: still trying to undestand the implementation u suggested - should i put the replace_first, add, find_all functions in the record? : type ('a,'b) dict = { lock:Mutex.t; dict : ('a,'b) Dict.t; create : ... ; add: ...
mnabil has joined #ocaml
<thelema> vivanov: no, just the lock and the hashtable
ygrek has joined #ocaml
<vivanov> and still use the functor to create new modules working specifically with the hashtbl and the lock?
<mrvn> no
<mrvn> try that with ls to see if it usualy works
<mrvn> args. not my day.
<mrvn> vivanov: let lock_wrap lock func x = Mutex.lock x.lock; let res = func x.dict in ...
rwmjones has joined #ocaml
<flux> remember exceptions
<vivanov> flux : ok
<mrvn> flux: scroll up
<vivanov> mrvn : so i wont use module for that at all -- ill just define functions that work with the record. let add_lock x y z = lock_wrap add ... ;; let find_all_lock x y = lock_wrap find_all;; ...
<mrvn> vivanov: yes. but why add _lock suffixes?
<vivanov> mrvn: right? i wont need functors&modules for that
<vivanov> mrvn: ok i see- - i wont
<vivanov> thanks very much for your help -- ill do all that now
<mrvn> compare the strace output with the one from ls. In ls you had "open("/usr/lib/fakechroot/libfakechroot.so", O_RDONLY) = 3". But with sbin/ldconfig that wasn't there.
<mrvn> args
avsm has joined #ocaml
Cyanure has joined #ocaml
myu2 has quit [Remote host closed the connection]
myu2 has joined #ocaml
myu2 has quit [Remote host closed the connection]
lluvia has joined #ocaml
<lluvia> I'm having this problem running my ocaml program in a machine with a mipsel architecture:
<lluvia> Fatal error: unknown C primitive `caml_obj_add_offset'
<lluvia> I don't know what to do for avoid this problem
myu2 has joined #ocaml
<fx_> you are compiling on the same machine?
<lluvia> nop
<fx_> what are the versions on both machines?
<lluvia> they have different architectures
<lluvia> I didn't think at it, I think
<fx_> bytecode executables need same version of runtime installed
<fx_> or use -custom
<fx_> ehm, are you crosscompiling for mipsel??
<lluvia> I have re-taken this program since a long time ago, I have it a bit forgotten
<lluvia> I'm not sure
<lluvia> I'll try to recompile it from this machine
<fx_> simply ensure that ocaml version installed on development and target machines match
<lluvia> aha
<fx_> add_offset was added in 3.12.0, so your development ocaml is probably newer then target
<lluvia> my current version is 3.10
<lluvia> surely I had a very current ocaml version of ocaml when I compiled it
ygrek has quit [Remote host closed the connection]
<lluvia> yes
<lluvia> thanks :)
<lluvia> you are an ace
Associat0r has quit [Quit: Associat0r]
lluvia has left #ocaml []
wchicken3 has quit [Read error: Connection reset by peer]
philtor has joined #ocaml
<EM03> does ocaml have a really good and strong standard library?
<EM03> or is that what batteries included is for?
<gildor> EM03: the OCaml stdlib is ok for a lot of small tasks
<gildor> EM03: and to start OCaml
<EM03> I'm just trying to do web dev
<EM03> using ocamlnet with scgi
<gildor> EM03: but on the long term, you'll appreciate batteries/janest-core
<gildor> EM03: begin by something very simple, all datastructure provided in stdlib should be enough for basic webdev
<EM03> gildor: how long you been using ocaml for?
<gildor> EM03: something like 10 years
<EM03> oh nice
<EM03> I used it pretty heavily in 05
<EM03> the best period and most fun I ever had in programming
<EM03> web programming in PHP is boring me heavily
avsm has quit [Quit: Leaving.]
parsetree has joined #ocaml
ChristopheT has joined #ocaml
joewilliams_away is now known as joewilliams
Yoric has quit [Quit: Yoric]
<ChristopheT> Students, please have a look to our ideas pages for the GSoC on https://forge.ocamlcore.org/plugins/mediawiki/wiki/gsoc-team/index.php/GSoC2011/Applying
eelte has quit [Quit: 0x2a]
<thelema> ChristopheT: hmm, one of the requests for Amanar (inline unit testing) is something that batteries just added
parsetree has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
<thelema> hmm, or maybe not - the PAI for Amanar to interact with the tested software is diffferent... just the inline tests
emmanuelux has joined #ocaml
Yoric has joined #ocaml
myu2 has quit [Remote host closed the connection]
rup has quit [Ping timeout: 246 seconds]
mnabil has quit [Ping timeout: 260 seconds]
rup has joined #ocaml
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
myu2 has joined #ocaml
myu2 has quit [Remote host closed the connection]
ftrvxmtrx has quit [Quit: Leaving]
yezariaely has joined #ocaml
yezariaely has left #ocaml []
myu2 has joined #ocaml
mnabil has joined #ocaml
smerz has joined #ocaml
er98052 has quit [Quit: er98052]
enthymeme has joined #ocaml
ygrek has joined #ocaml
Oejet1 has quit [Read error: Connection reset by peer]
Oejet has joined #ocaml
myu2 has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
_andre has quit [Quit: leaving]
Snark has quit [Quit: Ex-Chat]
Julien__T has joined #ocaml
willb has joined #ocaml
boscop has quit [Ping timeout: 255 seconds]
joewilliams is now known as joewilliams_away
tauntaun has joined #ocaml
boscop has joined #ocaml
boscop has quit [Read error: Connection reset by peer]
boscop has joined #ocaml
boscop_ has joined #ocaml
boscop has quit [Read error: Connection reset by peer]
boscop_ has quit [Excess Flood]
boscop_ has joined #ocaml
Oejet has quit [Ping timeout: 276 seconds]
boscop__ has joined #ocaml
boscop has joined #ocaml
boscop_ has quit [Read error: Connection reset by peer]
boscop__ has quit [Ping timeout: 240 seconds]
boscop_ has joined #ocaml
mnabil has quit [Ping timeout: 250 seconds]
boscop has quit [Ping timeout: 248 seconds]
boscop__ has joined #ocaml
boscop__ has quit [Read error: Connection reset by peer]
boscop_ has quit [Ping timeout: 255 seconds]
boscop__ has joined #ocaml
kmicinski has joined #ocaml
BiDOrD has quit [Read error: Operation timed out]
mnabil has joined #ocaml
<flux> soo, would the new ocsigen give me a neat way to have a dialog-like popup in a page, or do I still need to write that myself?-) (possibly in javascript)
philtor has quit [Ping timeout: 255 seconds]
edwin has quit [Remote host closed the connection]
boscop__ has quit [Ping timeout: 255 seconds]
seafood has joined #ocaml
sysop_fb has joined #ocaml
mnabil has quit [Ping timeout: 246 seconds]
HoraseLunums has joined #ocaml
HoraseLunums has quit [Remote host closed the connection]
Associat0r has joined #ocaml
lopex has quit [Ping timeout: 250 seconds]
lopex has joined #ocaml
fraggle_ has quit [Ping timeout: 264 seconds]
ulfdoz has joined #ocaml
BiDOrD has joined #ocaml
myu2 has joined #ocaml
BiDOrD has quit [Ping timeout: 250 seconds]
BiDOrD has joined #ocaml
tauntaun has quit [Quit: Ex-Chat]
seafood has quit [Ping timeout: 260 seconds]
BiDOrD has quit [Read error: Operation timed out]
boscop__ has joined #ocaml
boscop__ is now known as boscop
ygrek has quit [Remote host closed the connection]
BiDOrD has joined #ocaml
ChristopheT has left #ocaml []
Julien__T has quit [Ping timeout: 260 seconds]
fraggle_ has joined #ocaml
drunK has joined #ocaml
<mfp> flux: AFAIK oclosure can be used with oclosure, which gives you access to Google Closure' widgets, including http://closure-library.googlecode.com/svn/trunk/closure/goog/demos/dialog.html
<mfp> erm oclosure can be used with _the latest Ocsigen version_
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
kmicinski_ has joined #ocaml
kmicinski has quit [Ping timeout: 252 seconds]
philtor has joined #ocaml
BiDOrD has quit [Quit: No Ping reply in 180 seconds.]
BiDOrD has joined #ocaml
myu2 has quit [Remote host closed the connection]
boscop has quit [Ping timeout: 255 seconds]
Yoric has quit [Quit: Yoric]
lopex has quit [Ping timeout: 276 seconds]
<adrien> I'm starting to dislike weak references
ikaros has quit [Quit: Leave the magic to Houdini]
lopex has joined #ocaml
willb has quit [Ping timeout: 240 seconds]
willb has joined #ocaml
myu2 has joined #ocaml
myu2 has quit [Remote host closed the connection]