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
tauntaun has joined #ocaml
Oejet has quit [Ping timeout: 276 seconds]
SoftTimur has left #ocaml []
arubin has joined #ocaml
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
drunK has quit [Remote host closed the connection]
ztfw has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
myu2 has quit [Remote host closed the connection]
lopex has quit []
joewilliams_away is now known as joewilliams
joewilliams is now known as joewilliams_away
tauntaun has quit [Quit: Ex-Chat]
eye-scuzzy has joined #ocaml
arubin has quit [Quit: arubin]
enthymeme has joined #ocaml
myu2 has joined #ocaml
smerz has quit [Quit: Ex-Chat]
eye-scuzzy has quit [Quit: leaving]
eye-scuzzy has joined #ocaml
philtor has quit [Quit: Ex-Chat]
philtor has joined #ocaml
ulfdoz has joined #ocaml
philtor has quit [Ping timeout: 240 seconds]
myu2 has quit [Remote host closed the connection]
myu2 has joined #ocaml
vk0 has quit [Read error: Connection reset by peer]
vk0 has joined #ocaml
vk0 has quit [Read error: Connection reset by peer]
vk0 has joined #ocaml
vk0 has quit [Read error: Connection reset by peer]
Cyanure has joined #ocaml
vk0 has joined #ocaml
vk0 has quit [Read error: Connection reset by peer]
vk0 has joined #ocaml
enthymeme has quit [Quit: rcirc on GNU Emacs 23.1.1]
vk0 has quit [Read error: Connection reset by peer]
myu2 has quit [Remote host closed the connection]
ygrek has joined #ocaml
vk0 has joined #ocaml
vk0 has quit [Read error: Connection reset by peer]
mnabil has quit [Ping timeout: 272 seconds]
ikaros has joined #ocaml
vk0 has joined #ocaml
Cyanure has quit [Quit: Quitte]
ygrek has quit [Remote host closed the connection]
myu2 has joined #ocaml
mnabil has joined #ocaml
ulfdoz has quit [Ping timeout: 250 seconds]
Yoric has joined #ocaml
ygrek has joined #ocaml
vk0 has quit [Read error: Connection reset by peer]
vk0 has joined #ocaml
vk0 has quit [Read error: Connection reset by peer]
vk0 has joined #ocaml
vk0 has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
vk0 has joined #ocaml
edwin has joined #ocaml
kaustuv_ is now known as kaustuv
myu2 has quit [Remote host closed the connection]
Yoric has quit [Quit: Yoric]
myu2 has joined #ocaml
myu2 has quit [Remote host closed the connection]
myu2 has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ikaros has quit [Quit: Leave the magic to Houdini]
ikaros has joined #ocaml
rwmjones has quit [Read error: Operation timed out]
Znudzon has joined #ocaml
ftrvxmtrx has joined #ocaml
myu2 has quit [Remote host closed the connection]
Znudzon has quit [Quit: Don't push the red button!]
sepp2k has joined #ocaml
Yoric has joined #ocaml
myu2 has joined #ocaml
Oejet has joined #ocaml
myu2 has quit [Remote host closed the connection]
eye-scuzzy has quit [Quit: leaving]
eye-scuzzy has joined #ocaml
avsm has joined #ocaml
milosn has joined #ocaml
_andre has joined #ocaml
avsm has quit [Quit: Leaving.]
lopex has joined #ocaml
yezariaely has joined #ocaml
avsm has joined #ocaml
fabjan is now known as faanbj
rixed has quit [Ping timeout: 250 seconds]
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
avsm has quit [Client Quit]
bohanlon has quit [Quit: Leaving]
boscop has joined #ocaml
sepp2k has quit [Quit: Leaving.]
tauntaun has joined #ocaml
yezariaely has left #ocaml []
myu2 has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 240 seconds]
<flux> hm. I want nicely indented output for a report. can Format help me with that?
<thelema> flux: supposedly, although I've not mastered it.
<thelema> how indented?
<flux> well, like a tree
<flux> going deeper in the code I increase the indent
<flux> I thought that might happen with simply open_box, close_box, etc, but it doesn't appear to indent at all
<flux> or possible open_hovbox, but that doesn't indent either
<thelema> you have to set indentation
<thelema> well, I assume you are, if you're using open_hovbox...
<flux> open_hovbox 2 doesn't really seem to affect my output
<flux> well, it does in fact if I use \n as newline
<flux> but it is somehow inconsistent
<flux> I have lines with indentation and without
<thelema> are you giving the formatter proper break hints?
<flux> my lines are always shorter than 40 characters
<flux> but perhaps I'm not somehow properly telling my line ends, although I'm using \n
<thelema> so force_newline?
<thelema> and I guess you want a vbox if you don't need any word wrap
<flux> I guess I need to have a test case
<thelema> that said, it may be easier to just write the pretty printer yourself
<thelema> let print_tree indent oc foo = ...
<flux> but but, I have this great library here..
<thelema> except it doesn't DWIM
<flux> batteries should have a new format module
<flux> FormatDammit
<flux> actually, I _am_ using batteries, does it have a solution for me?-)
<thelema> I've been tempted to build something like this in ocaml: http://dev.perl.org/perl6/doc/design/exe/E07.html
Yoric has joined #ocaml
<thelema> static typing would require camlp4 to magick the strings
<flux> basic indenter, done
<flux> reusing is so difficult :)
<flux> I think I've used that perl formatter
<thelema> I know. Need more examples, maybe.
<flux> not sure if that kind of report generators are really commonly needed stuff these days
<flux> well, perhaps if it can generate html/xml/etc as well
<thelema> yup, markup templating is good
<flux> ok, now after basic indenting I'd like to align my colons.. ;-)
<thelema> Enum.map String.length strs |> Enum.reduce max
<thelema> I think batteries has a string padding function
<thelema> ... or not...
<flux> well, yes, but the string is generated from my generic string_of_etc function and and..
<thelema> you have to precompute the lengths before printing, no?
<flux> yes
<flux> but I think it's more hassle than it's worth
<flux> for a simple data analysis tool
<thelema> sure. Might make a nice addition to batstring - given a list of strings, return a list of same-length strings with the input strings aligned left/right/center
rixed has joined #ocaml
benthos has quit [Ping timeout: 240 seconds]
benthos has joined #ocaml
<kaustuv> run it as: ocaml prtree.ml
myu2 has quit [Remote host closed the connection]
joewilliams_away is now known as joewilliams
<flux> kaustuv, thank you!
<flux> kaustuv, now how does it work if I have multi-line entries?
<flux> apparently I can use @,
<flux> I guess trying to use newlines was my problem
<flux> but, I already have my indenter. next time perhaps ;)
<kaustuv> just put the multiline entry inside its own box.
ztfw has joined #ocaml
<flux> the problem I had was that @. and \n apparently really insert a newline but no indentation
<kaustuv> @. is a flush, so you should never call it from inside a printer, only from the very outside
<kaustuv> and @\n forces a newline
<kaustuv> err, @\n forces a newline and then indents
yezariaely has joined #ocaml
yezariaely has left #ocaml []
<kaustuv> fwiw, for multiline nodes: http://ocaml.pastebin.com/PzdjXM2c
ygrek has joined #ocaml
drunK has joined #ocaml
mnabil has quit [Ping timeout: 240 seconds]
<kaustuv> There doesn't seem to be an easy way to coax Format to produce outout like pstree
<kaustuv> But XML-ish is pretty easy: http://ocaml.pastebin.com/CMMLZ1rX
mnabil has joined #ocaml
drunK has quit [Remote host closed the connection]
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
lopex has quit []
philtor has joined #ocaml
joewilliams has quit [Quit: ZNC - http://znc.sourceforge.net]
joewilliams_away has joined #ocaml
dario_teixeira has joined #ocaml
dario_teixeira has left #ocaml []
dario_teixeira has joined #ocaml
sepp2k has joined #ocaml
jonafan_ has joined #ocaml
lopex has joined #ocaml
jonafan has quit [Ping timeout: 260 seconds]
Yoric has quit [Ping timeout: 240 seconds]
Yoric has joined #ocaml
lopex has quit [Ping timeout: 276 seconds]
lopex has joined #ocaml
<hcarty> kaustuv: "custodian's moonlighted Xavier interlopers sobers Canterbury's" -- Deep insights from the OCaml toplevel, using your earlier pastebin
joewilliams has joined #ocaml
<hcarty> thelema: xstrp4 and/or the Print module from Batteries could provide something similar to Perl's formats/templates
joewilliams_away has quit [Quit: ZNC - http://znc.sourceforge.net]
<thelema> hcarty: I was thinking about extending the Print module
<thelema> except I don't know any camlp4
myu2 has joined #ocaml
willb1 has quit [Ping timeout: 260 seconds]
joewilliams is now known as joewilliams_away
jonafan_ is now known as jonafan
joewilliams_away is now known as joewilliams
<hcarty> thelema: I don't either, but I'd like to learn enough to fold some of xstrp4's features in to pa_string
ftrvxmtrx has quit [Quit: Leaving]
<thelema> which ones?
<hcarty> thelema: Inline interpolation and possible "here" quotations
<hcarty> pa_string already supports labeled arguments, but it would be nice to avoid writing a variable name twice
<thelema> yup
<thelema> I think string interpolation wouldn't be too hard to add
willb1 has joined #ocaml
<hcarty> The <:here< ... >> quotations in xstrp4 are nice for anything multi-line
<thelema> ocaml strings already cross lines just fine, no?
<hcarty> They do, but a warning was added recently (IIRC) which complains when unescaped newlines are found in strings
<thelema> I wonder the reason for that - I imagine most code wouldn't compile if a " were misplaced. even 2
<hcarty> The here quotation is definitely a lower priority item in my opinion
drunK has joined #ocaml
* thelema puts this on the batteries wishlist
<hcarty> thelema: Thanks
<hcarty> thelema: The warning description - "29 Unescaped end-of-line in a string constant (non-portable code)."
<hcarty> I'm not sure why it's non-portable. Maybe Windows line endings vs Unix line endings?
<thelema> I guess.
<thelema> only one type will be present in the source code
<thelema> and the other system will not end up with the right line endings
<hcarty> I don't know if a quotation would fix that itself, make it easier to fix, or make no difference.
<thelema> quotation? what quotation?
<hcarty> xstp4's <here:< >>
<gildor_> dario_teixeira: ih
<gildor_> dario_teixeira: hi
<thelema> ah, I think yes, it could fix it itself. More likely it ignores the issue, as it's usually a minor one.
Yoric has quit [Quit: Yoric]
dario_teixeira has quit [Quit: Page closed]
<adrien> lwt-glib's documentation seems pretty "short": anyone knows if it runs callbacks in threads by default?
<adrien> actually: not sure how it does it but blocking callbacks won't be blocking the program iirc
ftrvxmtrx has joined #ocaml
xl0 has quit [Ping timeout: 240 seconds]
xl0 has joined #ocaml
xl0 has quit [Ping timeout: 240 seconds]
xl0 has joined #ocaml
xl0 has quit [Remote host closed the connection]
xl0 has joined #ocaml
<orbitz> whoaaa ocaml is segfaulting on me
<orbitz> that ain't cool
<orbitz> ah I think I kow why. string access can eb undefiend right?
<flux> no, unless you use -unsafe
<orbitz> hrm
<flux> how about infinite recursion and native code?
<flux> or infinite recursion in c code?
<flux> (..or any other problem in C code)
xl0 has quit [Ping timeout: 272 seconds]
<orbitz> The entire project is in ocaml so shouldn't be a problem in C
joewilliams has quit [Changing host]
joewilliams has joined #ocaml
<orbitz> if I switch to bytcode debug should that give me more informaiton?
<flux> quite possibly
<flux> my guess would be stack overflow
<orbitz> quite possible
<flux> ocaml can detect it in both native and byte code
<orbitz> the binary that is failure is compiled native
<flux> BUT, if you're in some C code, which is pretty often if you use some low-level functions provided by the standard library, it cannot detect stack overflow while in C code
joewilliams is now known as joewilliams_away
joewilliams_away has quit [Quit: ZNC - http://znc.sourceforge.net]
<orbitz> ok
joewilliams_away has joined #ocaml
<orbitz> all of the processing i'm doing here is pretty basic list iteration and string manipulation
joewilliams_away is now known as joewilliams
<flux> so, what does the byte code binary give you?
joewilliams has quit [Changing host]
joewilliams has joined #ocaml
<orbitz> not sure yet waiting for another test to finish before trying it
xl0 has joined #ocaml
<orbitz> flux: you're right, stack overflow
<orbitz> ah found it
<orbitz> thanks flux
<flux> orbitz, no problem. happy coding!
ulfdoz has joined #ocaml
_andre has quit [Quit: leaving]
drunK has quit [Remote host closed the connection]
alexyk has joined #ocaml
<alexyk> I have a strange error, Not_found from a place where it's handled. http://paste.pocoo.org/show/344571/ -- the caller lines are below the invert function which raises the exception. The line for the error is try H.find t_days day -- which has a handler! -- and the caller prints "dments has length XXX", then the Not_found. Is it an ocaml bug, possibly?
lamawithonel_ has quit [Ping timeout: 264 seconds]
ymasory_ has joined #ocaml
<hcarty> alexyk: Is there any possibility that Not_found was re-defined somewhere?
<alexyk> hcarty: no way; I'm only using Batteries...
<alexyk> and the line is reported from invert
<flux> I think there's a bug about this somewhere?
<flux> (and it's indeed somehow related to batteries)
<alexyk> this used to work before I recompiled and rerun a bunch of stuff calling it; but there's no reason for it still. flux: where'd I look for the bug if it's known? what workarounds can there be?
<flux> alexyk, sorry, no ideas about the bug report or the workarounds
<flux> (maybe a complete compilable/executable test case would help ;-))
smerz has joined #ocaml
<flux> can't find a releavant message mentioning Not_found from my batteries-devel archives
alexyk_ has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
alexyk_ is now known as alexyk
alexyk has quit [Client Quit]
alexyk has joined #ocaml
Oejet has quit [Ping timeout: 240 seconds]
alexyk has quit [Read error: Connection reset by peer]
joewilliams is now known as joewilliams_away
Cyanure has joined #ocaml
Asmadeus has quit [Ping timeout: 240 seconds]
alexyk has joined #ocaml
<orbitz> hrm lwt is still giving me this nonsense: Fatal error: exception Unix.Unix_error(11, "select", "((read (7 9)) (write ()) (except ()) (timeout -1))")
alexyk has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 240 seconds]
<milosn> i am looking at examples in ocamlnet ... where should i look if i want to make custom protocol servers/clients?
Asmadeus has joined #ocaml
<diml> orbitz: which version of lwt are you using ?
<orbitz> 2.1.1
<orbitz> it is alwys the same read descriptors whe nit fails too
<orbitz> (as far as i have seen)
<flux> EINTR
<flux> lame, it should handle that
<flux> or hm
<flux> yes, EINTR
<orbitz> it look slike all the work i was doing is completed
<flux> I really wonder why it would die with that
ymasory_ has quit [Ping timeout: 246 seconds]
<diml> this error is catched in lwt_main.ml, i don't understand why you get it
<orbitz> let final_maf = Lwt_main.run (run_tree options 0 guide_tree >>= fun m -> Lwt.return m.mugsy_maf) in
<orbitz> Shell.cp final_maf options.out_maf;
<orbitz> is what i'm doing
<orbitz> print_endline options.out_maf
<diml> also i do not understand from where come from the "((read (7 9)) (write ()) (except ()) (timeout -1))" ...
<orbitz> yeah i don't get it all the time either
<diml> in the sources the error is raised by uerror("select", Nothing) so there should be nothing here
<orbitz> it' svery odd
<flux> to me it looks like some debug info
<diml> are you using core ?
<diml> because it looks like a sexp
<orbitz> yeah i'm using core
<orbitz> you think i'm not getting it from lwt and actually form core?
<diml> yes
<orbitz> Hrm
<orbitz> that is quite plausible, i wonder what would eb goign on with core
<orbitz> i'll move the cp to lwt land
<orbitz> thanks
mnabil has quit [Ping timeout: 260 seconds]
<thelema> I think that alexyk is getting a wrong position for his raise, and the Not_found is coming from elsewhere. Also, [let x = foo in f x; x] is better written [foo |> tap f]
<thelema> Does the following seem useful to anyone? val cache_map : gen:('a -> 'b) -> (('a -> 'b) * ('a -> unit))
<thelema> hmm, maybe I should make the return values a record...
<thelema> type ('a,'b) cache = {get : 'a -> 'b; del : 'a -> unit}
<thelema> val cache_map : gen:('a -> 'b) -> ('a,'b) cache
tauntaun has quit [Quit: Ex-Chat]
ztfw has quit [Remote host closed the connection]
enthymeme has joined #ocaml
alexyk has joined #ocaml
edwin has quit [Remote host closed the connection]
alexyk has quit [Read error: Connection reset by peer]
vk0 has quit [Read error: Operation timed out]
vk0 has joined #ocaml
ikaros has quit [Remote host closed the connection]
Amorphous has quit [Ping timeout: 240 seconds]
alexyk has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml
hto has quit [Quit: Lost terminal]
hto has joined #ocaml
Amorphous has joined #ocaml
Amorphous has quit [Changing host]
Amorphous has joined #ocaml
alexyk has quit [Read error: Connection reset by peer]
<thelema> grr, I'm away for a bit and alexyk comes and goes
alexyk has joined #ocaml
sepp2k has quit [Quit: Leaving.]
alexyk has quit [Read error: Connection reset by peer]
<thelema> lol! again
<gildor_> thelema: we can watch him for you
<gildor_> thelema: what is your message ?
<thelema> gildor_: thanks - just that he should look elsewhere for the source of the exception, that I don't think it's coming from the line he's pointing to
alexyk has joined #ocaml
<thelema> alexyk: about your question earlier
<alexyk> thelema: yeah!
<thelema> the Not_found exception - is the line number from bytecode or native code compilation?
<alexyk> thelema: native
<thelema> try bytecode - I often get wrong line numbers from native code
lamawithonel has joined #ocaml
<alexyk> thelema: ah ok. I used to get correct numbers from this code, and it used to run OK. But it's batteries from github and ocaml 3.11.2, maybe I should upgrade the server
tauntaun has joined #ocaml
<thelema> I'm still using 3.11.2, fwiw
alexyk has quit [Read error: Connection reset by peer]
alexyk has joined #ocaml