<flx>
also there's the thing that conveniently using (--) means opening a module
<flx>
with (--) I would expect a closed range, though, where as with a function 'range' I would expect a half-open range
Yoric[DT] has joined #ocaml
schme has joined #ocaml
evn_ has joined #ocaml
ygrek has joined #ocaml
adu has quit ["Bye"]
nuncanada has quit [Read error: 110 (Connection timed out)]
nuncanada has joined #ocaml
goalieca_lappy has joined #ocaml
goalieca_lappy has quit [Client Quit]
mfp has joined #ocaml
musicallyut has joined #ocaml
nuncanada has quit [Read error: 113 (No route to host)]
nuncanada has joined #ocaml
musically_ut has quit [Remote closed the connection]
Linktim has joined #ocaml
tetsuo_ has joined #ocaml
Jedai has joined #ocaml
coucou747 has joined #ocaml
hkBst has joined #ocaml
vfdfdfvd has joined #ocaml
middayc has joined #ocaml
jprieur has joined #ocaml
<pango_>
I'm against a range operator (or function) that would 'materialize' the range as an int list. The demand for such operator comes from people that are used to other languages that implement that idiom efficiently; that will lead to even more frustration.
evn_ has quit [Read error: 113 (No route to host)]
<flx>
well, one does need sequences of integers at times
<flx>
are you suggesting using streams instead?
bluestorm has quit [Read error: 113 (No route to host)]
bluestorm has joined #ocaml
<pango_>
int stream, int * int, another ADT, educate people to use ocaml idioms, take whole idioms from other languages (either ranges, or subarrays and substrings from ML,...), but certainly not returning an int list
<pango_>
that's easy, but doesn't scale
<flx>
pervasive streams support would be nice
Jedai has quit [Read error: 113 (No route to host)]
<flx>
(meaning thoroughly supported in standard libraries and pattern matching)
<flx>
also it would be nice to have functional streams
<flx>
essentially they would be lazy lists then
kronbaar has joined #ocaml
<kronbaar>
hello
<kronbaar>
how can I specify a target directory for binaries? I want to keep .ml and .mli together in src/ and everything else in bin/
<flx>
I don't think you can without wrapping the compilation process with copying etc
kelaouchi has quit [Client Quit]
<pango_>
you get pattern matching over streams by using camlp4
* pango_
nods
<pango_>
It's supposed to be a feature of ocamlbuild, but I haven't used it yet
<pango_>
"ocamlbuild has so-called “hygiene” rules that state that object files (.cmo, .cmi, or .o files, for instance) must not appear outside of the build directory."
<Yoric[DT]>
Personally, I'd have ranges as either an ADT or a ExtLib Enum.t .
jlouis has quit [Remote closed the connection]
schme has quit [Remote closed the connection]
jlouis has joined #ocaml
musicallyut has quit [Remote closed the connection]
pango_ has quit [Excess Flood]
pango_ has joined #ocaml
Demitar has joined #ocaml
middayc has quit []
Linktim_ has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
<orbitz>
well, until we rewrite all of ocaml to support a range concept, i'll take an int list
Yoric[DT] has quit [Remote closed the connection]
Yoric[DT] has joined #ocaml
musically_ut has joined #ocaml
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
jlouis has quit ["Leaving"]
jlouis has joined #ocaml
|Catch22| has joined #ocaml
filp has joined #ocaml
eelte has joined #ocaml
ikaros_ has joined #ocaml
middayc has joined #ocaml
coucou747 has quit [Read error: 113 (No route to host)]
pango_ has quit [Remote closed the connection]
ikaros has quit [Read error: 110 (Connection timed out)]
pango_ has joined #ocaml
nuncanada has quit ["Leaving"]
Linktim- has joined #ocaml
middayc_ has joined #ocaml
Linktim_ has quit [Read error: 110 (Connection timed out)]
<rwmjones>
RobertFischer pong
AxleLonghorn has joined #ocaml
middayc has quit [Read error: 110 (Connection timed out)]
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
Yoric[DT] has quit [Read error: 113 (No route to host)]
Yoric[DT] has joined #ocaml
Jedai has joined #ocaml
ofaurax has joined #ocaml
jlouis has quit ["brb -- box change"]
jlouis has joined #ocaml
nuncanada has joined #ocaml
oublions has joined #ocaml
eelte has quit [Read error: 110 (Connection timed out)]
oublions is now known as coucou747
Morphous has joined #ocaml
AxleLonghorn has left #ocaml []
Amorphous has quit [Read error: 110 (Connection timed out)]
seydar has joined #ocaml
seydar has left #ocaml []
magnus has joined #ocaml
eelte has joined #ocaml
<sporkmonger>
i've got an in_channel, and i want to read everything until EOF, what's the fastest, most efficient way of doing this?
<sporkmonger>
i tried using the input method with a buffer of 1024 chars, but it seems that the result string ends up with a length that's a multiple of 1024
<sporkmonger>
which really isn't what i was looking for
<sporkmonger>
i basically just want:
<sporkmonger>
let read_all in_channel : string =
<bluestorm>
there is a function for that in extlib
<sporkmonger>
yeah, i still haven't quite figured ocamlfind out yet
<sporkmonger>
findlib knows about extlib, but i'm still really shaky on what that does for me
<thelema>
let input_fields ch l = Enum.from (fun () -> try let b = String.make l in if input ch b 0 l = 0 then raise Enum.No_more_elements else b)
<thelema>
no, can do that better...
<sporkmonger>
thelema: i'm not sure i see what that does exactly
<sporkmonger>
Admittedly, haven't touched enums at all yet
<sporkmonger>
assuming enums in ocaml are similar to what i'm used to elsewhere
<sporkmonger>
i guess i don't see what enums buy me here
<thelema>
these enums are similar to lazy lists
<thelema>
they buy you a way past the string size limit
<thelema>
and if your source data fits in memory, they allow replaying
* sporkmonger
is lost
<sporkmonger>
ok, lazy lists...
<sporkmonger>
are lists who's internals don't get evaluated until you ask for em?
<thelema>
yes
<sporkmonger>
well, i have to be able to replay regardless of whether it all fits in memory
<thelema>
sporkmonger: in that case, why not just read the file anew each time?
<thelema>
why bother caching the data?
<sporkmonger>
because the file is stdin?
<thelema>
if stdin doesn't fit in memory, you lose.
<sporkmonger>
true
<sporkmonger>
ok, so that's probably something of a moot point
<sporkmonger>
assume it fits in memory then
<sporkmonger>
this thing won't be running on machines with less than 4GB anyhow
<thelema>
then this way will work nicely.
<sporkmonger>
absolutely worst case is maybe it gets run on a VPS with 256mb allotted
<sporkmonger>
ok, so what exactly is the return value of the function you gave me there?
<sporkmonger>
i assume an enum?
<thelema>
yes.
<sporkmonger>
string Enum.t? or?
<thelema>
string Enum.t
<sporkmonger>
ok, so i get a bunch of strings in an enum, and i read each of them one at a time then?
<thelema>
yup.
<sporkmonger>
hmm
<sporkmonger>
this seems a little round-about
<thelema>
you'd rather have a bool Enum.t?
<sporkmonger>
no
<sporkmonger>
because i have to turn around and wrap that enum with a stream
<thelema>
?? enums do a great job of offering a stream-like interface.
<thelema>
the basic operations on an Enum are: count, next, clone
<sporkmonger>
ok, so first, how do i replay the thing?
<sporkmonger>
is that clone?
<thelema>
clone it and play the clone.
<sporkmonger>
ok
<sporkmonger>
the issue is that i need the data bit-by-bit, effectively byte-by-byte with a one byte buffer
<thelema>
not difficult to wrap one enumeration into another.
<sporkmonger>
if the enum contains strings, yeah
<sporkmonger>
that's basically what i'd have to do
<sporkmonger>
if i clone an enum that wraps another enum, that doesn't cause issues does it?
<thelema>
it depends on how good the clone function is - if you construct your enum with Enum.from, clone is created to build the entire enum as a list. Which would cause problems creating a list of booleans.
<thelema>
because of the memory space used by booleans vs. strings
<sporkmonger>
well, there's spots where i do stuff like: bit * 128
<sporkmonger>
so booleans don't make much sense
<thelema>
but you could clone the inner enum and re-apply the conversion to it.
<sporkmonger>
yeah
<sporkmonger>
ok, so i'm sold on the enum idea, but enum's seem to be in extlib
<sporkmonger>
and i'm still having link issues with extlib :-P