adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.06.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
bramford has joined #ocaml
whoman has joined #ocaml
sh0t has quit [Remote host closed the connection]
cbot has quit [Ping timeout: 255 seconds]
zolk3ri has quit [Quit: leaving]
infinity0_ has joined #ocaml
infinity0_ has quit [Changing host]
infinity0 is now known as Guest75521
infinity0 has joined #ocaml
Algebr has quit [Remote host closed the connection]
cbot has joined #ocaml
spew has quit [Quit: Connection closed for inactivity]
isd has quit [Ping timeout: 252 seconds]
isd has joined #ocaml
<bramford> I'm having some trouble using a recursive function for incrementing "nested" values and outputting to a list of tuples
<bramford> Link to the gist that explains further and shows erroneous code: https://gist.github.com/bramford/648770b73074fd2768a428ce097bae9a
<companion_cube> your function return `unit` because you have an `if` without a `else` case
<companion_cube> `if a then b` is implicitely `if a then b else ()`
<companion_cube> also, you seem confused about what `let` does
<companion_cube> it doesn't mutate a variable
<companion_cube> `for i = 0 to n do let x = … done` makes no sense
mfp has quit [Ping timeout: 268 seconds]
<companion_cube> for the recursive version, instead of `if x <= x_max then l = …` you should try `let l = if x <= x_max then … else l in … `
maattdd has joined #ocaml
keep_learning has joined #ocaml
<bramford> companion_cube: I'm aware `let` doesn't mutate variables. I expected `let l = ((x, y) :: l) in` to create a new `l` with `(x, y)` appended to `l`
maattdd has quit [Ping timeout: 256 seconds]
<companion_cube> yeah, but only in the scope of `in …`
<bramford> companion_cube: of course, in this case I've neglected consideration of the `in` scope
<bramford> companion_cube: I'll try your solution to the recursive function, however to increment both elements of the tuple, both `if .. then .. else` statements must be evaluated
<companion_cube> let l = if x then … else l in if y then … else l
<bramford> companion_cube: Ah yes that works
<bramford> companion_cube: Fantastic, thanks for that. I wasn't sure if I was using the right approach.
<companion_cube> no pb
pierpa has joined #ocaml
<companion_cube> you have to realise how `let` works, and that can take a bit of time
nomicflux has joined #ocaml
nomicflux has quit [Client Quit]
sh0t has joined #ocaml
isd has quit [Ping timeout: 248 seconds]
sh0t has quit [Remote host closed the connection]
sh0t has joined #ocaml
silver has quit [Read error: Connection reset by peer]
Haudegen has quit [Remote host closed the connection]
nullifidian__ has quit [Read error: Connection reset by peer]
nullifidian__ has joined #ocaml
nullifidian_ has joined #ocaml
nullifidian__ has quit [Ping timeout: 248 seconds]
cbot has quit [Ping timeout: 240 seconds]
cbot has joined #ocaml
tjriles has quit [Ping timeout: 256 seconds]
tjriles has joined #ocaml
isd has joined #ocaml
tjriles has quit [Ping timeout: 240 seconds]
tjriles has joined #ocaml
tjriles has quit [Ping timeout: 248 seconds]
sh0t has quit [Remote host closed the connection]
govg has joined #ocaml
andreas_ has quit [Quit: Connection closed for inactivity]
isd has quit [Quit: Leaving.]
nullifidian__ has joined #ocaml
nullifidian_ has quit [Read error: Connection reset by peer]
nicoo has quit [Ping timeout: 255 seconds]
nicoo has joined #ocaml
<rntz> Drup: thanks, eventually I figured out how to use recursive modules to do it
ygrek has quit [Ping timeout: 276 seconds]
mbuf has joined #ocaml
jimmyrcom has quit [Ping timeout: 256 seconds]
AlfredENeuman has joined #ocaml
spew has joined #ocaml
mk9 has joined #ocaml
jimmyrcom has joined #ocaml
whoman has left #ocaml ["Leaving"]
spew has quit [Read error: Connection reset by peer]
pierpa has quit [Quit: Page closed]
mk9 has quit [Quit: mk9]
spew has joined #ocaml
jimmyrcom_ has joined #ocaml
mk9 has joined #ocaml
BitPuffin has joined #ocaml
maattdd has joined #ocaml
mk9 has quit [Quit: mk9]
maattdd has quit [Ping timeout: 276 seconds]
spew has quit [Ping timeout: 256 seconds]
mk9 has joined #ocaml
nullifidian_ has joined #ocaml
tjriles has joined #ocaml
nullifidian__ has quit [Ping timeout: 264 seconds]
tjriles has quit [Ping timeout: 276 seconds]
tjriles has joined #ocaml
tjriles has quit [Ping timeout: 240 seconds]
mk9 has quit [Read error: Connection reset by peer]
sz0 has joined #ocaml
mk9 has joined #ocaml
mk9 has quit [Quit: mk9]
dr_toboggan has quit [Ping timeout: 248 seconds]
AlfredENeuman has quit [Ping timeout: 248 seconds]
cbot has quit [Quit: Leaving]
mk9 has joined #ocaml
freyr has joined #ocaml
mk9 has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
xuanrui has joined #ocaml
mk9 has joined #ocaml
xuanrui has quit [Client Quit]
maelkum has joined #ocaml
Haudegen has joined #ocaml
tjriles has joined #ocaml
clog has quit [Ping timeout: 255 seconds]
clog has joined #ocaml
tjriles has quit [Ping timeout: 248 seconds]
eikke has quit [Ping timeout: 260 seconds]
zpe has joined #ocaml
AltGr has joined #ocaml
tarptaeya has joined #ocaml
cuicui has joined #ocaml
mfp has joined #ocaml
sapristi has joined #ocaml
argent_smith has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
tarptaeya has quit [Read error: Connection reset by peer]
tarptaeya has joined #ocaml
dakk has joined #ocaml
infinity0 has quit [Ping timeout: 256 seconds]
infinity0 has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
ziyourenxiang has joined #ocaml
maattdd has joined #ocaml
bartholin has quit [Quit: Leaving]
dhil has joined #ocaml
sapristi has quit [Ping timeout: 248 seconds]
sapristi has joined #ocaml
malc_ has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
tarptaeya has quit [Quit: Leaving]
zpe has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
dakk has quit [Remote host closed the connection]
silver has joined #ocaml
maattdd has quit [Quit: WeeChat 2.0.1]
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
sadiq has quit [Quit: leaving]
mengu has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zolk3ri has joined #ocaml
zpe has quit [Ping timeout: 276 seconds]
zpe has joined #ocaml
kakadu has joined #ocaml
mbuf has quit [Quit: Leaving]
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
jimmyrcom has quit [Remote host closed the connection]
Haudegen has quit [Remote host closed the connection]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
dhil has quit [Ping timeout: 268 seconds]
<RalfJ> Is it expected that with opam 2, `opam upgrade` when upgrading a package recompiles fewer things than `opam install $PACKAGE` recompiles?
Haudegen has joined #ocaml
<RalfJ> hm, another case of "opam upgrade failed by opam install to reproduce then succeeded"... strange
tarptaeya has joined #ocaml
artart78 has quit [Ping timeout: 256 seconds]
DM2 has quit [Remote host closed the connection]
DM2 has joined #ocaml
DM2 has quit [Read error: Connection reset by peer]
dhil has joined #ocaml
nomicflux has joined #ocaml
jimmyrcom_ has quit [Ping timeout: 256 seconds]
nomicflux has quit [Client Quit]
sapristi has quit [Ping timeout: 268 seconds]
shinnya has joined #ocaml
tjriles has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
spew has joined #ocaml
webshinra has quit [Ping timeout: 256 seconds]
tjriles has quit [Ping timeout: 260 seconds]
webshinra has joined #ocaml
dhil has joined #ocaml
hampusw has joined #ocaml
shinnya has quit [Ping timeout: 255 seconds]
maelkum2 has joined #ocaml
maelkum has quit [Ping timeout: 248 seconds]
sh0t has joined #ocaml
sh0t has quit [Remote host closed the connection]
sh0t has joined #ocaml
sh0t has quit [Ping timeout: 248 seconds]
sh0t has joined #ocaml
sh0t has quit [Ping timeout: 276 seconds]
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
andreas_ has joined #ocaml
tarptaeya has quit [Quit: Leaving]
mengu has quit [Ping timeout: 260 seconds]
maelkum2 has quit [Quit: AtomicIRC: The nuclear option.]
MercurialAlchemi has quit [Ping timeout: 276 seconds]
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
dhil has quit [Ping timeout: 255 seconds]
tjriles has joined #ocaml
Jesin has joined #ocaml
mbuf has joined #ocaml
demonimin has joined #ocaml
dhil has joined #ocaml
freyr has quit [Remote host closed the connection]
tjriles has quit [Ping timeout: 240 seconds]
ziyourenxiang has quit [Ping timeout: 252 seconds]
tarptaeya has joined #ocaml
sapristi has joined #ocaml
zpe has quit [Remote host closed the connection]
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
barcabuona has quit [Ping timeout: 248 seconds]
tarptaeya has quit [Ping timeout: 260 seconds]
mk9 has quit [Ping timeout: 264 seconds]
tarptaeya has joined #ocaml
letoh_ has joined #ocaml
Jesin has quit [Quit: Leaving]
letoh has quit [Ping timeout: 264 seconds]
letoh_ is now known as letoh
cuicui has quit [Quit: leaving]
Haudegen has quit [Remote host closed the connection]
malc_ has quit [Remote host closed the connection]
mbuf has quit [Quit: Leaving]
barcabuona has joined #ocaml
AltGr has left #ocaml [#ocaml]
dedgrant has joined #ocaml
dedgrant has quit [Client Quit]
Haudegen has joined #ocaml
Haudegen has quit [Ping timeout: 248 seconds]
Haudegen has joined #ocaml
jnavila has joined #ocaml
sh0t has joined #ocaml
andreas_ has quit [Quit: Connection closed for inactivity]
kakadu has quit [Quit: Konversation terminated!]
jnavila has quit [Ping timeout: 240 seconds]
bartholin has joined #ocaml
jnavila has joined #ocaml
<Drup> aantron: did you/we considered at some point moving part of Lwt_io to the core ?
artart78 has joined #ocaml
artart78 has joined #ocaml
artart78 has quit [Changing host]
sz0 has quit [Quit: Connection closed for inactivity]
BitPuffin has quit [Remote host closed the connection]
jack5638 has quit [Ping timeout: 260 seconds]
kakadu has joined #ocaml
jack5638 has joined #ocaml
xfbs has joined #ocaml
shinnya has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
sapristi has quit [Ping timeout: 260 seconds]
sh0t has quit [Ping timeout: 260 seconds]
sapristi has joined #ocaml
argent_smith has quit [Quit: Leaving.]
sh0t has joined #ocaml
sh0t has quit [Ping timeout: 276 seconds]
barcabuona has quit [Ping timeout: 276 seconds]
tokenrov1 has quit [Ping timeout: 240 seconds]
tokenrove has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
jimmyrcom_ has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
sapristi has quit [Remote host closed the connection]
sh0t has joined #ocaml
sapristi has joined #ocaml
barcabuona has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
orbifx1 has joined #ocaml
sh0t has quit [Ping timeout: 276 seconds]
<aantron> Drup: not that i remember, but maybe. it doesn't seem like the right thing to do now, though
<Drup> why not ?
<aantron> just to keep the core "pure" w.r.t. I/O
<aantron> just saw Lwt_fmt (not in detail). i think the new fad (and i may be the only person engaging in it :p) is to make these things into separate repos
sapristi has quit [Remote host closed the connection]
<Drup> hugh, no, it's a module with less than 100 lines, I'm not puting that in a repo by itself
<Drup> there will be more lines of metadata than code
sapristi has joined #ocaml
Haudegen has quit [Remote host closed the connection]
tarptaeya has quit [Quit: Leaving]
<Leonidas> I am using ocamllex for the first time: can I do multiple actions on one regex at the same time?
<Leonidas> in particular: I would like to emit a token and then call a different entrypoint
<octachron> Not really, actions stop once a token is emitted
<Leonidas> then how would I switch into a different tokenizing context while preserving the knowledge that I am in a different context?
<Leonidas> Example: foo|bar where I would like to tokenize into STRING foo; DASH STRING bar, but the rules for after the dash are slightly different
<Leonidas> I could introduce a DASHSTRING bar, but I also have other tokens like PLUSSTRING bar and handling these separately in the parser seems to be the way better approach
<octachron> generally it is more a matter for the layer on top of the lexer
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
Haudegen has joined #ocaml
<Leonidas> exactly, but I struggle on how to emit the right tokens
<Leonidas> maybe worth sleeping over it
<octachron> the question is probaly more: do you really want to have tokens that are context-dependent?
<octachron> because it is definitely possible to do so, by storing the right information in a reference for instance, but would it make the correponding grammar easier to understand?
<Leonidas> you are probably right, I can introduce a different token, but even then I don't know how to switch the tokenizing context
<Leonidas> like parsing foo|bar into STRING foo; DASH; SUBSTITUTION bar
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
<Leonidas> because the regex that sees | would need to emit both DASH and call the endpoint that emits SUBSTITUTION once it is done parsing
<Leonidas> s/parsing/lexing/ of course
<octachron> this looks like a typical rule for the parser
sapristi has quit [Remote host closed the connection]
<Leonidas> I have written this rule for the parser already, I just don't know how to emit these tokens. It is probably because I am thinking the wrong way up somehow.
<octachron> e.g., the lexer emits STRING DASH STRING and the parser recognize that the second string is a substitution
<octachron> the role of the lexer should be limited to delimiting "word"'s not giving meaning to these words
sapristi has joined #ocaml
<Leonidas> thanks, I looks like I need to rethink the logic
whoman has joined #ocaml
jnavila has quit [Quit: Konversation terminated!]
sh0t has joined #ocaml
jimmyrcom_ has quit [Ping timeout: 248 seconds]
<orbifx1> how goes it all?
kakadu has quit [Remote host closed the connection]
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
demonimin has quit [Ping timeout: 276 seconds]
orbifx1 has quit [Ping timeout: 248 seconds]
demonimin has joined #ocaml
dmtd has quit [Quit: Connection closed for inactivity]
shinnya has quit [Ping timeout: 240 seconds]
spew has quit [Quit: Connection closed for inactivity]
govg has quit [Remote host closed the connection]
Haudegen has quit [Remote host closed the connection]