lapinou changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | http://www.ocaml.org | OCaml 4.01.0 announce at http://bit.ly/1851A3R | Public logs at http://tunes.org/~nef/logs/ocaml/
Fullma has joined #ocaml
Simn has quit [Quit: Leaving]
tulloch has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
watermind has joined #ocaml
ontologiae has quit [Ping timeout: 244 seconds]
tlockney_away is now known as tlockney
jao`` has joined #ocaml
xianxu has quit [Ping timeout: 265 seconds]
ollehar has quit [Ping timeout: 240 seconds]
tlockney is now known as tlockney_away
tlockney_away is now known as tlockney
tlockney is now known as tlockney_away
sw1nn has quit [Ping timeout: 252 seconds]
darkf has joined #ocaml
wolfnn has quit [Ping timeout: 240 seconds]
jao`` is now known as jao
jao has quit [Changing host]
jao has joined #ocaml
xianxu has joined #ocaml
lostcuaz has joined #ocaml
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tulloch has quit [Ping timeout: 244 seconds]
talzeus has quit [Read error: Connection reset by peer]
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
tautologico has joined #ocaml
xianxu has quit [Ping timeout: 240 seconds]
watermind has quit [Ping timeout: 264 seconds]
nikki93 has quit [Remote host closed the connection]
talzeus has joined #ocaml
claudiuc_ has joined #ocaml
shinnya has joined #ocaml
claudiuc has quit [Ping timeout: 265 seconds]
_5kg has quit [Ping timeout: 252 seconds]
S11001001 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
_5kg has joined #ocaml
boogie has quit [Remote host closed the connection]
ygrek_ has joined #ocaml
q66 has quit [Quit: Leaving]
introom has joined #ocaml
arjunguha has joined #ocaml
jpdeplaix` has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 240 seconds]
boogie has joined #ocaml
tlockney_away is now known as tlockney
boogie has quit [Ping timeout: 240 seconds]
pyon has joined #ocaml
jpdeplaix` has joined #ocaml
segmond has quit [Read error: Connection reset by peer]
segmond has joined #ocaml
segmond has quit [Max SendQ exceeded]
segmond has joined #ocaml
nikki93 has joined #ocaml
boogie has joined #ocaml
introom has quit [Ping timeout: 240 seconds]
boogie has quit [Ping timeout: 244 seconds]
nikki93 has quit []
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yacks has joined #ocaml
arjunguha has joined #ocaml
Thooms has joined #ocaml
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xianxu has joined #ocaml
dsheets has quit [Ping timeout: 245 seconds]
nikki93 has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
ben_m has joined #ocaml
boogie has joined #ocaml
boogie has quit [Ping timeout: 240 seconds]
divyanshu has joined #ocaml
xianxu has quit [Quit: Lost terminal]
wombat1 has quit [Ping timeout: 265 seconds]
siddharthv_away is now known as siddharthv
segmond has quit [Read error: Connection reset by peer]
segmond has joined #ocaml
boogie has joined #ocaml
seggy has joined #ocaml
boogie has quit [Ping timeout: 240 seconds]
segmond has quit [Ping timeout: 265 seconds]
introom has joined #ocaml
tlockney is now known as tlockney_away
paolooo has joined #ocaml
segimondu has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
seggy has quit [Ping timeout: 240 seconds]
appleby has joined #ocaml
Kakadu has joined #ocaml
<flux> what part in particular? it's not very short
paolooo has quit [Ping timeout: 245 seconds]
<flux> quite interesting though that people are doing robotics in OCaml (and it sounds like a good idea to me)
<appleby> well
ygrek_ has quit [Ping timeout: 240 seconds]
<appleby> I need to know how it's getting things like the pacc variable
<appleby> and wgs84.posn_lat
<appleby> how is live.ml obtaining values for those
<appleby> and are they just simply floats or something
<flux> well, get_svsinfo uses its parameter 'vs' to get to pacc
<flux> I guess you've followed that track a bit
<appleby> kind of
<appleby> ok hmm
<flux> I think there's some framework in the background that makes this thing work
<appleby> so another application is calling that
<appleby> yeah a huge one
<appleby> it's in the git repository lol
<appleby> so basically pacc is being passed into live.ml via the vs variable
ben_m has left #ocaml []
<flux> well, doesn't quite seem that direct
<flux> get_svsinfo is an internal function
axiles has joined #ocaml
csakatoku has joined #ocaml
<flux> It hink it's being registered to be called again by listen_svsinfo which is called by listen_acs_and_msgs which is finally a public function
<flux> (you can see public interface from live.mli)
<appleby> ok
<flux> what get_svsinfo does however is somehow get probably an instance/environment structure 'ac'
<flux> oh, but it gets it from vs
<flux> so get_ac gets the 'ac', whatever it means, from the vs as well
<appleby> aircraft
seggy has joined #ocaml
<appleby> flux: the variable I am most concerned with is
<flux> once get_svsinfo has been called, it uses gps_page#svsinfo pacc a; to set pacc and something else. gps_page = ac.gps_page
<appleby> wgs84.posn_lat
<appleby> and wgs84.posn_long
<appleby> because the gps is not working and my task is to debug it
<flux> it comes from the 'ac' as well
<flux> commit_changes retrieves an ac instance using find_ac, which uses a module-global hash table aircrafts
<flux> and ac has field fp_group which has method waypoints that are those lat/long-records
segimondu has quit [Ping timeout: 240 seconds]
<appleby> ok
<flux> and fp_group comes from the record airfract, its type is MapFP.flight_plan
<appleby> hmm
<appleby> so then in that case
boogie has joined #ocaml
<appleby> the wgs84 is not the gps at all
<appleby> it's the user-defined waypoints??
ggole has joined #ocaml
segimondu has joined #ocaml
<appleby> flux, what OS are you on
<flux> Linux
<appleby> ok, I was actually gonna see if you would build the program yourself and see how to get at those gps
seggy has quit [Ping timeout: 265 seconds]
boogie has quit [Ping timeout: 244 seconds]
<appleby> but then remembered that you probably don't have a quadcopter
<appleby> haha
<appleby> but does wgs84 posn_lat only ever take on the fp_group values?
<appleby> what do you suppose listen_flight_params does?
<flux> so safe_bind looks to be like a callback registration function
<flux> so it registers a bunch of callbacks for various parameters and then processes them somehow..
<appleby> ok
<appleby> ivy
<appleby> i'm guessing
<appleby> apparantly some library to allow c to communicate with ocaml
<appleby> or something like that
<flux> well, I need to go to the office, good luck debugging :)
<appleby> so in that case the posn_lat may be the gps value
<appleby> ?
<appleby> thanks flux
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
appleby has quit [Quit: appleby]
nikki93 has quit [Ping timeout: 252 seconds]
cago has joined #ocaml
cago has left #ocaml []
angerman has joined #ocaml
sgnb has quit [Remote host closed the connection]
sgnb has joined #ocaml
Hannibal_Smith has joined #ocaml
nikki93 has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
ygrek_ has joined #ocaml
nikki93 has quit [Ping timeout: 240 seconds]
csakatoku has quit [Read error: Connection reset by peer]
csakatoku has joined #ocaml
divyanshu has joined #ocaml
boogie has joined #ocaml
r0b1 has quit [Ping timeout: 240 seconds]
boogie has quit [Read error: Connection reset by peer]
boogie has joined #ocaml
boogie has quit [Ping timeout: 240 seconds]
yacks has quit [Ping timeout: 264 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
matthieu2 has joined #ocaml
lostcuaz has joined #ocaml
nikki93 has joined #ocaml
paolooo has joined #ocaml
divyanshu has joined #ocaml
AltGr has joined #ocaml
nikki93 has quit [Ping timeout: 240 seconds]
ikaros has joined #ocaml
boogie has joined #ocaml
Simn has joined #ocaml
yacks has joined #ocaml
boogie has quit [Ping timeout: 265 seconds]
venk has quit [Ping timeout: 264 seconds]
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rand000 has joined #ocaml
nikki93 has joined #ocaml
claudiuc_ has quit [Remote host closed the connection]
nikki93 has quit [Ping timeout: 252 seconds]
sw1nn has joined #ocaml
boogie has joined #ocaml
boogie has quit [Ping timeout: 240 seconds]
claudiuc has joined #ocaml
rossberg_ has quit [Remote host closed the connection]
rossberg has joined #ocaml
<Kakadu> Let's say you have a structure with field datetime : CalendarLib.Calendar.t
<Kakadu> and you need to do `deriving (Json)` with this strcuture type
<companion_cube> arf
<Kakadu> How will you solve the issue?
<companion_cube> I don't know, I don't think you can use this kind of syntax extensions on foreign types
ontologiae has joined #ocaml
<Kakadu> Interesting, can I declare my_calendar_type and use is as SQL-row type in macaque table description?
<Kakadu> It seems I can emulate deriving Json by writing some functions manually
<Kakadu> Also I can mark row in the table with type `string` and do type conversions manually
angerman has quit [Quit: Gone]
introom has quit [Ping timeout: 240 seconds]
angerman has joined #ocaml
tulloch has joined #ocaml
<companion_cube> I think that if you write some modules with the correct names, Deriving will be able to use them for other instances
appleby has joined #ocaml
yacks has quit [Ping timeout: 240 seconds]
appleby has quit [Client Quit]
rwmjones has quit [Ping timeout: 252 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
tulloch has quit [Read error: Operation timed out]
divyanshu has joined #ocaml
mbac has joined #ocaml
rwmjones has joined #ocaml
<adrien_oww> I expect that you need to be have derived each component of the type first
<Kakadu> Camlp4 tryies to fool me: http://paste.in.ua/9424/#26
<Kakadu> Also it is suspicious that Json is not mentioned there: https://github.com/ocsigen/deriving/tree/master/lib
michael_lee has joined #ocaml
<companion_cube> I think that's partly why I don't like much code generation
<companion_cube> it doesn't mix well with libraries, and is too "magic"
zpe has joined #ocaml
<flux> but for stuff like serialization it can be nice, it reduces duplication
tulloch has joined #ocaml
rwmjones has quit [Read error: Operation timed out]
avsm has joined #ocaml
ontologiae has quit [Ping timeout: 265 seconds]
<companion_cube> yeah...
<companion_cube> no silver bullet for this, imho
<companion_cube> unless ocaml-ty is merged into the trunk
yacks has joined #ocaml
jonludlam has joined #ocaml
nikki93 has joined #ocaml
demonimin has quit [Ping timeout: 245 seconds]
<adrien_oww> I find code generation too difficult to do properly
<adrien_oww> it's more difficult to reason about
<adrien_oww> you can't just look at a data structure and write your code to do stuff
<adrien_oww> you need to look at the data structure and write code that will write code that does stuff
<ousado> yes, but it's very effective
<adrien_oww> I don't think so
<adrien_oww> sexplib is very inefficient for instance
<adrien_oww> or at least it was one to two years ago
<adrien_oww> and code is duplicated everywhere
demonimin has joined #ocaml
<ousado> that entirely depends on the quality of the code generator
<adrien_oww> my belief is that the added difficulty in writing the code and code generator makes it difficult to do something of quality
rwmjones has joined #ocaml
<flux> so you view the value of code generation in the quality of the code it generates?
<flux> I view the value as the service it provides
<ousado> adrien_oww: I don't understand how that's different from hand-written code
csakatoku has quit [Remote host closed the connection]
<flux> I used sexp as a protocol between different OCaml processes and it was quite nice to change the protocol in sync.
<flux> you need to pass a new field? just add a new field and it works.
nikki93 has quit [Ping timeout: 244 seconds]
boogie has joined #ocaml
<flux> of course, if you need to consider protocol versioning and multiple implementations, it becomes more difficult
<flux> but maybe protobuf works in that case, and it's based on code generation as well..
<flux> (well, there are implementations that provide code generation that is)
<ousado> done correctly it will save hours and hours of time, and when there's a bug, you fix it once for all code being generated, that's what I mean with "effective"
<flux> when you are writing the dozenth straight-forward implementation of converting a record to a protocol message and vice versa, you start to think that there's gotta be a better way.
<flux> not to mention how easily people makes mistakes in tasks computers should do ;)
<ousado> indeed
<adrien_oww> ousado: ah
<adrien_oww> ousado: I was not advocating looking at your types and writing it by hand each and every time
<adrien_oww> (*)
<adrien_oww> I had runtime types in mind
boogie has quit [Ping timeout: 240 seconds]
<companion_cube> I'm more in favor of combinators when it's humanly tractable
<companion_cube> but it's a bit more efforts than code generation, for sure
<flux> I guess proper runtime type information would be a decent solution, better than Marshal anyway
tulloch_ has joined #ocaml
<companion_cube> (excepted that compiling is simpler)
<adrien_oww> (*) note that I've done the hand-writing part for yypkg
<flux> you could just auto generate those uses of combinators! :-)
<adrien_oww> basically I removed the sexplib code generation
<adrien_oww> factored the code
<adrien_oww> now the code to handle a record is very very dumb and simple
<adrien_oww> and I update by hand but it's difficult to make a mistake
<ousado> for my part, I like the idea that the generated code is being statically checked by the compiler, like everything else, too
<adrien_oww> with runtime types you still have the safety
<adrien_oww> it goes through GADTs but that's it
<companion_cube> flux: you could generate the use of combinators, indeed
mort___ has joined #ocaml
ontologiae has joined #ocaml
ollehar has joined #ocaml
csakatoku has joined #ocaml
rand000 has quit [Ping timeout: 240 seconds]
csakatoku has quit [Remote host closed the connection]
talzeus has quit [Remote host closed the connection]
johnelse_away is now known as johnelse
arjunguha has joined #ocaml
wombat1 has joined #ocaml
tulloch has quit [Read error: Operation timed out]
tulloch_ has quit [Ping timeout: 240 seconds]
rwmjones_ has joined #ocaml
rwmjones has quit [Quit: Terminated with extreme prejudice - dircproxy 1.2.0]
rwmjones_ is now known as rwmjones
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rom1504 has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
_andre has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
wombat1 has quit [Ping timeout: 240 seconds]
nikki93 has joined #ocaml
tulloch has joined #ocaml
tulloch_ has joined #ocaml
boogie has joined #ocaml
nikki93 has quit [Ping timeout: 240 seconds]
rwmjones has quit [Ping timeout: 245 seconds]
rwmjones has joined #ocaml
boogie has quit [Ping timeout: 240 seconds]
tulloch_ has quit [Ping timeout: 264 seconds]
tulloch has quit [Ping timeout: 265 seconds]
tulloch has joined #ocaml
tulloch_ has joined #ocaml
tulloch_ has quit [Quit: leaving]
ygrek_ has quit [Ping timeout: 240 seconds]
arjunguha has joined #ocaml
wwilly has joined #ocaml
yacks has quit [Ping timeout: 240 seconds]
introom has joined #ocaml
wombat1 has joined #ocaml
rand000 has joined #ocaml
arjunguha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
siddharthv is now known as siddharthv_away
ollehar has quit [Ping timeout: 240 seconds]
avsm has quit [Quit: Leaving.]
tulloch has quit [Ping timeout: 240 seconds]
yacks has joined #ocaml
ollehar has joined #ocaml
nikki93 has joined #ocaml
csakatoku has joined #ocaml
boogie has joined #ocaml
dsheets has joined #ocaml
tulloch has joined #ocaml
nikki93 has quit [Ping timeout: 265 seconds]
Hannibal_Smith has quit [Quit: Sto andando via]
boogie has quit [Ping timeout: 244 seconds]
wombat1 has quit [Ping timeout: 240 seconds]
tulloch has quit [Ping timeout: 240 seconds]
metasyntax has quit [Quit: Leaving]
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 240 seconds]
arjunguha has joined #ocaml
gasche_ is now known as gasche
arjunguha has quit [Client Quit]
paolooo has quit [Ping timeout: 245 seconds]
boogie has joined #ocaml
boogie has quit [Ping timeout: 265 seconds]
saml has joined #ocaml
segimondu is now known as segmond
csakatoku has joined #ocaml
mort___ has quit [Ping timeout: 240 seconds]
wombat1 has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
darkf has quit [Quit: Leaving]
divyanshu has joined #ocaml
divyanshu has quit [Client Quit]
yacks has quit [Remote host closed the connection]
divyanshu has joined #ocaml
nikki93 has joined #ocaml
talzeus has joined #ocaml
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
freling has quit [Ping timeout: 240 seconds]
wombat1 has quit [Ping timeout: 264 seconds]
wombat1 has joined #ocaml
zpe has joined #ocaml
csakatoku has quit [Remote host closed the connection]
divyanshu has quit [Ping timeout: 265 seconds]
Simn is now known as Simn|gone
appleby has joined #ocaml
ygrek_ has joined #ocaml
freling has joined #ocaml
appleby has quit [Client Quit]
boogie has joined #ocaml
boogie has quit [Ping timeout: 240 seconds]
freling has quit [Quit: Leaving.]
ollehar1 has joined #ocaml
ccasin has quit [Quit: leaving]
ccasin has joined #ocaml
ccasin has quit [Client Quit]
wombat1 has quit [Ping timeout: 245 seconds]
ccasin has joined #ocaml
ccasin has quit [Client Quit]
csakatoku has joined #ocaml
matthieu2 is now known as maattdd
maattdd is now known as maattd
maattd is now known as maattdd
ccasin has joined #ocaml
ontologiae has quit [Ping timeout: 265 seconds]
lostcuaz has joined #ocaml
introom2 has joined #ocaml
introom2 has quit [Client Quit]
freling has joined #ocaml
gereedy has quit [Ping timeout: 265 seconds]
Muzer has quit [Quit: ZNC - http://znc.sourceforge.net]
maattdd_ has joined #ocaml
gereedy has joined #ocaml
nikki93 has quit [Remote host closed the connection]
64MAAKA2Q has joined #ocaml
64MAAKA2Q has quit [Read error: Connection reset by peer]
introom has quit [Quit: WeeChat 0.4.3]
introom has joined #ocaml
introom has quit [Client Quit]
yacks has joined #ocaml
introom has joined #ocaml
maattdd has quit [Quit: WeeChat 0.4.3]
Muzer has joined #ocaml
nikki93 has joined #ocaml
dsheets has quit [Excess Flood]
dsheets has joined #ocaml
madroach has joined #ocaml
nikki93 has quit [Ping timeout: 244 seconds]
avsm has joined #ocaml
csakatoku has quit [Remote host closed the connection]
travisbrady has joined #ocaml
boogie has joined #ocaml
maattdd_ has quit [Quit: WeeChat 0.4.3]
csakatoku has joined #ocaml
shinnya has joined #ocaml
maattdd has joined #ocaml
csakatoku has quit [Remote host closed the connection]
mort___ has joined #ocaml
boogie has quit [Remote host closed the connection]
Sim_n has joined #ocaml
Simn|gone has quit [Ping timeout: 245 seconds]
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wombat1 has joined #ocaml
tlockney_away is now known as tlockney
jwatzman|work has joined #ocaml
ontologiae has joined #ocaml
S11001001 has joined #ocaml
S11001001 has quit [Changing host]
S11001001 has joined #ocaml
yacks has quit [Read error: Connection reset by peer]
nlucaroni has quit [Quit: leaving]
boogie has joined #ocaml
Sim_n has quit [Ping timeout: 245 seconds]
boogie has quit [Ping timeout: 244 seconds]
ollehar1 has quit [Ping timeout: 240 seconds]
introom has quit [Ping timeout: 252 seconds]
Simn has joined #ocaml
dsheets has quit [Ping timeout: 244 seconds]
lostcuaz has joined #ocaml
lostcuaz_ has joined #ocaml
lostcuaz has quit [Ping timeout: 265 seconds]
nikki93 has joined #ocaml
boogie has joined #ocaml
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
nikki93 has quit [Ping timeout: 244 seconds]
nikki93 has joined #ocaml
wolfnn has joined #ocaml
shinnya has quit [Ping timeout: 240 seconds]
tlockney is now known as tlockney_away
mort___ has left #ocaml []
paolooo has joined #ocaml
mrGeppetto has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
peter` has joined #ocaml
peter` has quit [Remote host closed the connection]
mrGeppetto has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
mrGeppetto has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
ygrek_ has quit [Ping timeout: 244 seconds]
mrGeppetto has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
MisterGeppetto has joined #ocaml
introom has joined #ocaml
pyon has quit [Quit: restart]
dsheets has joined #ocaml
michael_lee has quit [Remote host closed the connection]
madroach has quit [Quit: leaving]
pyon has joined #ocaml
divyanshu has joined #ocaml
tlockney_away is now known as tlockney
nikki93 has quit [Remote host closed the connection]
wwilly has quit [Ping timeout: 244 seconds]
paolooo has quit [Ping timeout: 245 seconds]
RMacy has joined #ocaml
kagebe has joined #ocaml
<kagebe> Hi everyone, I have a question regarding classes and their methods in OCaml: Can I get a function from a class method, i.e. reference the method of class such that I could apply it to an object of the class with the usual function syntax? (class.method) obj param1 ... obviously does not work
<kagebe> or would I need to extract the method to a function outside the class somewhere first?
<ggole> methods are functions, but they close over the object iirc
<ggole> So if you have class wat = object method foo x:int = x end, (new wat)#foo will give you an ordinary function of type int -> int
<companion_cube> they do
<companion_cube> let foo = (fun o -> o#foo) should work though
<kagebe> ah
<kagebe> yes, I guess
<kagebe> but there is no builtin syntax to get a lambda with that semantics, I gather?
<ggole> (fun o -> o#foo) obj arg instead of obj#foo arg is a bit strange
<kagebe> but sometimes useful, if you pass around this function
<Drup> kagebe: no shortcut, no
ulfdoz has joined #ocaml
<kagebe> in my case I (currently) have a class whose objects I want to test for equality in an oUnit test case, so I needed to pass an equality and printer function to assert_equal
<companion_cube> ggole: not if you want this particular function
<ggole> You mean, like let f accessor = accessor obj zonk?
<kagebe> and if those are only defined within the class...
<companion_cube> you mean the methods are private?
RMacy is now known as RMacy|Away
RMacy|Away has quit []
<kagebe> no, but I don't have an object on which to call them, i.e. assert_equal ~cmp:(fun o1 o2 -> o1#equal o2)
<kagebe> so I would need to build that lambda/extract the method from the class in this way
<kagebe> or simply don't use a class in the first place
<Drup> just use the lambda as you typed it
<Drup> it's not short, but it works
<ggole> Can classes mutually recurse?
<kagebe> true, but I think I'll just get rid of the class, extract the methods to a module and the state to a type
Arsenik has joined #ocaml
johnelse is now known as johnelse_away
avsm has quit [Quit: Leaving.]
RMacy has joined #ocaml
introom has quit [Ping timeout: 244 seconds]
mort___ has joined #ocaml
nikki93 has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
jwatzman|work has joined #ocaml
jonludlam has quit [Remote host closed the connection]
angerman has quit [Ping timeout: 240 seconds]
mort___ has quit [Quit: Leaving.]
AltGr has left #ocaml []
sw1nn has quit [Ping timeout: 240 seconds]
kagebe has quit [Ping timeout: 265 seconds]
ikaros has quit [Quit: Ex-Chat]
axiles has quit [Quit: Quitte]
nikki93 has quit [Remote host closed the connection]
claudiuc has quit [Remote host closed the connection]
dsheets has quit [Read error: Operation timed out]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
struktured has joined #ocaml
xianxu has joined #ocaml
RMacy is now known as RMacy|Away
RMacy|Away has quit []
RMacy has joined #ocaml
avsm has joined #ocaml
q66 has joined #ocaml
<pippijn> I want to install some data files along with my ocamlfind package. now how do I find those back at runtime?
axiles has joined #ocaml
<adrien> you store the path?
<pippijn> into the binary?
<adrien> for instance
<pippijn> hm, ok
<pippijn> so I need to generate a file containing the installation path
<adrien> I don't really like that but there aren't many alternatives
angerman has joined #ocaml
<pippijn> can ocamlfind tell me where it would be installing my package, if I were going to install it?
<pippijn> or just tell me the libdir
<adrien> it can tell you the one that is currently in effect
<adrien> might not be the one you're after
<pippijn> I guess it'll do for now
<pippijn> ah yes, destdir
jonludlam has joined #ocaml
Hannibal_Smith has joined #ocaml
<ggole> Why not store the relative path?
<adrien> you could store the various values defined at compile-time
<adrien> if a resource cannot be found
<adrien> try to make things relative
claudiuc has joined #ocaml
dsheets has joined #ocaml
tane has joined #ocaml
xianxu has quit [Ping timeout: 264 seconds]
avsm has quit [Quit: Leaving.]
MisterGeppetto has quit [Ping timeout: 265 seconds]
nikki93 has joined #ocaml
lostcuaz_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arj has joined #ocaml
nikki93 has quit [Ping timeout: 240 seconds]
Hannibal_Smith has quit [Quit: Sto andando via]
nikki93 has joined #ocaml
pyon has left #ocaml []
BitPuffin has joined #ocaml
ulfdoz has quit [Ping timeout: 244 seconds]
Puff has joined #ocaml
BitPuffin has quit [Read error: Connection reset by peer]
freemanv has joined #ocaml
_andre has quit [Quit: leaving]
ggole has quit []
angerman has quit [Quit: Gone]
hyperboreean has quit [Ping timeout: 264 seconds]
lostcuaz has joined #ocaml
lostcuaz has quit [Read error: Connection reset by peer]
lostcuaz has joined #ocaml
lostcuaz has quit [Client Quit]
lostcuaz has joined #ocaml
Puff has quit [Read error: Operation timed out]
ollehar has joined #ocaml
xianxu has joined #ocaml
freemanv has quit [Remote host closed the connection]
BitPuffin has joined #ocaml
avsm has joined #ocaml
tulloch has joined #ocaml
RMacy is now known as RMacy|Away
venk has joined #ocaml
RMacy|Away has quit []
venk` has joined #ocaml
tulloch has quit [Ping timeout: 240 seconds]
venk has quit [Ping timeout: 240 seconds]
<bernardofpc> is menhir to ocamlyacc like bison to yacc ?
<pippijn> bernardofpc: no
<pippijn> bernardofpc: why do you ask?
tulloch has joined #ocaml
<companion_cube> menhir is a better ocamlyacc
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
BitPuffin has quit [Ping timeout: 244 seconds]
xianxu has quit [Ping timeout: 240 seconds]
<pippijn> that is right
eni has joined #ocaml
<bernardofpc> to know if it has features from bison
<def-lkb> both ocamlyacc & menhir provide symbol location
<bernardofpc> well, from RWO example, the way to track line numbers is by doing the management onself
<bernardofpc> (and menhir's manual is a bit dry :/)
xianxu has joined #ocaml
arj has quit [Quit: Leaving.]
<def-lkb> in menhir, use $startpos $endpos to have startpos/endpos of the whole input being reduced
<companion_cube> managing of newlines is through Lexing.lexbuf
<companion_cube> (calling Lexing.new_line when needed)
<def-lkb> or $startpos(ident) $endpos(ident) for a specific symbol, where ident is either an explicit identifier you gave or the number of the symbol
<companion_cube> otherwise, you can access positions in menhir rules assuming this lexing part is done correctly
<bernardofpc> well, the real thing I want to do is print context of the error
<bernardofpc> so I could do it the C way with fseek() and such
<bernardofpc> (without having newlines ever entering the field)
<def-lkb> context? like apart of the source file?
<bernardofpc> imagine there's an invalid sequence, like 1 += 4
<bernardofpc> (the += being invalid for the grammar)
<companion_cube> the position you want is just an offset then?
<companion_cube> Lexing.lexbuf contains the offset (number of bytes read) afair
<bernardofpc> I would like to have the += highlighted and the 1 before it appearing
<bernardofpc> and I would like to print "line %d, position %d"
<def-lkb> FWIW, you can leekup ocamllex source: it's done in the C-way, seek, copy :P
<def-lkb> but it's not for handling errors.
<bernardofpc> can I do that if it's a stream (not a file) ?
<def-lkb> so the problem is that there is a grammatical error --not a lexical one-- in your input, and you want to print relevant information?
<bernardofpc> yes
<bernardofpc> it raises Parsing.Parse_error
<def-lkb> (I insists because if there is an error, then by default there is no reduction, so your action won't be executed, similarly to bison)
<def-lkb> …not with a stream, seeking is not allowed (that would require keeping an unbounded amount of data)
<bernardofpc> right
<bernardofpc> so must I insert Lexing.new_line lexbuf; at each '\n' ?
manizzle has joined #ocaml
<bernardofpc> (thus having to explicitly separate '\n' from whitespace ?)
<def-lkb> yes, this has to be part of your lexer
<bernardofpc> :/
<bernardofpc> (anyway, this is ocamllex, not yacc nor menhir, but well)
<bernardofpc> so how can I print the error context (in the favorable case it is a file) from inside the .mly file ?
<bernardofpc> better asked: how can my parser+lexer know that it has a file when it only receives a lexbuf ?
<def-lkb> you have to handle that elsewhere
<def-lkb> code calling the parser is a nice place to start from :p
<bernardofpc> so I have to somehow return all offsets + eventual error message + eventual parsing stage where it was found in an exception (say) ?
<def-lkb> no, you can also use the special error token from menhir
<def-lkb> there is an error recovery mode in menhir
<bernardofpc> this is a production rule, isn't it ?
<def-lkb> otherwise, when there is an error, you can still get the position from lexbuf
<def-lkb> error has to be part of a rule yes
axiles has quit [Remote host closed the connection]
<bernardofpc> and from that production rule I do "raise Parse_invalid(positions,message)" ?
<companion_cube> it's nice to have some code wrapping calls to the parser with better error handling, indeed
<def-lkb> for instance :)
<def-lkb> (merlin has many layers of hack around parser :P)
tulloch has quit [Ping timeout: 244 seconds]
<def-lkb> j0sh: did you took time to report the bug you had with exceptions?
Hannibal_Smith has joined #ocaml
<bernardofpc> the $startof and siblings will be correct in error { } ? or can I only believe Lexing stuff ?
<def-lkb> $startpos*, yes everything will be correct
<def-lkb> technically speaking, the parser is in a safe state, but part of the stack was dropped
Thooms has quit [Quit: WeeChat 0.3.8]
Tamae has joined #ocaml
venk` is now known as venk
Arsenik has quit [Remote host closed the connection]
Kakadu has quit [Quit: Konversation terminated!]
zpe has joined #ocaml
sw1nn has joined #ocaml
zpe has quit [Remote host closed the connection]
RMacy has joined #ocaml
zpe has joined #ocaml
eni has quit [Remote host closed the connection]
maattdd has quit [Ping timeout: 252 seconds]
zpe has quit [Ping timeout: 244 seconds]
nikki93 has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
nikki93 has joined #ocaml
nikki93 has quit [Ping timeout: 264 seconds]
tane has quit [Quit: Verlassend]
RMacy is now known as RMacy|Away
RMacy|Away has quit []
sw1nn has quit [Ping timeout: 264 seconds]
S11001001 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
jao has quit [Ping timeout: 264 seconds]
sw1nn has joined #ocaml
lostcuaz has joined #ocaml
Hannibal_Smith has quit [Quit: Sto andando via]
darkf has joined #ocaml
RMacy has joined #ocaml
RMacy is now known as RMacy|Away
sw1nn` has joined #ocaml
sw1nn` is now known as Guest61437
sw1nn has quit [Ping timeout: 240 seconds]
RMacy|Away has quit [Client Quit]
Guest61437 is now known as sw1nn
ikaros has joined #ocaml
zpe has joined #ocaml
nikki93 has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
struktured has quit [Ping timeout: 240 seconds]
sw1nn has quit [Remote host closed the connection]
Tamae has quit [Read error: Connection reset by peer]
rand000 has quit [Quit: leaving]
Tamae has joined #ocaml
ontologiae has quit [Ping timeout: 252 seconds]
xianxu has quit [Ping timeout: 264 seconds]
wolfnn has quit [Ping timeout: 265 seconds]
travisbrady has quit [Ping timeout: 265 seconds]
divyanshu has quit [Quit: Textual IRC Client: www.textualapp.com]