gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.11.2 released
avsm has quit [Quit: Leaving.]
Associat0r has quit [Read error: Connection reset by peer]
rossberg has quit [Ping timeout: 260 seconds]
mjonsson has quit [Quit: Leaving]
rossberg has joined #ocaml
mutewit has left #ocaml []
ikaros has quit [Quit: Leave the magic to Houdini]
boscop has quit []
Associat0r has joined #ocaml
Associat0r has quit [Client Quit]
Associat0r has joined #ocaml
travisbrady has quit [Quit: travisbrady]
bmp has joined #ocaml
sshc has joined #ocaml
pad has quit [Remote host closed the connection]
sshc has quit [Ping timeout: 260 seconds]
jeddhaberstro has quit [Quit: jeddhaberstro]
sshc has joined #ocaml
sshc_ has joined #ocaml
sshc has quit [Ping timeout: 276 seconds]
sshc_ has quit [Ping timeout: 248 seconds]
sshc has joined #ocaml
sshc has quit [Ping timeout: 240 seconds]
sshc has joined #ocaml
sshc has quit [Ping timeout: 264 seconds]
sshc has joined #ocaml
joewilliams is now known as joewilliams_away
sshc_ has joined #ocaml
sshc has quit [Ping timeout: 276 seconds]
sshc has joined #ocaml
sshc_ has quit [Ping timeout: 264 seconds]
bmp has quit [Read error: Connection reset by peer]
bmp has joined #ocaml
bmp has quit [Read error: Connection reset by peer]
bmp has joined #ocaml
bmp has quit [Read error: Connection reset by peer]
bmp has joined #ocaml
ulfdoz has joined #ocaml
jonafan_ has joined #ocaml
jonafan has quit [Ping timeout: 240 seconds]
sshc has quit [Quit: leaving]
lxnay has joined #ocaml
valross has joined #ocaml
aja has joined #ocaml
Yoric has joined #ocaml
Amorphous has quit [Ping timeout: 248 seconds]
mfp has quit [Quit: Leaving]
ulfdoz has quit [Ping timeout: 260 seconds]
Amorphous has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
sshc has joined #ocaml
avsm has joined #ocaml
aja has quit [Read error: Connection reset by peer]
asurai has joined #ocaml
Yoric has quit [Quit: Yoric]
bmp has quit [Ping timeout: 240 seconds]
asurai is now known as bmp
albacker has joined #ocaml
Xeio has joined #ocaml
* Xeio waves
Submarine has joined #ocaml
mal`` has quit [*.net *.split]
kg4qxk has quit [*.net *.split]
diml has quit [*.net *.split]
avsm has quit [Quit: Leaving.]
mal`` has joined #ocaml
kg4qxk has joined #ocaml
diml has joined #ocaml
barismetin has joined #ocaml
albacker has quit [Quit: Leaving]
ikaros has joined #ocaml
ikaros has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
ikaros has joined #ocaml
Yoric has joined #ocaml
kaustuv has joined #ocaml
srcerer has quit [Ping timeout: 258 seconds]
<kaustuv> Is there a canonical way to use libraries such as pcre in myocamlbuild.ml?
<f[x]> see ocamlfind example on brion wiki
<adrien> which is what I'm doing too
valross has quit [Ping timeout: 265 seconds]
<kaustuv> No, I want to use pcre to build the myocamlbuild plugin itself
npouillard has quit [Ping timeout: 260 seconds]
valross has joined #ocaml
Associat0r has quit [Quit: Associat0r]
ftrvxmtrx has quit [Quit: Leaving]
<f[x]> then ocamlbuild -ocamlc "ocamlc pcre.cma"
<f[x]> with -just-plugin
avsm has joined #ocaml
leino has joined #ocaml
<kaustuv> That didn't work, but this did:
<kaustuv> % ocamlbuild -ocamlopt 'ocamlfind ocamlopt -package pcre -linkpkg'
<kaustuv> Though I can't say I'm too enthused about the -just-plugin/-no-plugin dance
<kaustuv> Thanks anyhow
<adrien> btw, you have 'ocamlfind query' to get specific paramaters rather than directly the ocamlopt command too
sgnb has quit [Ping timeout: 248 seconds]
ftrvxmtrx has joined #ocaml
Xeio has quit [Ping timeout: 272 seconds]
ikaros has quit [Quit: Leave the magic to Houdini]
npouillard has joined #ocaml
ikaros has joined #ocaml
_unK has joined #ocaml
avsm has quit [Ping timeout: 245 seconds]
avsm has joined #ocaml
_andre has joined #ocaml
endophage has joined #ocaml
<endophage> need some help. I've been handed a large OCaml project and I've read a good tutorial and while I understand most of the code, there are a lot of occurrences of "let () = something in" I understand the whole let ... in syntax but what does the () = do?
<mrvn> endophage: matches the return value of the part after the = with an unit value.
<mrvn> I.e. ignores the result while still checking that the type in unit.
<endophage> so I should think of it somewhat like a type cast to unit?
<endophage> ah ok
<endophage> thank you very much for that
<mrvn> it's like foo; bar; baz; buzz;
<endophage> I should have asked here earlier, wouldn't have wasted so much time :-P
<companion_cube> endophage: in outermost scope, let () = ... corresponds to the main() function in other langages
<companion_cube> languages*
<mrvn> endophage: alternative form for it is let _ = ...
<companion_cube> i.e. it is executed at runtime, it is not just a definition
<mrvn> but that would not check the type.
<mrvn> companion_cube: every let is executed at runtime sort of.
<endophage> if it's just throwing away the result is there any actual need for the let ... in?
<endophage> could it not just be written with a ; at the end of the line
<mrvn> endophage: only the toplevel ones.
<endophage> ok, I'm still getting to grips with the whole toplevel thing
<mrvn> endophage: let () = a; b; c; is equivalent to let () = let () = a in let () = b in c
<endophage> these calls are all inside other functions if that makes any difference, so I have let method vars = ... some code ... let () = ...
<endophage> (obviously not the keyword method, read as foo or whatever you want)
<mrvn> endophage: Some people prefer let to ; inside functions. And often it is a matter of indentation too.
<endophage> ok, it just seems to be making think code messy as it's on nearly every line
<mrvn> endophage: let foo x y = let a = 17 in bar; baz; let b = 23 in x+y+a+b would indent badly compared to let () = bar in let () = baz in
<endophage> and it doesn't help that the program was written by a group with no consensus on code style
<mrvn> endophage: that is the worst.
<endophage> yeah, if it was Java or C/C++ I could deal with it but as I'm new to OCaml it's a pain dealing with 4 different coding styles
<endophage> anyway, thanks for the help, I may well be back with more questions later
f[x] has quit [Ping timeout: 260 seconds]
f[x] has joined #ocaml
boscop has joined #ocaml
<endophage> is there a better OCaml editor than eclipse with the OCaml plugins?
<mrvn> .oO(vim, xemacs)
<endophage> not so great when the code base is in excess of 50k lines and you're trying to visualise it
<adrien> well, what is *your* definition of "better"?
<endophage> well, I'm trying to find my way around this code so with Java in eclipse you can right click on a method call and get it to take you to the definition... useful things like that don't seem to exist in the OCaml plugins for eclipse
<companion_cube> even with ctrl+mouse click ?
<endophage> that's the same as right click
<thomasga> endophage: normally ctrl+mouse click works with ocaIDE under Eclipse
<thomasga> (at least it was working 2 years ago :-)
<endophage> ah, I'm on Mac, command + click does it
<endophage> :P
<endophage> still think it should be in the right click menu... but at least there's some way to do it
<endophage> thanks
Snark has joined #ocaml
<kaustuv> caml-types-show-ident (which is apparently not bound to anything by default) does roughly what ctrl-click does in OCaIDE
<kaustuv> however, it doesn't cross reference across modules
<thomasga> kaustuv: well on big projects, if you don't have cross modules references, the feature is a bit useless :-)
<kaustuv> I use it all the time to figure out which of the several shadowed identifiers is being referred to deep inside some let ... in monstrosity.
<kaustuv> In any case, we would need something like the erstwhile otags to do cross module referencing
Jedai has quit [Quit: KVIrc Insomnia 4.0.0, revision: 3900, sources date: 20100125, built on: 2010-02-15 08:27:55 UTC 3900 http://www.kvirc.net/]
leino has quit [Ping timeout: 240 seconds]
Xeio has joined #ocaml
barismetin has quit [Quit: Leaving...]
barismetin has joined #ocaml
valross has quit [Quit: Ex-Chat]
eb4890 has joined #ocaml
kaustuv has left #ocaml []
joewilliams_away is now known as joewilliams
bmp has quit [Quit: bmp]
Associat0r has joined #ocaml
ccasin has joined #ocaml
eb4890 has quit [Quit: Leaving]
m00npirate has joined #ocaml
zerny has joined #ocaml
bmp has joined #ocaml
Submarine has quit [Quit: Leaving]
emmanueloga has joined #ocaml
<m00npirate> This keeps telling me that print_tree has type 'a -> btree but is here used with type btree, I cant figure out why it isnt working: http://paste.pocoo.org/show/221072/
ikaros has quit [Quit: Leave the magic to Houdini]
thelema_ is now known as thelema
<thelema> ah, your example_tree is a function
<thelema> as it takes a parameter 'tree'
<thelema> it doesn't do anything with that parameter, so it's inferred as 'a
<m00npirate> yay!! I never would have found that
<m00npirate> tyvm
<thelema> also, you may want to look at %a in printf - it can be useful in situations like this.
ikaros has joined #ocaml
travisbrady has joined #ocaml
bmp has quit [Remote host closed the connection]
ikaros has quit [Client Quit]
bmp has joined #ocaml
ikaros has joined #ocaml
barismetin has quit [Quit: Leaving...]
<m00npirate> i read the documentation for printf with %a and found it to be incomprehensible >_>
asurai has joined #ocaml
bmp has quit [Ping timeout: 248 seconds]
asurai is now known as bmp
avsm has quit [Quit: Leaving.]
oriba has joined #ocaml
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 245 seconds]
endophage has quit [Ping timeout: 260 seconds]
<travisbrady> Anyone have pointers on how I might write incr/decr functions over the stdlib Map type that don't require a find and an add?
<flux> hmm.. I don't think it's possible. you need to retrieve an element and create a modified version of the tree, no?
<travisbrady> flux: I thought so. but look at the source for add in map.ml I see on line 96 that I could change "Node(l, x, data, r, h)" to "Node(l, x, data + 1, r, h)"
bmp has quit [Quit: bmp]
<flux> travisbrady, true. you could store refereneces to the Map ;)
emmanueloga has quit [Ping timeout: 248 seconds]
<flux> Map doesn't provide 'replace' function, that would be find and add baked into one
<travisbrady> flux: refs IN the map or refs to it? I don't follow you
<flux> travisbrady, refs in the map. in that way you would only need to find the value from the map and you could assign it a new value.
<travisbrady> flux: yeah, exactly, it's a bit like a defaultdict in python or something, or .get(key, default_val)
<flux> travisbrady, hm, I don't think that's the same thing?
bmp has joined #ocaml
sepp2k has joined #ocaml
<travisbrady> flux: any thoughts on what might be the most performant?
<orbitz> i don't think flux is talking abtou default values, i think he's talking abotu a 'mutable' map
<orbitz> chaning map.ml is a bad idea
Yoric has quit [Quit: Yoric]
<flux> in an extreme situation, you could make your own fork of map.. of course, licensing may affect you then.
<travisbrady> I wouldn't want to change map.ml, I'd rather the ability to just define incr and decr functions in my ExtMap module.
<travisbrady> The issue I'm having is that I don't have access to the constructors Empty and Node in my module after doing the module include.
<flux> well.. there are ways, if you want to tread those waters..
<travisbrady> What is in those waters?
<flux> you can introduce the same constructors in your own module and use Obj.magic to convert between those types
<flux> thus should the internal structure of Map ever change, you will find yourself in the segmentation fault land
<hcarty> flux: Spooky...
<flux> thus if you do consider that option, I would advice adding a compile-time check that the hack works
<flux> in practice, though, I don't think Map will change in the foreseeable future..
<m00npirate> is there a way to define types/exceptions locally?
<m00npirate> ie inside a funciton
<flux> m00npirate, sort of, with local modules
<m00npirate> oh ok, probably not worth it then
<m00npirate> for my purposes
<flux> the syntax for local modules is let module Foo = struct .. end .. in ..
<m00npirate> i should probably try it out just to know how to use em anyhow
<m00npirate> cool got it working, thanks =]
<m00npirate> after i make the module is there a way to open it so i dont have to dot everything?
<flux> well, the basic answer is 'no'
<flux> you can with 3.12, which isn't available yet
<flux> also you can with a syntax extension, pa_openin
<m00npirate> now that I think about it its pretty dumb to do, kinda ruins the whole point of it xD
<flux> both those provide a syntax open Foo in expr
<flux> you can name the module S and it become not-that-bad
<flux> or you can write the code inside the module you created
<flux> actually there's a third alternative: create a new module that opens the previous module 8-)
<m00npirate> lol
<flux> this works: let foo = let module Bar = struct let baz () = () end in Bar.baz
<m00npirate> then what is foo doing there
<m00npirate> oh cant i just rename them? let Thing = Module.Thing in
<m00npirate> doesnt seem to be working though
<hcarty> m00npirate: let module Thing = Module.Thing in
<hcarty> m00npirate: Or - let thing_func = Module.Thing.func in
zerny has left #ocaml []
<m00npirate> hcarty: what if im trying to rename a constructor in a variant?
<hcarty> m00npirate: I don't think that's possible
<m00npirate> ahh ok
<travisbrady> Ahh, what I'd really like would just be batMap.modify in batteries. unfortunately I can't use anything outside the stdlib for this.
Submarine has joined #ocaml
jonafan_ is now known as jonafan
ftrvxmtrx has quit [Quit: Leaving]
pad has joined #ocaml
Submarine has quit [Read error: Connection reset by peer]
Submarine_ has joined #ocaml
bmp has quit [Quit: bmp]
m00npirate has left #ocaml []
bmp has joined #ocaml
ftrvxmtrx has joined #ocaml
bmp has quit [Quit: bmp]
fabjan has quit [Quit: Reconnecting]
fabjan has joined #ocaml
fabjan has quit [Client Quit]
fabjan_ has joined #ocaml
Snark has quit [Quit: Ex-Chat]
schmrkc has quit [Ping timeout: 240 seconds]
schmrkc has joined #ocaml
oriba has quit [Quit: Verlassend]
sshc has quit [Quit: leaving]
haelix has quit [Ping timeout: 248 seconds]
ulfdoz has joined #ocaml
bmp has joined #ocaml
enthymeme has joined #ocaml
bmp has quit [Quit: bmp]
eelte has joined #ocaml
coucou747 has quit [Ping timeout: 260 seconds]
Jedai has joined #ocaml
<travisbrady> I'm doing a bit of profiling with Shark and i see a ton of time in camlFunctor_test_refs__compare_174. Would would that be? This is using the Map module by the way. Could that be 'add' calls or maybe fold?
ygrek has joined #ocaml
<travisbrady> also looking for pointers on optimizing gc
Yoric has joined #ocaml
sepp2k has quit [Ping timeout: 240 seconds]
bmp has joined #ocaml
sepp2k has joined #ocaml
pad has quit [Remote host closed the connection]
bmp has quit [Ping timeout: 265 seconds]
brendan has quit [Ping timeout: 276 seconds]
brendan has joined #ocaml
_andre has quit [Quit: Lost terminal]
bmp has joined #ocaml
bmp has quit [Client Quit]
bmp has joined #ocaml
bmp has quit [Read error: Connection reset by peer]
bmp has joined #ocaml
ftrvxmtrx has quit [Read error: Connection reset by peer]
bmp has quit [Client Quit]
bmp has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
ftrvxmtrx has joined #ocaml
nostrand has joined #ocaml
bmp has quit [Quit: bmp]
haelix has joined #ocaml
nostrand has left #ocaml []
sepp2k has quit [Quit: Leaving.]
fraggle_laptop has quit [Read error: Connection reset by peer]
boscop has joined #ocaml
bmp has joined #ocaml
boscop_ has quit [Ping timeout: 264 seconds]
bmp has quit [Quit: bmp]
Yoric has quit [Quit: Yoric]
ccasin has quit [Quit: Leaving]
bmp has joined #ocaml
bmp has quit [Read error: Connection reset by peer]
bmp has joined #ocaml
bmp has quit [Ping timeout: 248 seconds]
bmp has joined #ocaml
bmp has quit [Read error: Connection reset by peer]
bmp has joined #ocaml
M| has quit [Ping timeout: 248 seconds]
M| has joined #ocaml
ikaros has quit [Remote host closed the connection]
Xeio has quit [Ping timeout: 276 seconds]
bmp has quit [Remote host closed the connection]
bmp has joined #ocaml
bmp has quit [Client Quit]
sgnb has joined #ocaml
bmp has joined #ocaml
brendan has quit [Remote host closed the connection]
ulfdoz has quit [Ping timeout: 260 seconds]
sshc has joined #ocaml
bmp has quit [Remote host closed the connection]
bmp has joined #ocaml
asurai has joined #ocaml
_unK has quit [Remote host closed the connection]
bmp has quit [Ping timeout: 265 seconds]
asurai is now known as bmp
brendan has joined #ocaml