gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
diml has joined #ocaml
<kaustuv> For google, the working solution as of 2012-03-24T00:13:00Z seems to be:
<kaustuv> OCAMLFIND_COMMANDS="ocaml=ocp-ocamlc.opt ocamlopt=ocp-ocamlopt.opt" ocamlbuild -use-ocamlfind
<larsrh> I'm using ocamlbuild to build my project. Is it possible to have subfolders in the source directory?
albacker has quit [Ping timeout: 246 seconds]
<kaustuv> larsrh: yes, but you have to add them to your _tags file like so:
<kaustuv> <subfolder>: include
<larsrh> kaustuv: okay
<larsrh> how do I reference those modules?
<larsrh> I still get 'unbound module' errors
<kaustuv> In the toplevel?
<larsrh> the folder is called 'input', and in there, there's a file 'lexer2.ml'
<larsrh> then I try to 'open Input.Lexer2'
<larsrh> and ocamlbuild tells me 'Error: Unbound module Input'
<kaustuv> Drop the Input.
<larsrh> that works, but why?
<larsrh> the manual states that I should use a hierarchical name
<kaustuv> which manual?
<larsrh> "If no other modules named Bar or Baz exist elsewhere in the project, then you are done. Just use Foo, Foo.Bar and Foo.Baz in your code"
<kaustuv> That manual is wildly out of date. Right now there is no hierarchical naming support in ocamlbuild. (Not sure if there ever was.)
<larsrh> okay, thank you
Tobu has joined #ocaml
<kaustuv> If you really want hierarchical names, you can try something like this: http://brion.inria.fr/gallium/index.php/Using_internal_libraries
<larsrh> while we're at it, is there a tutorial for ocamllex+ocamlyacc?
<larsrh> those I found are from 2004
<kaustuv> Actually scratch that, there is no hierarchical names even with .mllibs.
<kaustuv> No tutorial, I'm afraid, but there's this: http://caml.inria.fr/pub/docs/manual-ocaml/manual026.html
twittard has quit [Quit: twittard]
kaustuv has left #ocaml []
<larsrh> splendid, it has an example
<larsrh> are those tools still state of the art in OCaml?
fraggle_ has quit [Read error: Connection reset by peer]
fraggle_ has joined #ocaml
mehdid_ is now known as mehdid
<larsrh> okay, I'm looking at the example in section 12.6
<larsrh> I also have a line-based input, so my structure looks roughly the same
<larsrh> what's the most elegant way to collect all those lines into a list?
lkahtz has joined #ocaml
lkahtz has quit [Remote host closed the connection]
Tobu has quit [Ping timeout: 260 seconds]
twittard has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
ulfdoz_ is now known as ulfdoz
thomasga has quit [Quit: Leaving.]
Tobu has joined #ocaml
rjohnson_ has quit [Remote host closed the connection]
asdfhjkl has joined #ocaml
iago has quit [Quit: Leaving]
milosn_ has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
milosn has quit [Ping timeout: 272 seconds]
xenocons is now known as xenocons_
xenocons_ is now known as xenocons
twittard has quit [Remote host closed the connection]
twittard has joined #ocaml
diego_diego has joined #ocaml
Tobu has joined #ocaml
diego_diego has left #ocaml []
asdfhjkl has quit [Quit: Leaving]
emmanuelux has joined #ocaml
NihilistDandy has joined #ocaml
NihilistDandy has quit [Client Quit]
twittard_ has joined #ocaml
twittard has quit [Ping timeout: 244 seconds]
twittard_ is now known as twittard
jimmyrcom has quit [Ping timeout: 252 seconds]
cdidd has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
smallthink has joined #ocaml
<smallthink> hi everybody
<smallthink> Anyone knows if there is a ocaml's fomal language specificacion?
<smallthink> something like the definition of standard ml
<tomprince> I don't think so. OCaml tends to change as features get added.
<smallthink> What if someone is looking to do a language subset implementation for research?
<smallthink> Are there any pappers about the formal semantics of ocaml?
<pippijn> smallthink: I don't think so
<smallthink> are there any compiler writer here?
<pippijn> yes
<pippijn> smallthink: why are you talking to me in private?
Tobu has quit [Ping timeout: 260 seconds]
<smallthink> so
<smallthink> I like to study the object oriented part of ocaml
<pippijn> I only use that for UI programming
<pippijn> ah, finally google is responding
<pippijn> all the way at the bottom
<pippijn> "Language design"
<pippijn> ocaml: The language is in effect defined by some combination of the manual and the implementation.
<smallthink> yes thanks pippijn
<smallthink> I would like to chat with an ocaml compiler writer
<pippijn> ah
<pippijn> that's notme
<smallthink> o.k thanks for your help
Tobu has joined #ocaml
smallthink has quit [Quit: Leaving]
albacker has joined #ocaml
albacker has quit [Changing host]
albacker has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
<Ptival> the compiler writers don't come to IRC :)
albacker has quit [Ping timeout: 272 seconds]
Snark has joined #ocaml
Tobu has quit [Ping timeout: 260 seconds]
sgnb has quit [Ping timeout: 245 seconds]
Cyanure has joined #ocaml
Tobu has joined #ocaml
Kakadu has joined #ocaml
mfp has quit [Ping timeout: 245 seconds]
mfp has joined #ocaml
albacker has joined #ocaml
albacker_ has joined #ocaml
albacker has quit [Read error: No route to host]
albacker_ is now known as albacker
albacker has quit [Changing host]
albacker has joined #ocaml
andreypopp has joined #ocaml
avsm has joined #ocaml
andreypopp has quit [Ping timeout: 264 seconds]
munga has joined #ocaml
bitbckt has quit [Ping timeout: 245 seconds]
bitbckt has joined #ocaml
Znudzon has joined #ocaml
datkin has joined #ocaml
andreypopp has joined #ocaml
andreypopp is now known as andreypopp|zvooq
andreypopp|zvooq has quit [Quit: Computer has gone to sleep.]
skchrko has joined #ocaml
Tobu has quit [Remote host closed the connection]
albacker has quit [Ping timeout: 246 seconds]
Tobu has joined #ocaml
andreypopp|zvooq has joined #ocaml
skchrko has quit [Quit: ChatZilla 0.9.88.1 [Firefox 11.0/20120314111819]]
Tobu has quit [Remote host closed the connection]
Tobu has joined #ocaml
jimmyrcom has joined #ocaml
jimmyrcom has quit [Read error: Connection reset by peer]
jimmyrcom has joined #ocaml
avsm has quit [Quit: Leaving.]
Xizor has joined #ocaml
mal`` has joined #ocaml
diego_diego has joined #ocaml
munga has quit [Ping timeout: 240 seconds]
<Drakken> Is there a way to make an archive with ocamlbuild?
ocp has joined #ocaml
<Drakken> Hmm. I guess I can just make the object files with a .itarget file and then put them together with ocamlc -a.
err404 has joined #ocaml
<larsrh> how can I match against an existing variable?
brendan has quit [Quit: leaving]
<_habnabit> match variable with ... ????
ikaros has joined #ocaml
ikaros has quit [Remote host closed the connection]
<mrvn> larsrh: there are no variables
<_habnabit> sure there are
<mrvn> _habnabit: like?
<_habnabit> `let variable = ref foo in ...`
<mrvn> _habnabit: that is a binding of a reference.
<_habnabit> same thing
<mrvn> which is actually just syntactical suggar for a record with a mutable.
<thizanne> just define variable and you'll see you will agree.
Znudzon has quit [Ping timeout: 244 seconds]
<mrvn> thizanne: # let variable = false;;
<mrvn> val variable : bool = false
<_habnabit> hey look! a variable!
<thizanne> and... ?
<mrvn> In functional languages they are called bindings because you just bind a name to some value and don't create a variable like "bool variable = false;" would.
<Drakken> larsrh what kind of variable do you want to match against? Is "if y=x then ..." not enough?
<_habnabit> so far this sounds exactly like what python does
<thizanne> mrvn : so far you're learning me nothing, but i still don't understand why you're explaining me this
<rks> (teaching*)
<thizanne> (yes)
<mrvn> thizanne: so that in future you might use the proper name
<thizanne> where did you see i used the wrong name ?
<rks> mrvn: don't you think answering _habnabit question (which we all understood) would have been a little bit more interesting than this discussion?
<mrvn> thizanne: no you you, larsrh + _habnabit you
<_habnabit> mrvn, yes, I'm very much aware of all of the pedantic terminology
<_habnabit> mrvn, jfyi I don't call 1024 bytes a kibibyte either
<rks> _habnabit: if you want to do something like « match x with y -> ... » where y is already in your environment, you can't
<rks> use the if x = y construction (as Drakken pointed out)
<_habnabit> rks, wasn't my question
<rks> _habnabit: oh, I didn't get your question then, sorry
<mrvn> rks: match x with z when x = z ->
<_habnabit> rks, I didn't ask a question! I was just asking for clarification from larsrh
<thizanne> rks: it was the question, but from larsrh
<rks> yes mrvn, he could do that
<mrvn> (which makes no sense in such a simple example but is usefull for bigger ones)
<rks> oh indeed, didn't backlog enough
<rks> sorry :-'
<rks> (yes mrvn)
<mrvn> larsrh: do you want to compare the value or the type of something? And against what?
albacker has joined #ocaml
albacker has quit [Changing host]
albacker has joined #ocaml
<larsrh> I'd like something along `let x = 1 in match 2 with x -> ...'
<larsrh> the `x' in the pattern introduces a new binding
<larsrh> I went with `let x = 1 in match 2 with y when x = y -> ...'
<thizanne> match 2 with x is quite strange
err404 has quit [Read error: Connection reset by peer]
blue_prawn has joined #ocaml
<blue_prawn> Hi!
<blue_prawn> Which sexplib is packaged in Debian? the one from Markus Mottl, or the one from JaneStreet? Or both?
asdfhjkl has joined #ocaml
NihilistDandy has joined #ocaml
<larsrh> thizanne: `2' was just a placeholder for an arbitrary expression
<mrvn> larsrh: If it is an literal then you would use match y with 2 ->. But I'm assuming you ment let my_const = 2 .... let x = 1 in match x with y when y = my_const -> ...
<mrvn> larsrh: If it is just one comparison I would use "if x = my_const" but with multiple comparisons I often prefer such a match with when over a series of if statements.
<mrvn> The equivalent of switch(x) { case CONST1: ... CONST2: ... CONST3: ... }
<blue_prawn> Arg, this is even worth than 2 different versions, there 3
<blue_prawn> I've just seen that there is a third one on the forge
andreypopp|zvooq has quit [Quit: Computer has gone to sleep.]
diego_diego has quit [Quit: diego_diego]
diego_diego has joined #ocaml
<Drakken> larsrh that's just a simple equality test. let x = e1 in if e2 = x then ...
avsm has joined #ocaml
cdidd has quit [Remote host closed the connection]
lamawithonel has quit [Ping timeout: 246 seconds]
lamawithonel_ has joined #ocaml
abdallah has joined #ocaml
g0dmoney- has quit [Remote host closed the connection]
andreypopp|zvooq has joined #ocaml
abdallah has quit [Quit: Ex-Chat]
emmanuelux has quit [Ping timeout: 245 seconds]
Drup has joined #ocaml
emmanuelux has joined #ocaml
emmanuelux has quit [Ping timeout: 245 seconds]
diego_diego has quit [Quit: diego_diego]
Drup has quit [Quit: Leaving.]
pango has quit [Quit: video driver upgrade]
pango has joined #ocaml
andreypopp|zvooq has quit [Quit: Computer has gone to sleep.]
andreypopp|zvooq has joined #ocaml
Snark has quit [Quit: Quitte]
twittard has quit [Quit: twittard]
err404 has joined #ocaml
Submarine has quit [Remote host closed the connection]
Kakadu has quit [Ping timeout: 240 seconds]
err404 has quit [Ping timeout: 272 seconds]
avsm has quit [Quit: Leaving.]
err404 has joined #ocaml
mmajchrzak has joined #ocaml
mmajchrzak has quit [Ping timeout: 244 seconds]
avsm has joined #ocaml
Znudzon has joined #ocaml
albacker has quit [Quit: .]
Znudzon has quit [Ping timeout: 246 seconds]
Cyanure has quit [Remote host closed the connection]
err404 has quit [Remote host closed the connection]
Xizor has quit []
Tobu has quit [Ping timeout: 260 seconds]