gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
zorun has quit [Read error: Connection reset by peer]
zorun has joined #ocaml
lamawithonel has joined #ocaml
lamawithonel__ has quit [Ping timeout: 260 seconds]
lamawithonel_ has joined #ocaml
lamawithonel has quit [Ping timeout: 252 seconds]
iago has quit [Quit: Leaving]
lamawithonel__ has joined #ocaml
lamawithonel_ has quit [Ping timeout: 265 seconds]
lamawithonel__ has quit [Ping timeout: 276 seconds]
lamawithonel has joined #ocaml
lamawithonel has quit [Ping timeout: 272 seconds]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
ulfdoz_ is now known as ulfdoz
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
lamawithonel has joined #ocaml
asdfhjkl has joined #ocaml
letrec_ has joined #ocaml
oriba has quit [Quit: oriba]
quintessence has quit [Ping timeout: 276 seconds]
asdfhjkl has quit [Quit: Leaving]
mjonsson_ has quit [Remote host closed the connection]
quintessence has joined #ocaml
codesnow has joined #ocaml
twittard has quit [Quit: twittard]
g0dmoney- has quit [Changing host]
g0dmoney- has joined #ocaml
tlockney has quit [Ping timeout: 260 seconds]
lamawithonel has quit [Remote host closed the connection]
tlockney has joined #ocaml
lamawithonel has joined #ocaml
codesnow has quit [Ping timeout: 245 seconds]
quintessence has quit [Ping timeout: 276 seconds]
cdidd has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
emmanuelux has joined #ocaml
guru has joined #ocaml
guru is now known as Guest29034
<Guest29034> how to get tail of a file faster than 'File.lines_of "fn" |> Array.of_enum |> fun a -> Array.sub a (Array.length - n) n ' ?
<adrien> how do you define "tail"?
<adrien> last line?
<Guest29034> last lines
<Guest29034> say last 100 lines
<adrien> you can seek to the (end of the file - 1) / 4096 * 4096 (page size) and "parse" from there and see if you have enough lines
<adrien> I can't remember which gnu coreutils tools do something like that
<olasd> ...tail ?
<Guest29034> yes
<adrien> except that if it doesn't find enough lines, it doesn't go back again
<Guest29034> ok i see
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
<Guest29034> adrien: thx
<adrien> it's not guaranteed at all but on text files, it shouldn't be an issue most of the time and you can always try again by going 4KB back
<adrien> and my ' - 1 ' thing to go back one page does not work in all cases
<adrien> maybe that using Unix.stat will give what you want
<Guest29034> adrien: i geuss calling Unix.system tail is easier
<adrien> depending on how you want to do it, yes =)
<_habnabit> system doesn't let you read the result into a variable
<_habnabit> (don't use system, like, ever)
<adrien> hmmm, right: Unix.open_process* family
<adrien> or maybe that Batteries has something corresponding too ;-)
<Guest29034> _habnabit, adrien: ok
<iZsh> Guest29034: it's actually (sort of) a question google asks in their interviews :P
MaskRay has quit [Quit: leaving]
EmmanuelOga has quit [Ping timeout: 244 seconds]
<Guest29034> iZsh: :):)
Snark has joined #ocaml
Guest29034 has quit [Ping timeout: 272 seconds]
edwin has joined #ocaml
guru has joined #ocaml
guru is now known as Guest14922
andreypopp has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
Cyanure has joined #ocaml
Guest14922 has quit [Quit: leaving]
twittard has joined #ocaml
milosn has quit [Ping timeout: 276 seconds]
milosn has joined #ocaml
mnabil has joined #ocaml
lamawithonel has quit []
lamawithonel has joined #ocaml
lamawithonel has quit []
lamawithonel has joined #ocaml
cdidd has quit [Ping timeout: 246 seconds]
cdidd has joined #ocaml
andreypopp has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
antoineB has joined #ocaml
andreypopp has joined #ocaml
andreypopp has quit [Client Quit]
andreypopp has joined #ocaml
andreypopp has quit [Client Quit]
andreypopp has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
MaskRay has joined #ocaml
MaskRay has quit [Changing host]
MaskRay has joined #ocaml
ygrek has joined #ocaml
Tobu has joined #ocaml
zorun has quit [Read error: Connection reset by peer]
zorun has joined #ocaml
ygrek has quit [Ping timeout: 276 seconds]
ygrek has joined #ocaml
zerbob has joined #ocaml
codesnow has joined #ocaml
djcoin has joined #ocaml
ikaros has joined #ocaml
KDr2 has quit [Remote host closed the connection]
dsheets has quit [Read error: Connection timed out]
dsheets has joined #ocaml
<Drakken> omygosh, ocaml has _three_ ways to do multiple bindings.
<Drakken> let/and uses previous bindings, even if one of the new names shadows one of the old ones.
datkin has quit [Read error: Connection reset by peer]
<Drakken> let rec/and uses the new bindings.
<Drakken> and let/in uses new bindings linearly.
dsheets has quit [Read error: Connection timed out]
dsheets has joined #ocaml
zerbob has quit [Ping timeout: 245 seconds]
sander has joined #ocaml
dsheets has quit [Read error: Connection timed out]
dsheets has joined #ocaml
letrec_ has quit [Ping timeout: 244 seconds]
lamawithonel has quit []
codesnow has quit [Ping timeout: 246 seconds]
<iZsh> Drakken: I usually use "and" only with "rec" (in other words when I need mutually recursive bindings)
<iZsh> otherwise I always use "let … in" because it's easier to copy/paste-move statements around
lamawithonel has joined #ocaml
lamawithonel has quit [Ping timeout: 276 seconds]
<Drakken> iZsh that seems to be the convention. let/and is equivalent to LET in Lisp, so maybe that's why it was included.
MaskRay has quit [Remote host closed the connection]
Tobu has quit [Ping timeout: 272 seconds]
<antoineB> hello, i can't use Std.input_list function
<antoineB> i haved installed extLib and add '#load "extlib/extLib.cma" ;;' on the command line
Tobu has joined #ocaml
iago has joined #ocaml
<thelema_> antoineB: "open ExtLib"?
<thelema_> Drakken: let..in isn't multiple bindings. only let..and...in is multiple bindings. Yes, there are two flavors of that: recursive and non-recursive, whether you're making a set of mutually recursive values (I believe this is the real motivation for the 'and') and without rec, which is rarely used, but could indicate potential for parallel evaluation.
<Drakken> thelema I mean multiple consecutive let/ins. let .. in let ... etc. is equivalent to LET* in Lisp.
<Drakken> I mean thelema_
<thelema_> Drakken: well, okay... But then there's 4; let rec ... in
<Drakken> thelema_ that's nested. I'm just trying to figure out all possible semantics behind linear sequences of binding terms.
<thelema_> with let...and...in, there's no linearity - all are bound at once.
<Drakken> Lisp only has LET and LET* for nonfunctional values, and Haskell only has one kind of let expression.
<thelema_> same with let rec
<Drakken> I mean they're syntactically linear.
<thelema_> ocaml has two kinds> let rec ... [and ...] in, let ... [and ...] in
<thelema_> technically only the first is needed, but the second is available, as it's commonly useful to rebind an identifier
<thelema_> (not necessarily great practice, but can be nice to shadow old values so they can't be used)
<iZsh> I use shadowing all the time :)
<Drakken> right. I've been thinking about ways to design a new language with syntax somewhat like Haskell's multiple-binding let form, and I just wanted to make sure I know what OCaml has.
<Drakken> in terms of semantics
<iZsh> what's the language for?
<Drakken> satiating my idle curiosity :)
<thelema_> ocaml has recursive groups and non-recursive groups. Just because a group can be a singleton...
<iZsh> Drakken: I mean, is it a domain specific language ?
<Drakken> iZsh no. There are just so many features in so many different languages that I like, that I'd like to put them all together into one language.
<iZsh> good luck :)
<antoineB> thelema_: Unbound module
<thelema_> antoineB: any reason you're using extlib over batteries?
<antoineB> no
<thelema_> I'm not as sure on extlib's structure, but all its functionality has been merged into batteries. (except compression)
<antoineB> thelema_: i don't manage to use BatFile
<antoineB> open BatFile;; -> Unbound module
<thelema_> antoineB: #use "topfind";; #require "batteries";;
<thelema_> or put the batteries ocamlinit file in your ~/.ocamlinit
<antoineB> .ocamlinit take ocaml code?
<thelema_> takes ocaml code & toplevel directives
<antoineB> ok
asdfhjkl has joined #ocaml
mnabil has quit [Remote host closed the connection]
datkin has joined #ocaml
quintessence has joined #ocaml
datkin has quit [Ping timeout: 256 seconds]
zerbob has joined #ocaml
datkin has joined #ocaml
pango has quit [Ping timeout: 252 seconds]
pango has joined #ocaml
datkin has quit [Ping timeout: 248 seconds]
dsheets has quit [Max SendQ exceeded]
dsheets has joined #ocaml
antoineB has quit [Quit: Lost terminal]
lamawithonel has joined #ocaml
datkin_ has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.2]
dsheets has quit [Ping timeout: 244 seconds]
datkin_ has quit [Remote host closed the connection]
lamawithonel has quit [Ping timeout: 276 seconds]
Drup has joined #ocaml
twittard has quit [Quit: twittard]
Xizor has joined #ocaml
zerbob has quit [Quit: Page closed]
dsheets has joined #ocaml
mcclurmc has joined #ocaml
andreypopp has quit [Quit: Computer has gone to sleep.]
andreypopp has joined #ocaml
andreypopp has quit [Client Quit]
andreypopp has joined #ocaml
cdidd has quit [Remote host closed the connection]
datkin_ has joined #ocaml
datkin_ has quit [Read error: Connection reset by peer]
datkin_ has joined #ocaml
Snark has quit [Ping timeout: 245 seconds]
datkin_ has quit [Ping timeout: 255 seconds]
asdfhjkl has quit [Quit: Leaving]
twittard has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 244 seconds]
Submarine has quit [Remote host closed the connection]
thizanne has quit [Read error: Operation timed out]
thizanne has joined #ocaml
ftrvxmtrx has joined #ocaml
thizanne has quit [Ping timeout: 245 seconds]
ikaros has quit [Quit: Ex-Chat]
ygrek has quit [Quit: Leaving]
sander has quit [Quit: Leaving]
asdfhjkl has joined #ocaml
brooksbp has joined #ocaml
datkin_ has joined #ocaml
datkin_ has quit [Ping timeout: 244 seconds]
brooksbp has quit [Quit: Leaving]
edwin has quit [Remote host closed the connection]
emmanuelux has quit [Ping timeout: 260 seconds]
Tianon has quit [Ping timeout: 260 seconds]
emmanuelux has joined #ocaml
snearch has joined #ocaml
avsm has joined #ocaml
andreypopp has quit [Quit: Computer has gone to sleep.]
Tianon has joined #ocaml
Tianon has quit [Changing host]
Tianon has joined #ocaml
Drup has quit [Quit: Leaving.]
Cyanure has quit [Remote host closed the connection]
KDr2 has joined #ocaml
letrec_ has joined #ocaml
thizanne has joined #ocaml
KDr2 has quit [Remote host closed the connection]
joyas has joined #ocaml
joyas has quit [Quit: #ocaml]
snearch has quit [Quit: Verlassend]
twittard has quit [Quit: twittard]
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
letrec_ has quit [Ping timeout: 245 seconds]
KDr2 has joined #ocaml
Xizor has quit []
Tobu has quit [Ping timeout: 260 seconds]