adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.09 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.09/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
spew has quit [Quit: Connection closed for inactivity]
dborisog has joined #ocaml
kvik has quit [Changing host]
kvik has joined #ocaml
MilenaDevi has joined #ocaml
MilenaDevi has quit [Client Quit]
amiloradovsky has quit [Ping timeout: 240 seconds]
nicoo has quit [Ping timeout: 240 seconds]
nicoo has joined #ocaml
mfp has quit [Ping timeout: 256 seconds]
vicfred has quit [Quit: Leaving]
GeoffK has quit [Quit: Leaving]
vicfred has joined #ocaml
_whitelogger has joined #ocaml
mbuf has joined #ocaml
vicfred_ has joined #ocaml
vicfred has quit [Ping timeout: 240 seconds]
CourtneyTai has joined #ocaml
CourtneyTai has quit [Client Quit]
narimiran has joined #ocaml
vicfred_ has quit [Quit: Leaving]
vicfred has joined #ocaml
dckc has quit [Ping timeout: 258 seconds]
dckc has joined #ocaml
Haudegen has joined #ocaml
mbuf has quit [Quit: Leaving]
rgherdt has joined #ocaml
amiloradovsky has joined #ocaml
amiloradovsky has quit [Ping timeout: 240 seconds]
amiloradovsky has joined #ocaml
mfp has joined #ocaml
raver has quit [Remote host closed the connection]
AliciaAway has joined #ocaml
AliciaAway has quit [Client Quit]
gareppa has joined #ocaml
gareppa has quit [Quit: Leaving]
TheLemonMan has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Quit: Leaving]
gareppa has joined #ocaml
gareppa has quit [Quit: Leaving]
gareppa has joined #ocaml
mbuf has joined #ocaml
gareppa has quit [Remote host closed the connection]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
so has quit [*.net *.split]
Khady has quit [*.net *.split]
cthuluh has quit [*.net *.split]
lyxia has quit [*.net *.split]
notnotdan has quit [*.net *.split]
cthuluh has joined #ocaml
lyxia has joined #ocaml
notnotdan has joined #ocaml
so has joined #ocaml
vesper11 has quit [Ping timeout: 264 seconds]
vesper11 has joined #ocaml
rpcope has quit [Ping timeout: 264 seconds]
shenghi has quit [*.net *.split]
sonologico has joined #ocaml
lyxia has quit [Remote host closed the connection]
lyxia has joined #ocaml
rgherdt has quit [Ping timeout: 272 seconds]
dborisog has quit [Ping timeout: 256 seconds]
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
sonologico has quit [Remote host closed the connection]
sonologico has joined #ocaml
raver has joined #ocaml
rgherdt has joined #ocaml
rgherdt has left #ocaml [#ocaml]
BeatriceFer has joined #ocaml
sonologico has quit [Remote host closed the connection]
BeatriceFer has quit [Client Quit]
Anarchos has joined #ocaml
rpcope has joined #ocaml
mbuf has quit [Quit: Leaving]
amiloradovsky has quit [Ping timeout: 240 seconds]
narimiran has quit [Quit: leaving]
Hrundi_V_Bakshi has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
BiancaRagazza has joined #ocaml
BiancaRagazza has quit [Client Quit]
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
tane has joined #ocaml
Haudegen has joined #ocaml
amiloradovsky has joined #ocaml
Jesin has quit [Quit: Leaving]
Jesin has joined #ocaml
raver has quit [Remote host closed the connection]
ArthurStrong has joined #ocaml
<ArthurStrong> Hi all. What is the easiest way just to print structure, like "print" in Python?
bw1 has joined #ocaml
amiloradovsky has quit [Ping timeout: 240 seconds]
muskan has joined #ocaml
<labor[m]> There is no simple way. You can use a ppx for that.
<ArthurStrong> labor[m]: why? It's because OCaml is strongly typed?
<labor[m]> Because it's statically typed. Types are not known at run time.
<ArthurStrong> OK
<ArthurStrong> 2nd question. I want to split a list using predicate. Say, list of strings: "0", "a", "1", "b"... predicate: isnumber? output=[["0", "a"], ["1", "b"]...
<ArthurStrong> Is there something ready?
<ArthurStrong> I mean, predicate shows beginning of a sublist
<labor[m]> I'm not sure I understand what you want to do.
<ArthurStrong> labor[m]: I have a text file
<ArthurStrong> it's a dump of some blog
<ArthurStrong> each part started with date
<ArthurStrong> so I want to use a predicate like "is date?"
<ArthurStrong> and to split this file into blog posts
<ArthurStrong> a predicate would be regexp matcher
<labor[m]> Have you started to write something, like, opening and reading the file ?
amiloradovsky has joined #ocaml
<ArthurStrong> labor[m]: yes, I'm getting a file as a list of strings
<labor[m]> Each string correspond to one blog entry ?
<ArthurStrong> labor[m]: no
<ArthurStrong> ah, nevermind
<labor[m]> ?
<ArthurStrong> this is a text I have
<ArthurStrong> I want to split it by sublists
<ArthurStrong> each started with "* date"
<labor[m]> OK, then you could do something like:
<labor[m]> List.fold_left (fun (curr_date, curr_content, entries) line -> ...) ... yourlistofstrings
<ArthurStrong> OK
<labor[m]> You just have to fill the two `...` parts
<ArthurStrong> Is there a standard function that returns index of element in list to be found? Instead of the element
<labor[m]> No but that's probably not what you whant
<ArthurStrong> OK, thanks!
<labor[m]> Why do you want to do this ?
<ArthurStrong> to implement my own version of the function that splits
bw1 has left #ocaml [#ocaml]
<octachron> There is List.partition that splits a list according to a predicate
<labor[m]> Yep but that's not what he means when he says "split" if I got it
<octachron> Ah yes. But it is indeed better to write a simple fold rather than use indices.
<octachron> Indices are a sign that you are using a List as an Array.
<ArthurStrong> octachron: OK, thanks for the hint
tane has quit [Quit: Leaving]
muskan has left #ocaml [#ocaml]
AliceWndr has joined #ocaml
AliceWndr has quit [Client Quit]
oturtle has quit [Ping timeout: 250 seconds]
oturtle has joined #ocaml
<ArthurStrong> What is the difference between raise and failwith?
<ArthurStrong> failwith is like die()?
Hrundi_V_Bakshi has quit [Ping timeout: 246 seconds]
<ArthurStrong> also, how to do a sequential let, like let* in Scheme/
<ArthurStrong> ?
vicfred has quit [Remote host closed the connection]
<companion_cube> `failwith s` is just `raise (Failure s)`
vicfred has joined #ocaml
<companion_cube> ArthurStrong: not sure what you mean by sequential let
<companion_cube> `let x= 1 in let y=2 in …` is already sequential
<ArthurStrong> aha, thanks!
ridcully_ has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]