<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
<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
<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
<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]