flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.01.0 http://bit.ly/1851A3R | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
talzeus has joined #ocaml
dant3 has quit [Ping timeout: 264 seconds]
boogie has quit [Remote host closed the connection]
S11001001 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
thomasga has quit [Quit: Leaving.]
zpe has joined #ocaml
zpe has quit [Ping timeout: 252 seconds]
nikki93 has joined #ocaml
talzeus_ has joined #ocaml
nikki93 has quit [Read error: Operation timed out]
talzeus has quit [Ping timeout: 272 seconds]
talzeus_ has quit [Read error: Connection reset by peer]
s4muel has quit [Read error: Operation timed out]
wormphlegm has quit [Ping timeout: 272 seconds]
dant3 has joined #ocaml
s4muel has joined #ocaml
talzeus has joined #ocaml
wormphlegm has joined #ocaml
dant3 has quit [Ping timeout: 260 seconds]
wolfnn has quit [Quit: Leaving.]
kyrylo has quit [Read error: Connection reset by peer]
talzeus has quit [Remote host closed the connection]
kyrylo has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 248 seconds]
talzeus_ has joined #ocaml
ygrek has joined #ocaml
nikki93 has joined #ocaml
nikki93 has quit [Ping timeout: 272 seconds]
lostcuaz has joined #ocaml
nikki93 has joined #ocaml
Eyyub has quit [Quit: Lost terminal]
dant3 has joined #ocaml
boogie has joined #ocaml
dant3 has quit [Ping timeout: 252 seconds]
olasd has quit [Read error: Connection reset by peer]
mgaogw has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
csakatoku has joined #ocaml
olasd has joined #ocaml
zpe has joined #ocaml
kyrylo has quit [Ping timeout: 272 seconds]
cross has quit [Quit: leaving]
zpe has quit [Ping timeout: 245 seconds]
ygrek has joined #ocaml
cross has joined #ocaml
Don_Pellegrino has joined #ocaml
cross has quit [Client Quit]
cross has joined #ocaml
fayden has quit [Read error: Connection reset by peer]
fayden has joined #ocaml
boogie has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
boogie has joined #ocaml
<mgaogw> ocaml noob - can i have some direction in how to set up a map of strings to a list of strings?
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
werebutt has joined #ocaml
werebutt has left #ocaml []
dant3 has joined #ocaml
dant3 has quit [Ping timeout: 245 seconds]
mgaogw has quit [Quit: mgaogw]
yacks has joined #ocaml
zpe has joined #ocaml
boogie has quit [Remote host closed the connection]
siddharthv_away is now known as siddharthv
zpe has quit [Ping timeout: 264 seconds]
boogie has joined #ocaml
jao has quit [Ping timeout: 248 seconds]
kizzx2 has quit [Quit: Leaving.]
csakatok_ has joined #ocaml
csakatok_ has quit [Remote host closed the connection]
csakatoku has quit [Ping timeout: 272 seconds]
Don_Pellegrino has quit [Quit: .]
mgaogw has joined #ocaml
<mgaogw> Hi all - I'm trying to make a map of strings to ints but I'm unsure of how to correctly import the module I need, or how to set this up - could I have some help?
dant3 has joined #ocaml
dant3 has quit [Ping timeout: 272 seconds]
ggole has joined #ocaml
Yoric has quit [Ping timeout: 265 seconds]
cantstanya has joined #ocaml
nisstyre has quit [Quit: Leaving]
mgaogw has quit [Quit: mgaogw]
zpe has joined #ocaml
csakatoku has joined #ocaml
Yoric has joined #ocaml
zpe has quit [Ping timeout: 265 seconds]
philtor has joined #ocaml
mgaogw has joined #ocaml
fantasticsid has joined #ocaml
Simn has quit [Ping timeout: 252 seconds]
dant3 has joined #ocaml
<mgaogw> How can I easily print the key value pairs of a map?
ygrek has quit [Ping timeout: 240 seconds]
dant3 has quit [Ping timeout: 264 seconds]
<ggole> Map.iter?
<mgaogw> ggole: specifically 'Map.iter print_string my map' ?
<ggole> Actually it would be FooMap, since you'd be defining a module to use Map.
<ggole> ie, FooMap = Map.Make (Foo);; FooMap.iter (fun key value -> print_key key; print_value; value) my_map
Simn has joined #ocaml
axiles has joined #ocaml
mmachenry has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
mgaogw has quit [Quit: mgaogw]
philtor has quit [Ping timeout: 252 seconds]
mgaogw has joined #ocaml
manizzle has quit [Ping timeout: 260 seconds]
<mgaogw> ggole: Thanks!
mgaogw has quit [Client Quit]
wwilly has quit [Quit: This computer has gone to sleep]
wwilly has joined #ocaml
mchqwerty has joined #ocaml
yacks has quit [Read error: Connection reset by peer]
ygrek has joined #ocaml
cesar_ has joined #ocaml
zed_ has joined #ocaml
cesar_ is now known as Guest34893
Guest34893 has quit [Remote host closed the connection]
zxqdms has joined #ocaml
darklajid has joined #ocaml
fdagnat has quit [Quit: Leaving.]
boogie has quit [Remote host closed the connection]
fdagnat has joined #ocaml
fdagnat has quit [Client Quit]
Yoric has quit [Ping timeout: 264 seconds]
boogie has joined #ocaml
zpe has joined #ocaml
boogie has quit [Remote host closed the connection]
yacks has joined #ocaml
zpe has quit [Ping timeout: 272 seconds]
dant3 has joined #ocaml
zxqdms has quit [Quit: leaving]
zed_ has quit [Ping timeout: 245 seconds]
boogie has joined #ocaml
<mmachenry> I have installed ocaml, along with some ocaml libraries (shout for example) using apt-get on Ubuntu. I then installed opam and have installed another library with opam (mm). I now have two ocamlfind binaries on my machine and one can only find opam stuff and one can find only apt-get stuff. This is causing my build to break.
<mmachenry> Is there a recommended way of having opam and apt-get install packages on my machine?
boogie has quit [Read error: Connection reset by peer]
boogie has joined #ocaml
dant3 has quit [Remote host closed the connection]
boogie has quit [Ping timeout: 264 seconds]
jonludlam has quit [Remote host closed the connection]
<gasche> mmachenry: the easiest way forward is to have a switch (different from 'system') with only OPAM libraries
<gasche> I used apt-get to install OCaml software that I use (e.g. Coq), and opam to install separate development environments
<gasche> (I agree your wish is reasonable but opam is young and currently this workflow is not well-supported)
<mmachenry> How do I make a switch?
dant3 has joined #ocaml
<gasche> mmachenry: "opam switch list" will show you a list of available switches
<gasche> then "opam switch install <switch>" will setup a given switch
<gasche> and then you can switch between, ahem, switches, using "opam switch <foo>", "opam switch <bar>"
<gasche> the switch corresponding to your system packages being called 'system'
<gasche> (remark) non-system switches are installed in your HOME by default, so they don't need admin right for package install
<mmachenry> I have to read up on switches. Will this allow ocamlfind to search two different paths?
<ggole> Is it just me, or is the precedence of 'as' in match expressions not as useful as it could be?
<mmachenry> At once
<gasche> mmachenry: no, it will merely let you cleanly separate the two worlds
<gasche> ggole: subjective position
<mmachenry> Hm... what if I want to build something that requires libraries I can only get from apt-get and others I can only get from opam?
<gasche> I often find myself having to put parenthesis around '.. as x', but then other people would be annoyed if they had to use them around the .. here
<gasche> mmachenry: if you are thinking of system libraries (which you need for OCaml bindings or what), use apt-get, they'll be "visible" from all switches
<ggole> Precedence is probably the wrong term. Specifically, I'm annoyed that Foo({a = 1} as x, {a = 1}) is a syntax error, whereas it seems to be sensible, useful and natural.
<gasche> if you are thinking of OCaml libraries, package them via OPAM and install them from there
<ggole> Right.
<gasche> if you're thinking of a library that has both non-ocaml and OCaml components... still OPAM packaging seems the better choice
<gasche> rixed_: it's correct on my machine
<gasche> sorry
<gasche> ggole:
<mmachenry> gasche: I should make my own opam package for these libraries that I'm apt-get installing?
<gasche> if they're not available via OPAM? yeah, that would make sense
<gasche> package them, and add them to the main public repo
<gasche> mmachenry: I mean, the social trend in the OCaml community is such that it's reasonable to plan that there will be *more* packages available via OPAM than Debian (and it's easier to package for OPAM than Debian right now)
<ggole> gasche: never mind, I'm confused by this code I've written. It is precedence that I'm bitching about: Foo({a = 1}, {a = 1} as x) is the proper example.
<gasche> ggole: it's still correct, just maybe not what you want
<ggole> Right.
<gasche> my personal technique is to always put parenthesis around "as", except when it's obviously unnecessary
<ggole> I suppose this is mostly a problem caused by 'overloading' the meaning of comma.
fdagnat has joined #ocaml
<gasche> ah yeah, it depends on the number of parameters of Foo, sorry
<mmachenry> gasche: Is `which ocamlfind` on your environment = ~/.opam/system/bin/ocamlfind?
<gasche> I said whether this precedence is the most convenient one is a subjective question
<mmachenry> Or do you use /usr/bin/ocamlfind?
<gasche> mmachenry: /usr/bin/ocamlfind
<gasche> (when I run (opam config exec --switch=system "which ocamlfind"))
cago has joined #ocaml
<gasche> ggole: however, I do agree that, based on visual syntax, we would expect a tighter precedence for "as"
<mmachenry> gasche: Do you install things with opam and if so, how does that ocamlfind find them?
zpe has joined #ocaml
<gasche> mmachenry: I mostly never use the "system" switch, but others (4.01.0 currently), in which everything is opam-installed
AltGr has joined #ocaml
csakatoku has quit [Remote host closed the connection]
<gasche> ggole: I think it's because in the rest of OCaml's syntax, words bind tighter than non-alphabetic symbols
ggole has quit [Ping timeout: 245 seconds]
zpe has quit [Ping timeout: 252 seconds]
csakatoku has joined #ocaml
troydm has quit [Ping timeout: 252 seconds]
ggole has joined #ocaml
Simn has quit [Ping timeout: 252 seconds]
Thooms has joined #ocaml
ohama has quit [Read error: Operation timed out]
mal`` has quit [Read error: Operation timed out]
fdagnat has quit [Read error: Operation timed out]
ohama has joined #ocaml
mal`` has joined #ocaml
BiDOrD has quit [Read error: Operation timed out]
BiDOrD has joined #ocaml
mmachenry has quit [Quit: Leaving.]
fdagnat has joined #ocaml
zRecursive has quit [Remote host closed the connection]
boogie has joined #ocaml
mika1 has joined #ocaml
Thooms has quit [Ping timeout: 252 seconds]
boogie has quit [Ping timeout: 272 seconds]
dant3 has quit [Remote host closed the connection]
nikki93 has quit [Remote host closed the connection]
zpe has joined #ocaml
mort___ has joined #ocaml
csakatoku has quit []
zpe has quit [Ping timeout: 260 seconds]
demonimin has quit [Ping timeout: 252 seconds]
ohama has quit [Read error: Operation timed out]
mchqwerty has quit [Read error: Operation timed out]
mchqwerty has joined #ocaml
ohama has joined #ocaml
agnoctone has joined #ocaml
Kakadu has joined #ocaml
dant3 has joined #ocaml
thomasga has joined #ocaml
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ggole has quit [Ping timeout: 260 seconds]
jonludlam has joined #ocaml
boogie has joined #ocaml
thomasga has quit [Quit: Leaving.]
FreeArtMan has joined #ocaml
boogie has quit [Ping timeout: 272 seconds]
thomasga has joined #ocaml
Thooms has joined #ocaml
ggole has joined #ocaml
johnelse_away is now known as johnelse
jonludlam has quit [Ping timeout: 245 seconds]
_andre has joined #ocaml
zpe has joined #ocaml
jonludlam has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
zpe has joined #ocaml
Simn has joined #ocaml
Yoric has joined #ocaml
agnoctone has quit [Ping timeout: 245 seconds]
ontologiae has joined #ocaml
frankbutt has joined #ocaml
frankbutt has left #ocaml []
eikke has joined #ocaml
<eikke> is there, in oasis, any way to define multiple search/include paths for an executable & its modules?
dant3 has quit [Remote host closed the connection]
demonimin has joined #ocaml
<companion_cube> doesn't a simple list work?
<companion_cube> src : foo/ bar/ baaz/ ?
<companion_cube> or maybe it's the list of modules in which you can specify paths relative to "src:"
boogie has joined #ocaml
<companion_cube> or you can tweak the _tags file by youself (at the end)
boogie has quit [Ping timeout: 252 seconds]
dant3 has joined #ocaml
dant3 has quit [Ping timeout: 245 seconds]
FreeArtMan has quit [Read error: Connection reset by peer]
FreeArtMan has joined #ocaml
dant3 has joined #ocaml
<eikke> tweaking tags didnt work out on first sight because dependent packages are listed only for the configured Path
<eikke> using a list neither, because the string is used as-is in the generated _tags file, which makes ocamlbuild cry
ontologiae has quit [Quit: WeeChat 0.4.0]
kizzx2 has joined #ocaml
kizzx2 has quit [Max SendQ exceeded]
kizzx2 has joined #ocaml
avsm has joined #ocaml
skchrko has joined #ocaml
kyrylo has joined #ocaml
FreeArtMan has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 240 seconds]
FreeArtMan has joined #ocaml
Eyyub has joined #ocaml
dsheets_ has quit [Ping timeout: 245 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
michael_lee has joined #ocaml
zpe has quit [Ping timeout: 252 seconds]
<hcarty> Using Ctypes, what is the proper way to send a pointer-to-a-pointer (ex. void **) to a function which will allocate a pointed-to value if the given point is not null? The specific function I'm looking at wrapping is: http://www.gdal.org/ogr/ogr__api_8h.html#a2da3630231780d519543d1679c83e62f
talzeus_ has quit [Remote host closed the connection]
dant3 has quit [Remote host closed the connection]
boogie has joined #ocaml
<hcarty> The pahDriverList pointer is updated if it is not NULL. My attempt uses (string @-> int @-> ptr (ptr void) @-> returning t) where type t is a unit ptr.
<companion_cube> no idea
<companion_cube> o/ hcarty
boogie has quit [Read error: Connection reset by peer]
patojo has joined #ocaml
<adrien_oww> \o
<hcarty> companion_cube and adrien_oww: \o/
<companion_cube> :)
<hcarty> companion_cube: Ctypes is almost amazing. I expect that I will find it to be completely amazing once I am no longer ignorant of how to properly apply it.
<companion_cube> heh
<companion_cube> I don't recall, are there performance losses when one uses Ctypes?
patojo has quit [Ping timeout: 252 seconds]
dsheets_ has joined #ocaml
FreeArtMan has quit [Read error: Connection reset by peer]
<hcarty> companion_cube: Yes, although those may be mitigated/avoided if you use the upcoming stub generation functionality.
<hcarty> I haven't measured the performance loss to see how significant it is
Eyyub has quit [Ping timeout: 264 seconds]
kizzx2 has quit [Quit: Leaving.]
siddharthv is now known as siddharthv_away
FreeArtMan has joined #ocaml
Eyyub has joined #ocaml
FreeArtMan has quit [Read error: Connection reset by peer]
FreeArtMan has joined #ocaml
dant3 has joined #ocaml
dant3 has quit [Read error: Connection reset by peer]
dant3 has joined #ocaml
dant3 has quit [Remote host closed the connection]
dant3 has joined #ocaml
FreeArtMan has quit [Client Quit]
ygrek has joined #ocaml
kizzx2 has joined #ocaml
kizzx2 has quit [Client Quit]
zpe has joined #ocaml
rand000 has joined #ocaml
<eikke> join #webkitgtk+
Eyyub has quit [Read error: Operation timed out]
darklajid has quit [Quit: leaving]
yacks has quit [Remote host closed the connection]
<adrien_oww> :D
boogie has joined #ocaml
<adrien_oww> eikke: with ocaml?
<eikke> adrien_oww: nope. new laptop, new keyboard, missed the /
<eikke> hidpi laptop, and webkitgtk font rendering is terrible, so looking for help :-)
<adrien_oww> ah :)
boogie has quit [Ping timeout: 252 seconds]
fdagnat has quit [Ping timeout: 252 seconds]
shinnya has joined #ocaml
malo has quit [Quit: Leaving]
diginux__ is now known as wilberine
Thooms has quit [Ping timeout: 252 seconds]
ollehar1 has quit [Ping timeout: 265 seconds]
jonludlam has quit [Remote host closed the connection]
Eyyub has joined #ocaml
avsm has quit [Quit: Leaving.]
thomasga has quit [Quit: Leaving.]
kyrylo has quit [Quit: Viva la revolucion!]
dant3 has quit [Remote host closed the connection]
<adrien_oww> http://ocsigen.org/lwt/api/Lwt_unix#VALof_unix_file_descr says "Note that the blocking mode is less efficient than the non-blocking one, so it should be used only for file descriptors that does not support asynchronous operations, such as regular files, or for shared descriptors such as Lwt_unix.​stdout, Lwt_unix.​stderr or Lwt_unix.​stdin."
<adrien_oww> what does it mean with "shared descriptors"?
<adrien_oww> descriptors used by several tasks at once?
<adrien_oww> what if I set Lwt_unix.stdin as non-blocking later on? do I get the whole speed back?
FreeArtMan has joined #ocaml
dant3 has joined #ocaml
mort___ has quit [Ping timeout: 240 seconds]
boogie has joined #ocaml
boogie has quit [Ping timeout: 240 seconds]
FreeArtMan has quit [Read error: Connection reset by peer]
FreeArtMan has joined #ocaml
avsm has joined #ocaml
yacks has joined #ocaml
jonludlam has joined #ocaml
thomasga has joined #ocaml
thomasga1 has joined #ocaml
thomasga2 has joined #ocaml
thomasga3 has joined #ocaml
thomasga has quit [Ping timeout: 245 seconds]
FreeArtMan has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
FreeArtMan has joined #ocaml
thomasga1 has quit [Ping timeout: 245 seconds]
thomasga2 has quit [Ping timeout: 245 seconds]
thomasga has joined #ocaml
darkf has quit [Quit: Leaving]
thomasga3 has quit [Ping timeout: 245 seconds]
dant3 has quit [Remote host closed the connection]
dant3 has joined #ocaml
avsm has quit [Quit: Leaving.]
talzeus has joined #ocaml
talzeus_ has joined #ocaml
FreeArtMan has quit [Read error: Connection reset by peer]
FreeArtMan has joined #ocaml
talzeus has quit [Ping timeout: 272 seconds]
shinnya has quit [Ping timeout: 240 seconds]
Celelibi has joined #ocaml
<Celelibi> Hello
<adrien_oww> hi
<Celelibi> Is it possible to apply a pattern matching on functions?
avsm has joined #ocaml
<Celelibi> So that I could do something different whether the function return an int, or of it starts with an "if".
<Celelibi> That kind of stuff.
<companion_cube> no, functions are opaque values
<bernardofpc> probably no
<companion_cube> you can't even check for equality of functions
<bernardofpc> you could make up special types to carry that information, like type my_fun = Starts_with_if of 'a -> b | Maps_to_int of 'a -> int
<bernardofpc> (probably using GADT's for all those ....)
<gasche> Celelibi: what are you trying to do?
<companion_cube> you're going to need some type parameters here
<bernardofpc> right companion_cube
<Celelibi> gasche: nothing special, I was just discussing with a collegue.
<Celelibi> And that question came to my mind.
<gasche> ok, then "no" is the answer
Eyyub has quit [Ping timeout: 264 seconds]
<gasche> note that it is a very *good* thing that you cannot distinguish functions based on such intensional details (than "starting with an if"); otherwise you couldn't reason about your code at all
mchqwerty has quit [Quit: Odcházím]
<companion_cube> right, all a function exposes is its type
<gasche> if you cannot rewrite f (fun () -> if true then a else b) into f (fun () -> a) without knowing f's implementation, you're in trouble
mchqwerty has joined #ocaml
<bernardofpc> well, not so much since you cannot deconstruct based on the type
<companion_cube> bernardofpc: deconstructing functions doesn't make much sense
<companion_cube> anyway
<Celelibi> Why not?
<bernardofpc> +1
<Celelibi> That way you could build new functions.
<companion_cube> because a function is not its code
<bernardofpc> companion_cube: meaning by type
Eyyub has joined #ocaml
boogie has joined #ocaml
<companion_cube> ah
<companion_cube> that would require keeping types at runtime
<companion_cube> apart from that, I guess it breaks polymorphism
<gasche> (parametricity)
<Celelibi> That would break static analysis, for sure.
<companion_cube> whatever :p
<companion_cube> (sorry gasche)
kyrylo has joined #ocaml
<ggole> I can imagine an implementation that could allow you to do that
saml has joined #ocaml
<ggole> By, say, constructing a table mapping code pointer to whatever information you want to match against
<ggole> I'm not sure it would be useful though.
boogie has quit [Ping timeout: 245 seconds]
thomasga has quit [Ping timeout: 245 seconds]
zump is now known as zmp
michael_lee has quit [Remote host closed the connection]
<companion_cube> don't forget the closures
<companion_cube> partial application means that depending on which value you're partially applied on, the code that is to be executed changes
<companion_cube> fun x -> if x = 0 then (fun y -> y*2) else fun y -> y+1
<companion_cube> how to match (f 1) if f is this function?
<ggole> Closures could be inspected because they contain the (information-bearing) code pointer and all other distinguishing state.
<ggole> It's not clear exactly what the interface would be, but you could do it.
lostcuaz has joined #ocaml
<gasche> it's quite clear that you wouldn't necessarily want to program in a language that gives this ability to your adversaries^Wcoworkers
<adrien_oww> (I concur with the fact the attackers are nicer to work with than coworkers)
<ggole> It does seem like you could wreak untold evil, but on the other hand, in which language are you not already able to do that?
mchqwerty has quit [Ping timeout: 264 seconds]
dant3 has quit [Remote host closed the connection]
Enjolras has quit [Ping timeout: 272 seconds]
cesar_ has joined #ocaml
cesar_ is now known as Guest93816
mchqwerty has joined #ocaml
<gasche> ggole: "we're already doomed, why not allow this one as well?" :p
mchqwerty has quit [Remote host closed the connection]
mchqwerty has joined #ocaml
ocp has joined #ocaml
thomasga has joined #ocaml
<companion_cube> looks like ocamlpro is invading the chan
Eyyub has quit [Ping timeout: 252 seconds]
Enjolras has joined #ocaml
mika1 has quit [Quit: Leaving.]
Eyyub has joined #ocaml
boogie has joined #ocaml
S11001001 has joined #ocaml
S11001001 has quit [Changing host]
S11001001 has joined #ocaml
boogie has quit [Ping timeout: 240 seconds]
FreeArtMan has quit [Read error: Connection reset by peer]
FreeArtMan has joined #ocaml
travisbrady has joined #ocaml
nlucaroni has joined #ocaml
mcclurmc has joined #ocaml
Eyyub has quit [Ping timeout: 252 seconds]
Eyyub has joined #ocaml
FreeArtMan has quit [Read error: Connection reset by peer]
FreeArtMan has joined #ocaml
cago has left #ocaml []
yacks has quit [Quit: Leaving]
FreeArtMan has quit [Read error: Connection reset by peer]
FreeArtMan has joined #ocaml
kyrylo has quit [Read error: Operation timed out]
Guest93816 has quit [Remote host closed the connection]
mcclurmc has quit [Remote host closed the connection]
FreeArtMan has quit [Read error: Connection reset by peer]
FreeArtMan has joined #ocaml
mort___ has joined #ocaml
alex____ has joined #ocaml
mchqwerty has quit [Quit: Odcházím]
<alex____> Hi, I'm a student with a quick question. I'm getting a Syntax error, and can't figure out why. I declare a type optional_string with `type optional_string = None | String of string;;`. Later I try to read in a line and make it an optional string, `let opt_line = String read_line() in (* more lines *)`. Here's the pastebin: http://pastebin.com/nNnN5hJ6
<companion_cube> you need parentheses around (read_line ())
FreeArtMan has quit [Read error: Connection reset by peer]
<Drup> and you need something after the in
<companion_cube> also, you shouldn't use "None" as a variant, because it's already used a lot in OCaml
<companion_cube> right
FreeArtMan has joined #ocaml
mcclurmc has joined #ocaml
<alex____> Drup: Sorry, I did a bad job copying and pasting: http://pastebin.com/wKE9B9g7
<mrvn> just use string option
<alex____> mrvn: H/o, let me google that. I didn't know it exists
<mrvn> string exists and 'a option.
<alex____> mrvn: Okay, cool. I'll try to use that. I'd like to know the source of the syntax error though, since it shows a lack of understanding and I'd like to get better with OCaml.
zpe has quit [Remote host closed the connection]
<Drup> alex____: as companion_cube said
Kakadu has quit [Ping timeout: 245 seconds]
<alex____> Drup: Oh! Sorry. I didn't see that
<alex____> companion_cube: Thanks!
zpe has joined #ocaml
<Drup> if it's not enough, then your syntax error is in one of the "do stuff"
FreeArtMan has quit [Read error: Connection reset by peer]
<alex____> Drup: That was it.
jwatzman|work has joined #ocaml
FreeArtMan has joined #ocaml
<alex____> Drup, companion_cube: Thanks1
<companion_cube> no pb
zpe has quit [Ping timeout: 240 seconds]
<alex____> companion_cube: I tried using Option, but it says the module is unbound. Is it no longer a part of standard OCaml?
<companion_cube> there is no Option module, but the type 'a option = None | Some of 'a is in Pervasives
<jbrown> I think Option was in Extlib, maybe other 3rd-party libs
<alex____> How do I get an options value then?
<jbrown> pattern matching
<Drup> alex____: the same as you are doing now, use the constructors
jonludlam has quit [Remote host closed the connection]
<ggole> Specifically, None or Some expr
<alex____> jbrown, ggole: Okay, I think I know how to do it with pattern matching
<alex____> Drup: Constructors? Let's say I do `let s = Some (read_line()) in (* \n *) print_endline s;`
<Drup> you can't print it, it's not a string, it's a string option =)
<companion_cube> won't work, because print_endline requires a string, not a string option
Yoric has quit [Ping timeout: 252 seconds]
<ggole> Constructor is (roughly) the term for the capitalised name that you use to create a data type value
dfarm has joined #ocaml
<alex____> Hm...okay. Let me try to match it then.
<alex____> Did it! Thanks!
<ggole> Did it print a warning?
rand000 has quit [Ping timeout: 272 seconds]
<alex____> ggole: It did. One about the pattern matching being not exhaustive.
boogie has joined #ocaml
<ggole> Ok. You can ignore that for test code, if you like, but do be aware that it is considered good practice to remove all warnings for real code.
<ggole> (You remove them by handling the missing case somehow.)
<ggole> This is because exhaustiveness checking tends to find quite a few bugs when used thoughtfully.
boogie has quit [Client Quit]
<alex____> ggole: Alright, fixed it.
<alex____> ggole: I know. I'm had some experience with Rust.
<ggole> Ah, right.
mort___ has quit [Quit: Leaving.]
Kakadu has joined #ocaml
Thooms has joined #ocaml
boogie has joined #ocaml
skchrko has quit [Ping timeout: 245 seconds]
ollehar has quit [Ping timeout: 245 seconds]
thomasga has quit [Ping timeout: 245 seconds]
FreeArtMan has quit [Read error: Connection reset by peer]
mort___ has joined #ocaml
ocp has quit [Read error: Operation timed out]
avsm has quit [Quit: Leaving.]
dfarm has quit [Quit: Leaving]
mort___ has quit [Quit: Leaving.]
FreeArtMan has joined #ocaml
nikki93 has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
FreeArtMan has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
FreeArtMan has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
travisbrady has quit [Quit: travisbrady]
travisbrady has joined #ocaml
FreeArtMan has quit [Read error: Connection reset by peer]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
skchrko has joined #ocaml
Anarchos has joined #ocaml
malo has joined #ocaml
Arsenik has joined #ocaml
dsheets_ has quit [Ping timeout: 245 seconds]
FreeArtMan has joined #ocaml
FreeArtMan has quit [Read error: Connection reset by peer]
FreeArtMan has joined #ocaml
ontologiae has joined #ocaml
skchrko has quit [Quit: Leaving]
FreeArtMan has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
FreeArtMan has joined #ocaml
zpe has quit [Ping timeout: 265 seconds]
FreeArtMan has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 252 seconds]
FreeArtMan has joined #ocaml
eikke has quit [Ping timeout: 264 seconds]
dsheets_ has joined #ocaml
eikke has joined #ocaml
manizzle has joined #ocaml
FreeArtMan has quit [Read error: Connection reset by peer]
FreeArtMan has joined #ocaml
FreeArtMan has quit [Read error: Connection reset by peer]
FreeArtMan has joined #ocaml
thomasga has joined #ocaml
FreeArtMan has quit [Read error: Connection reset by peer]
FreeArtMan has joined #ocaml
Eyyub has quit [Quit: Lost terminal]
Eyyub has joined #ocaml
Thooms has quit [Read error: No route to host]
Thooms has joined #ocaml
bjorkintosh has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ggole has quit []
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
manizzle has quit [Remote host closed the connection]
_andre has quit [Quit: leaving]
<Anarchos> Why doesn't the sparc code backend generator use the TADD (and others) instructions ?
manizzle has joined #ocaml
<adrien> because noone has a sparc?
mort___ has joined #ocaml
FreeArtMan has quit [Read error: Connection reset by peer]
<erider> adrien did you figure out how to solve the issue with sdlloader not being found
FreeArtMan has joined #ocaml
Yoric has joined #ocaml
<erider> I keep getting this error "Error: Unbound module Sdlloader" but I know that sdlloader is there
travisbrady has quit [Quit: travisbrady]
<Anarchos> erider "module sailor unknown : gone on the sea" :)
<erider> I saw in some logs that adrien had the same issue with ocamlsdl, I was just wondering how it was solved
travisbrady has joined #ocaml
lostcuaz has joined #ocaml
<adrien> erider: hmmm, in which context?
<adrien> must have been a long time ago
<adrien> like, years
<erider> it was awhile ago I think
<adrien> how do you build?
<erider> I am trying to use the MLGAME lib and I am building with OCamlMakefile
mcclurmc has joined #ocaml
<erider> it mostly compiles but it is choking on the sdlloader module which it there because I loaded sdl with opam
<adrien> hmm, ocamlfind list | grep -i sdl
lostcuaz has quit [Read error: Connection timed out]
lostcuaz has joined #ocaml
<erider> sdl (version: 0.9.1) sdl.sdlgfx (version: n/a) sdl.sdlimage (version: n/a) sdl.sdlmixer (version: n/a) sdl.sdlttf (version: n/a)
<adrien> and what is the ocaml compiler invocation which fails?
<erider> I moved the sdlloader.mli in the build sources and now I get a new error
<adrien> you shouldn't do that
<erider> Error: Cannot find file sdloader.cma
<erider> ok
* erider rm sdlloader.mli
rand000 has joined #ocaml
eikke has quit [Ping timeout: 245 seconds]
thomasga has quit [Quit: Leaving.]
<erider> Error: Unbound module Sdlloader :-(
<adrien> what is the command-line that fails?
<adrien> ocamlopt ...
<adrien> (probably ocamlc actually
<adrien> )
FreeArtMan has quit [Read error: Operation timed out]
<erider> ocamlfind ocamlc -package sdl,sdl.sdlimage,sdl.sdlmixer,sdl.sdlttf, -c -I +sdl -I /usr/include/ocaml/3.07 -I /usr/include/ocaml/3.07 video.ml
<adrien> wat
<adrien> have you changed anything?
<erider> File "video.ml", line 109, characters 20-40: Error: Unbound module Sdlloader
<erider> make[1]: *** [video.cmo] Error 2
thomasga has joined #ocaml
<erider> no
ulfdoz has joined #ocaml
<adrien> well, you should try to add "sdlloader.cma" to the command-line
<adrien> I don't have the sources around to guide you though
ollehar has joined #ocaml
<erider> will I don't have 3.07 loaded on my system
<adrien> you can strip it but it won't harm
<adrien> same for -I +sdl I believe
thomasga has quit [Client Quit]
<erider> Error: Unbound module Sdlloader
<erider> ocamlfind ocamlc -package sdl,sdl.sdlimage,sdl.sdlmixer,sdl.sdlttf, -c -I +sdl sdlloader.cma video.ml
tnguyen has quit [Remote host closed the connection]
<adrien> can you check you have "sdlloader.cmi"?
<adrien> actually which sdlloader.* files do you have?
<erider> maybe ocaml 4.01.0 doesn't support MLGAME
<adrien> I doubt it
<adrien> it's sdl which is poorly packaged
<adrien> and same for ocaml-sdl :P
<erider> in the sdl directory there is only a mli
<erider> there is no sdlloader.cmi
Yoric has quit [Ping timeout: 264 seconds]
<erider> adrien I have the sdlloader.ml and sdlloader.mli
<adrien> and no .cma?
<erider> no
<erider> that only cma I have it sdl.cma
FreeArtMan has joined #ocaml
<erider> adrien I should be able to build one right? with the source
ollehar has quit [Ping timeout: 245 seconds]
thomasga has joined #ocaml
<adrien> hmm
ollehar has joined #ocaml
<adrien> erider: not sure; I think there might have been a packaging issue
mgaogw has joined #ocaml
<erider> I have the source for ocamlsdl
<mgaogw> Does anyone know how to create a new list of keys from a map based on whether or not their value satisfies some predicate?
<erider> I can try to rebuild it
<adrien> mgaogw: "filter"?
<nlucaroni> mgaogw: filter
<adrien> it creates a new map
<adrien> "fold" might be worth a look too
<adrien> erider: well, you can try but I don't know if it would change
<adrien> that said there might be some issues in ocaml-sdl
<adrien> hcarty: ocaml-sdl might be something good to put in newhope :P
<adrien> hcarty: debian has a few patches which show nasty issues
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
thomasga has quit [Quit: Leaving.]
avsm has joined #ocaml
<erider> adrien you are right the package is broken
<adrien> well, the package doesn't patch the issues the original source has :P
FreeArtMan has quit [Quit: main.lv]
ocp has joined #ocaml
thomasga has joined #ocaml
Eyyub has quit [Quit: Lost terminal]
<mgaogw> adrien: this is what I currently tried using fold, but I got an "operator expected error" https://gist.github.com/bornreddy/8657524
<erider> adrien is there a workaround?
<adrien> first, (==) is structural equality; not what you would use most of the time
Kakadu has quit []
<companion_cube> physical equality*
<adrien> mgaogw: then, hmmm, it seems wrong
<adrien> erider: yes!
<adrien> erider: but I don't know what it is :D
<erider> lol
<companion_cube> there is a problem with the fold
<mgaogw> companion_cube: with the function, maybe?
<companion_cube> if ... then foo with foo of a type that is not unit
<companion_cube> you need "else acc"
<companion_cube> and I'd advise to rather use "key :: acc" than "acc @ [key]"
<mgaogw> companion_cube: i'm still getting an "operator expected" error after including an else :(
<companion_cube> candidates = ref [] in ← missing "let"
<companion_cube> after the final ";" you need something else
<companion_cube> ";" separates two expressions
<erider> adrien do you know if I can use sdl2 to build ocamlsdl?
nikki93 has quit []
<mgaogw> adrien: thanks!
tnguyen has joined #ocaml
AltGr has left #ocaml []
FreeArtMan has joined #ocaml
<adrien> erider: yes I know!
<adrien> erider: and no you can't ='(
<erider> ok
<adrien> you'd need to compare something like the debian build logs with what you have
<adrien> debian also has a few patches
<erider> just installed sdl2 :-(
<adrien> they seem good
<adrien> one is related to the build system so it _might_ be it
<adrien> hmm, hold on
FreeArtMon has joined #ocaml
<adrien> I really don't know why debian gets the file and you don't
axiles has quit [Remote host closed the connection]
FreeArtMan has quit [Ping timeout: 272 seconds]
Yoric has joined #ocaml
malo has quit [Quit: Leaving]
wwilly has quit [Quit: This computer has gone to sleep]
Arsenik has quit [Remote host closed the connection]
ulfdoz has quit [Ping timeout: 248 seconds]
FreeArtMan__ has joined #ocaml
FreeArtMan__ has quit [Client Quit]
FreeArtMon has quit [Ping timeout: 245 seconds]
avsm has quit [Quit: Leaving.]
travisbrady has quit [Ping timeout: 260 seconds]
mgaogw has left #ocaml []
jao has quit [Ping timeout: 248 seconds]
nlucaroni has quit [Quit: leaving]
zRecursive has joined #ocaml
lostcuaz has joined #ocaml
kyrylo has joined #ocaml
Simn has quit [Quit: Leaving]
ocp has quit [Ping timeout: 252 seconds]
saml has quit [Quit: Leaving]
thomasga has quit [Quit: Leaving.]
avsm has joined #ocaml
zRecursive has quit [Ping timeout: 245 seconds]
Enjolras has quit [Read error: Operation timed out]
Enjolras has joined #ocaml
Enjolras has quit [Changing host]
Enjolras has joined #ocaml
zRecursive has joined #ocaml
alex____ has left #ocaml []
thomasga has joined #ocaml
Thooms has quit [Read error: Operation timed out]
<erider> adrien now it is looking for Error: Cannot find file sdloader.cma
thomasga has quit [Quit: Leaving.]
shinnya has joined #ocaml
<erider> adrien seems like a typo by the build system
thomasga has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
talzeus has joined #ocaml
pippijn_ has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rs0_ has joined #ocaml
acieroid has quit [Read error: Connection reset by peer]
talzeus_ has quit [Read error: Connection reset by peer]
pippijn has quit [Ping timeout: 272 seconds]
rs0 has quit [Ping timeout: 272 seconds]
acieroid has joined #ocaml
<erider> adrien I got all the object files built
shinnya has quit [Ping timeout: 264 seconds]
<erider> why is the order of the cmo files so important?
darkf has joined #ocaml
pippijn_ is now known as pippijn
S11001001 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
Anarchos has quit [Quit: Vision[0.9.7-H-20131020]: i've been blurred!]
madroach has quit [Ping timeout: 252 seconds]
Anarchos has joined #ocaml
madroach has joined #ocaml
Anarchos has quit [Quit: nozhvez mat deoc'h !!]
avsm has quit [Quit: Leaving.]
mort___ has quit [Quit: Leaving.]