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
kjak has quit [Ping timeout: 258 seconds]
kakadu_ has quit [Remote host closed the connection]
spew has quit [Quit: Connection closed for inactivity]
brettgilio has quit [Quit: Quit]
jao has quit [Ping timeout: 258 seconds]
silver has quit [Read error: Connection reset by peer]
brettgilio has joined #ocaml
Haudegen has quit [Ping timeout: 268 seconds]
brettgilio has quit [Quit: Quit]
brettgilio has joined #ocaml
mal`` has quit [Quit: Leaving]
mal`` has joined #ocaml
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 268 seconds]
DabsR has joined #ocaml
DabsR has quit [Client Quit]
gravicappa has joined #ocaml
ggole has joined #ocaml
_whitelogger has joined #ocaml
_whitelogger has joined #ocaml
dborisog has joined #ocaml
kleisli has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ocaml
sagax has joined #ocaml
kleisli has joined #ocaml
_whitelogger has joined #ocaml
_whitelogger has joined #ocaml
bartholin has quit [Quit: Leaving]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
domovoy_ has quit [Quit: Leaving]
kleisli has quit [Ping timeout: 265 seconds]
kakadu_ has joined #ocaml
kakadu__ has joined #ocaml
kakadu_ has quit [Ping timeout: 260 seconds]
Guest68587 has quit [Quit: Bye bye ✋]
crowley95 has joined #ocaml
kakadu_ has joined #ocaml
kakadu__ has quit [Ping timeout: 260 seconds]
jao has joined #ocaml
tane has joined #ocaml
ygrek has joined #ocaml
kakadu_ has quit [Ping timeout: 258 seconds]
kakadu__ has joined #ocaml
kakadu_ has joined #ocaml
kakadu__ has quit [Ping timeout: 268 seconds]
ygrek has quit [Ping timeout: 268 seconds]
Haudegen has joined #ocaml
TheRuralJuror has joined #ocaml
TheRuralJuror has quit [Client Quit]
dborisog has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ocaml
_whitelogger has joined #ocaml
ygrek has joined #ocaml
luna_is_here has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
dborisog has joined #ocaml
kakadu__ has joined #ocaml
kakadu_ has quit [Ping timeout: 265 seconds]
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
count3rmeasure has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
silver has joined #ocaml
silver has quit [Remote host closed the connection]
kakadu_ has joined #ocaml
kakadu__ has quit [Ping timeout: 258 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
<rwmjones> anyone know if a menir (or ocamlyacc?) grammar can get the current line number? my ocamllex lexer is counting line numbers, but I don't know if I can get the lexbuf from the parser
<rwmjones> basically I'm following the example in Real World OCaml (https://v1.realworldocaml.org/v1/en/html/parsing-with-ocamllex-and-menhir.html)
<thizanne> you can use $startpos and $endpos in your rules productions
<thizanne> those have type Lexing.position, which is a record that includes line number
<rwmjones> ah nice
<companion_cube> just remember to update the lexbuf when you do meet a \n
<rwmjones> works, thanks
<rwmjones> yeah I have that code already
<rwmjones> never really sure why lexers don't just do that automatically though, because in my lexer is a pita
<rwmjones> *it is a
<rwmjones> multi-line strings etc have to have special handling
<companion_cube> I imagine one could have a different notion of newline?
<rwmjones> I guess so, also "performance"
<companion_cube> :D
domovoy has joined #ocaml
<domovoy> hi
<domovoy> http://paste.debian.net/1121981/ gives me about line 19: '{res with content = v}' 'This record expression is expected to have type t | The field content does not belong to type t' any idea why? (i have a type t defined, but how is it getting in this portion of code? it only manipulates 'type doc_declaration'
<domovoy> ho, t also have a filed 'title'... maybe they are confused. how to solve that?
<Armael> add a type annotation to "res" (the argument of the function)
<Armael> let parse_doc (res: doc_declaration) k = ...
<domovoy> yeah, just discovered that thanks
<domovoy> but i'm not really pleased with that. guess i should create submodules for this kind of stuff, keep things clean
<Armael> yeah it's generally better to avoid having several record types that share fields within the same scope
<Armael> having submodules sounds good
<Armael> (that share field names*)
bartholin has joined #ocaml
<domovoy> i have quite a bunch of these 'parse this type' function (making a RAML parser), so i think it makes sense to create a submodule for each of those, so they have their own `type t` and `let parse ...`
<Armael> yeah
ygrek has joined #ocaml
<domovoy> i'm starting to like ocaml, at the begining i was quite lost with all those types and match and strange constructs, but when you start to understand how it works, it's quite fun :) and strong typing is a good thing
<Armael> :)
jnavila has joined #ocaml
jnavila has quit [Ping timeout: 260 seconds]
jnavila has joined #ocaml
ziyourenxiang has quit [Ping timeout: 268 seconds]
ziyourenxiang has joined #ocaml
dborisog has quit [Ping timeout: 268 seconds]
<domovoy> http://paste.debian.net/1121991/ -> "Error: Unbound constructor NoLevel" but http://paste.debian.net/1121992/ works??? am i missing something?
jnavila has quit [Ping timeout: 268 seconds]
tane has quit [Ping timeout: 265 seconds]
<dmbaturin> domovoy: You'll need to open Logging_internals.Logging_types where that type is defined.
<dmbaturin> let open Easy_logging.Logging_internals.Logging_types in match s with "none" -> NoLevel | ...
domovoy has quit [Ping timeout: 240 seconds]
tane has joined #ocaml
jnavila has joined #ocaml
kleisli has joined #ocaml
jnavila has quit [Ping timeout: 256 seconds]
jnavila has joined #ocaml
oxford has joined #ocaml
brettgilio has quit [Quit: Quit]
brettgilio has joined #ocaml
count3rmeasure has quit [Remote host closed the connection]
jnavila has quit [Ping timeout: 252 seconds]
ggole has quit [Quit: Leaving]
TheLemonMan has joined #ocaml
gravicappa has quit [Ping timeout: 260 seconds]
ygrek has quit [Ping timeout: 268 seconds]
jao has quit [Remote host closed the connection]
jco has joined #ocaml
<jco> Hello!
<jco> How do you load modules from an ocaml project from within utop?
jao has joined #ocaml
<jco> the project is built with dune
<companion_cube> `dune utop src/` typically
<jco> thanks
jao has quit [Remote host closed the connection]
jao has joined #ocaml
<jco> ho I have a question: basically I maintain a priority queue where the keys are edges and the priorities are floats
<jco> so I've got a priority class which implements a set.ordertype
<jco> so I have a comparison function, compare p p' between priorities
<jco> but when the priorities are the same, I'd like to make the edges wich are closer to some point come first
<companion_cube> you probably want a lexicographic order on (priority, distance to point)
<jco> in fact I did not formulate the problem properly
<jco> In fact I'd like to mix both notions (distance to point and angle with a vector) in a set containing vertices
<jco> so if vertices have the same angle with a vector, then those who are closer to some point get popped first
<jco> but nevermind, I need to think first on what I need to do precisely
<companion_cube> you need a proper metric :)
<jco> in fact I'm confused because I'm implementing an algorithm by looking at two formulations of it
kakadu__ has joined #ocaml
kakadu_ has quit [Ping timeout: 265 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
kakadu_ has joined #ocaml
kakadu__ has quit [Ping timeout: 265 seconds]
kakadu_ has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 260 seconds]
Haudegen has joined #ocaml
jco has quit [Quit: WeeChat 2.6]
tane has quit [Quit: Leaving]
jao has quit [Remote host closed the connection]
jao has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
jnavila has joined #ocaml
jnavila has quit [Remote host closed the connection]
luna_is_here has quit [Ping timeout: 265 seconds]
brettgilio has quit [Ping timeout: 260 seconds]
brettgilio has joined #ocaml