flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
dsheets has quit [Ping timeout: 246 seconds]
luke_ has quit [Quit: Leaving]
breakds has quit [Quit: Konversation terminated!]
Xom_ has joined #ocaml
Xom has quit [Ping timeout: 246 seconds]
Xom_ is now known as Xom
csakatoku has joined #ocaml
zRecursive has left #ocaml []
dsheets has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
madroach has joined #ocaml
watermind has quit [Quit: Konversation terminated!]
walter|r has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
darkf has joined #ocaml
csakatok_ has joined #ocaml
csakatoku has quit [Ping timeout: 240 seconds]
oriba has quit [Quit: oriba]
ygrek has joined #ocaml
BiDOrD has joined #ocaml
BiDOrD_ has quit [Ping timeout: 240 seconds]
Yoric has quit [Ping timeout: 246 seconds]
shinnya has quit [Ping timeout: 245 seconds]
breakds has joined #ocaml
breakds has quit [Client Quit]
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
xenocons has quit [Changing host]
xenocons has joined #ocaml
walter|r has quit [Read error: Connection reset by peer]
walter|r has joined #ocaml
dsamarin_ has joined #ocaml
dsamarin has quit [Quit: Reconnecting]
dsamarin_ is now known as dsamarin
ia0 has quit [Ping timeout: 260 seconds]
ia0 has joined #ocaml
Simn has joined #ocaml
djcoin has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
walter|r has quit [Read error: Connection reset by peer]
walter|r has joined #ocaml
csakatoku has joined #ocaml
csakatok_ has quit [Ping timeout: 245 seconds]
buddyholly has quit [Quit: WeeChat 0.4.1]
buddyholly has joined #ocaml
Yoric has joined #ocaml
zRecursive has joined #ocaml
zpe has joined #ocaml
ggole has joined #ocaml
<jpdeplaix> whitequark: it can be done (in an other style) with « for i = 0 to 4 do f i done »
<jpdeplaix> but you function is not very clear
ben_zen has joined #ocaml
<ski> i suppose `times n f' should be `[f 0;f 1;...;f (n-1)]' ?
weie has quit [Quit: Leaving...]
<jpdeplaix> yes but for the return type
ygrek has joined #ocaml
<whitequark> jpdeplaix: yeah, that would work
<whitequark> (I ended up writing a recursive function since it was more convenient)
walter|r has quit [Ping timeout: 245 seconds]
thomasga has joined #ocaml
zRecursive has left #ocaml []
ontologiae has joined #ocaml
ontologiae has quit [Ping timeout: 245 seconds]
ontologiae has joined #ocaml
steshaw_ has quit [Quit: Leaving]
walter has joined #ocaml
weie has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
skchrko has quit [Quit: Leaving]
mika1 has joined #ocaml
mfp has joined #ocaml
demonimin has quit [Ping timeout: 246 seconds]
Kakadu has joined #ocaml
demonimin has joined #ocaml
jbrown has quit [Ping timeout: 246 seconds]
Yoric has joined #ocaml
mcclurmc has joined #ocaml
walter has quit [Read error: Connection reset by peer]
walter has joined #ocaml
<companion_cube> hi, I have a problem with using ocamlfind libraries with ocamlbuild
<companion_cube> here is a simple test case: http://ocaml.xelpaste.net/8103
walter has quit [Read error: Connection reset by peer]
walter has joined #ocaml
demonimin has quit [Ping timeout: 246 seconds]
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
<companion_cube> ok,looks like the package(lib) tag is also needed for .mli files
ben_zen has quit [Ping timeout: 248 seconds]
ygrek has quit [Ping timeout: 240 seconds]
<Kakadu> hi! I have merlin question
<Kakadu> I'm studing :Locate command and it seems that sometimes it can't find location of variable
<Kakadu> for example in let () = List.iter (fun _ -> print_int x) [] it can
<Kakadu> but in let y=x+x it can't locate x declared a line above
<Kakadu> shout this behavour be reported as a bug?
jbrown has joined #ocaml
demonimin has joined #ocaml
<Kakadu> Well, now it works
<Kakadu> strange
<kerneis> Kakadu: did you recompile in the meantime?
<Kakadu> nope
<kerneis> it might also be an instance of this "bug": https://github.com/def-lkb/merlin/issues/77 (since you mentionned "a line above")
<Kakadu> or maybe I didn't recompile it. I already don't know for sure
<Kakadu> Does merlin use its own autocomletion mechanism or ocp-index?
<kerneis> I'm pretty sure it doesn't use ocp-index since: depends: ocamlfind & yojson & menhir
<kerneis> I don't know how it does it, though
<rks`> Kakadu: we don't use ocp-index
<rks`> and if you are trying to use « Locate » or completion on identifiers local to your buffer, you don't need to recompile
<rks`> it should work
<rks`> if it doesn't, it probably means that your code is not syntactically valid
<rks`> (it might also be a bug, but it's less likely :))
<Kakadu> Can somebody try to place cursor to the 3rd 'x' and execute
<Kakadu> :Locate ? http://paste.in.ua/8621/raw/
<rks`> ok
<rks`> so that is a bug
<rks`> and I know where
<rks`> I'll fix that
<rks`> :)
<Kakadu> should I report it as a bug?
<rks`> no it's ok
<rks`> I'll get on it right away
Drup has joined #ocaml
<Kakadu> hm
<Kakadu> does opam installs merlin.el somewhere?
<Kakadu> rks`: it helps
<rks`> Kakadu: it's somewhere in .opam/<your swith>
<rks`> so maybe .opam/***/share/merlin/emacs/site-lisp/
<Kakadu> .../4.00.1/share/emacs/site-lisp/merlin.el
<rks`> probably yes
<Kakadu> I was looking for it in share/ocamlmerlin and didn't found
<rks`> hum, yeah
<rks`> that's a mismatch on our side.
<kerneis> rks`: wouldn't is be more robust to set delimiters to "anything but acceptable chars for an ocaml identifier"?
<kerneis> hmm, no, because ocaml supports latin1 identifiers
<rks`> kerneis: your patches are very welcome
<kerneis> yeah, in fact ocaml is very annoying
<rks`> I agree that it's a bit ugly at the moment, but I don't know how to do it properly
<kerneis> with its ability to define (**fooBar-é) as an operator
ontologiae has quit [Ping timeout: 260 seconds]
<pippijn> really?
<pippijn> you can have letters in operators?
<kerneis> no?
<kerneis> oh no, I'm mixing up with another language I hack on currently
<rks`> I think you are.
<pippijn> # let ( *o* ) = (+);;
<pippijn> Error: Syntax error
<kerneis> ok, so it should be doable
<kerneis> I'll try that but not before next week
<rks`> ok thank you :)
<Kakadu> in emacs after pressing C-c l it prints "Package to use:<cursor>". With a space after ':' it will look like nicer
djcoin has quit [Quit: WeeChat 0.4.0]
rwmjones has quit [Ping timeout: 260 seconds]
<def-lkb> Kakadu: we'll fix that, thanks
<Kakadu> two connected questions
<Kakadu> 1) Is it theoretically possible to have a hotkey for "A-x merlin-switch-to-ml <module-under-cursor>"
<Kakadu> ?
<Kakadu> pardon, M-x*
<def-lkb> Certainly yes
_andre has joined #ocaml
<Kakadu> 2) I have module Name and Name.ml for it. I'm trying to use M-x merlin-swith-to-ml ENTER Name ENTER and it says that module is not found. Yes, I have "S ." in my .merlin. What I'm doing wrong?
<kerneis> Kakadu: you need B as well I believe
<Kakadu> B _build exists too
<rks`> not for that.
<rks`> Kakadu: no idea what's going wrong here
djcoin has joined #ocaml
<Kakadu> strange
<Kakadu> there it autocompletion when I enter module name
rwmjones has joined #ocaml
<def-lkb> Kakadu: it may be a bug i fixed recently in experimental branch
<Kakadu> but after ENTER it says No such file (message: Not_found)
<Kakadu> ah
<Kakadu> What about merlin identation engine in emacs? Does it use tuareg's, ocp-indent's or it's own? Can you mention it in README?
<def-lkb> merlin does nothing with indentation
<def-lkb> you can use whatever engine you want :)
ollehar has joined #ocaml
Neros has joined #ocaml
n06rin has joined #ocaml
jayprich has joined #ocaml
<gasche> kerneis: I thought about it a bit more and decided to pull the feature out
<gasche> I will apply my fix du jour in trunk, and revert version/4.01 changes corresponding to that feature
<Kakadu> okay
<Kakadu> I have 1 :: 2 :: [] in my .ml file. I have set cursor on "::" and I press C-c C-l
<Kakadu> emacs/merlin says that 'nil not found
<Kakadu> +'
<Kakadu> it seems it happens with (|!) operator too
<Kakadu> is it a bug?
<def-lkb> I don't know how it is done on emacs side, but lexing identifiers in this context is very fragile (an hack :p)
skchrko has joined #ocaml
talzeus has quit [Remote host closed the connection]
<kerneis> gasche: sounds reasonable
<Drup> Kakadu: :: is not really an operator, that's not a good example :/
jbrown has quit [Remote host closed the connection]
skchrko has quit [Read error: Connection timed out]
skchrko has joined #ocaml
ontologiae has joined #ocaml
n06rin has quit [Read error: Connection reset by peer]
n06rin has joined #ocaml
csakatok_ has joined #ocaml
rwmjones has quit [Ping timeout: 240 seconds]
csakatoku has quit [Ping timeout: 264 seconds]
dfan has joined #ocaml
rwmjones has joined #ocaml
walter has quit [Quit: This computer has gone to sleep]
csakatok_ has quit [Remote host closed the connection]
Simn has quit [Read error: Connection reset by peer]
Simn has joined #ocaml
talzeus has joined #ocaml
talzeus has quit [Read error: Connection reset by peer]
talzeus has joined #ocaml
Neros_ has joined #ocaml
alexs__ has joined #ocaml
Neros has quit [Ping timeout: 245 seconds]
Yoric1 has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
librarian has joined #ocaml
<librarian> Hi all! want to write a utility (for training purposes), that will parse log file with regex (Pcre), and I couln't understand from documentation http://mmottl.bitbucket.org/projects/pcre-ocaml/api/Pcre.html is there a function, that will return array of matches, for example:
<librarian> line: "a:b c=d e-f", regex: "([a-z]+:[a-z]+) ([a-z]+=[a-z]+) ([a-z]+-[a-z]+)" will return ["a:b", "c=d", "e-f"]
<gasche> librarian: you are probably looking for extract_all_opt
<gasche> the Pcre interface is, however, particularly horrible to use
<gasche> Str in the standard library is not much better, but at least a bit simpler
<companion_cube> \o
<Qrntz> librarian, check out ocaml-re
alexs__ has quit [Quit: Page closed]
Snark has joined #ocaml
csakatoku has joined #ocaml
jbrown has joined #ocaml
Simn has quit [Read error: Connection reset by peer]
Simn has joined #ocaml
csakatoku has quit [Ping timeout: 246 seconds]
ben_zen has joined #ocaml
<librarian> I've been trying to parse string in ocaml shell: http://pastebin.com/0CsXznNk
<librarian> And there are two errors: 1. Error: Reference to undefined global `Batteries' when I try to use regex " " (default regex) and 2. Exception: Pcre.Error Pcre.MatchLimit. when I try to use regex "^\\[(.*)+\\]\\[(.*)+\\] ([0-9.]+)"
<Kakadu> Any thoughts?
ollehar has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
djcoin has quit [Quit: WeeChat 0.4.0]
djcoin has joined #ocaml
ollehar has joined #ocaml
transfinite has joined #ocaml
shinnya has joined #ocaml
<gasche> Kakadu: what I expect to see in a Papers page is a list of academic articles discussing aspects of the language or its use
Yoric1 has quit [Ping timeout: 256 seconds]
<gasche> caml-instructions.pdf would qualify more as "technical documentation" or "internals documentation"
<gasche> librarian: I cannot access your pastebin link
<librarian> intresting...
<Kakadu> I can't too
<librarian> try this
<ousado> or try some paste site without ads :)
<ousado> I like gist.github.com
<Kakadu> paste.in.ua is very lightweight
<gasche> hm
<gasche> I have no idea why you have this Batteries error, this looks like an installation problem on your side
<gasche> would changing "open Batteries;;" to "open Batteries_uni;;;" solve this problem?
<librarian> Yes! Thanks, it runs
<librarian> It is very standart ubuntu 12.04
<gasche> iirc. Batteries_uni is the style used in Batteries 1.x, while 2.x versions use Batteries
<gasche> re. regexps, you could try the call extract_opt instead of extract_all_opt so that it only try to find one match instead of all
<gasche> see if it helps
<gasche> but if the regexp is somewhat broken (and I refuse to parse regexps by the eye, it's too exhausting), it may not
mcclurmc has quit [Ping timeout: 240 seconds]
<librarian> Seems this works good
<librarian> And I still couldn't understand, why it fails with Pcre.Error Pcre.MatchLimit
mika1 has quit [Quit: Leaving.]
ben_zen has quit [Ping timeout: 276 seconds]
mcclurmc has joined #ocaml
<gasche> librarian: I have no idea
<gasche> Qrntz pointed you to ocaml-re before
<gasche> it's a pure-ocaml implementation of regexp matching, with various interfaces available
<gasche> it may be better-behaved
Kakadu has quit [Quit: Konversation terminated!]
AltGr has joined #ocaml
Neros_ is now known as Neros
<pippijn> when would intersection of regular expressions with named sub-expressions be useful?
mfp has quit [Ping timeout: 264 seconds]
<pippijn> (a:hello) & (b:hel)(c:lo) = (a:(b:hel)(c:lo))
<ggole> Is there any good way to test if a set is a singleton?
<ggole> (Good = O(1)).
<flux> .exists true?
<flux> ah, no
<flux> Set.split and then check subtrees if they are empty or not..
<flux> or max_elt != min_elt
<ggole> Hmm, exists might be ok
<flux> or fold/iter and exceptions :)
<flux> no, it will tell only if there is 1 or more elements
<pippijn> max_elt is not O(1)
<flux> ah, that is correct
<pippijn> and neither is min_elt
<pippijn> they are O(depth)
ousado_ has joined #ocaml
<ggole> Oh. Hmm.
<flux> and Set.split is not good either
ousado has quit [Read error: Operation timed out]
ousado_ is now known as ousado
ousado has quit [Changing host]
ousado has joined #ocaml
<flux> so the only way is then fold/iter and an exception
<ggole> So: a fold, passing a count as the accumulator, raising an exception after the first?
<flux> but actually they suck as well
<flux> because don't they start from min_elt?
<ggole> Ack.
<pippijn> they don't?
<flux> "The elements of s are presented to f in increasing order with respect to the ordering over the type of the elements."
<Drup> every operation will need to go to the leaf anyway
<pippijn> Drup: right
<pippijn> fold will need that, too
<flux> so it appears there is no way to do that
<pippijn> the implementation needs to provide an is_singleton
<pippijn> it can do that in O(1)
<flux> well, other than Obj.magickin the bejesus out of it
<pippijn> are there more than one representation for singleton?
<flux> maybe it should provide a way to iterate in the tree order
amirmc has joined #ocaml
<pippijn> if not, you can check s = Set.singleton ob
<flux> hey, how about this
<ggole> It's just Node (Empty, val, Empty, _)
librarian has left #ocaml []
<flux> Set.compare (Set.singleton (Set.choose s)) s
<ggole> Trivial :(
<pippijn> ggole: yes
<pippijn> _ = 1?
<ggole> choose is min_elt.
<flux> whyyy?
<pippijn> choose == min_elt :)
<flux> hmm, probably because "equal elements will be chosen for equal sets"
<flux> but I think 'choose' would have been the perfect interface for retrieving the element that is the fastest to retrieve :-o
<pippijn> # module S = Set.Make(String);;
<pippijn> # S.min_elt == S.choose;;
<pippijn> - : bool = true
<flux> well, Set should have .fast_choose then
<flux> it appears there is no way to get any element from Set without O(lg n)
<Drup> if I remember correctly, Set is a balanced binary tree, so there is no "fastest" element to retrieve ...
<ggole> I'm not expecting the sets to be huge, maybe I should just wrap a list.
<flux> drup, ..there is no root node in the seT?
<flux> all values are in the leafs?
<Drup> depend of the encoding of the tree, I don't know
<flux> I would expect there is a root node with a value
<ggole> It's an AVL tree with values at each branch.
<ggole> Of course one shouldn't rely on that.
<flux> of course, but somen values are faster to retrieve than others, yes?
mfp has joined #ocaml
<ggole> Yes, but you have no guarantee of which ones.
<flux> I think I wouldn't care in that case
<flux> if I did care, I would use min_elt etc..
<ggole> Really the thing I want is val single: 'a t -> 'a option, and picking a value isn't helpful for that.
<ggole> I'll just wrap a list.
<ggole> And cry a bit if the sets get large.
jbrown has quit [Remote host closed the connection]
nlucaroni has joined #ocaml
mfp has quit [Ping timeout: 264 seconds]
thomasga has quit [Quit: Leaving.]
tane has joined #ocaml
djcoin has quit [Quit: WeeChat 0.4.0]
AltGr has quit [Quit: Konversation terminated!]
skchrko has quit [Quit: Leaving]
<pippijn> ggole: if the sets are small, lists are actually much better
mfp has joined #ocaml
<pippijn> ggole: I had a priority queue with 5-30 elements and it was much faster a list than as a set
<pippijn> linear search for the place to insert was faster
<pippijn> than binary search but with the set overhead
ulfdoz has joined #ocaml
<ggole> We'll see how this goes.
<pippijn> actually
<pippijn> that was a mutable list
<pippijn> maybe that's an unfair comparison
ygrek has quit [Ping timeout: 248 seconds]
<ggole> You could do a pretty nice fast mutable set with a bit of *cough* Obj.magic
<companion_cube> hashtables make good mutable sets
<ggole> Slow union/difference/intersection though.
<ggole> Although the data structure I was thinking of would probably suffer the same drawback.
<companion_cube> assuming lookup is O(1), those operations are O(ln n)
jbrown has joined #ocaml
<companion_cube> not too shabby, is it?
<companion_cube> (union may be more expensive than intersection)
<ggole> For hash tables?
<ggole> All of those are linear time afaict
<companion_cube> yes
<ggole> (Linear in the size of the table that you are not changing.)
thomasga has joined #ocaml
<pippijn> hash tables are unordered sets
Yoric has joined #ocaml
* ggole idly wonders why one of the type signatures has a _
<companion_cube> just because it does not use the type variable
<ggole> But neither does is_empty, and that has a variable?
<ggole> (Makes sense though.)
Yoric has quit [Ping timeout: 256 seconds]
olasd has quit [Ping timeout: 264 seconds]
olasd has joined #ocaml
<companion_cube> right
<nlucaroni> I'm having a hell of a time getting compilation with ocamlbuild -use-ocamlfind with c-libraries to build a cma file w/out "missing external function" messages on execution. Can someone suggest a myocamlbuild.ml file and compare where I may be going wrong?
<nlucaroni> ... or if someone can help me figure out the proper final link command. I feel like I've tried every permutation of options.
Yoric has joined #ocaml
amirmc has quit [Quit: Leaving.]
<companion_cube> sorry nlucaroni, I never compiled C stubs :(
void64 has joined #ocaml
Yoric has quit [Ping timeout: 256 seconds]
Drup has quit [Ping timeout: 246 seconds]
ontologiae has quit [Ping timeout: 240 seconds]
Neros has quit [Ping timeout: 248 seconds]
Drup has joined #ocaml
contempt has quit [Remote host closed the connection]
contempt has joined #ocaml
introom has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 256 seconds]
mcclurmc has quit [Quit: Leaving.]
introom has quit [Read error: Connection reset by peer]
introom has joined #ocaml
Neros has joined #ocaml
darkf has quit [Quit: Leaving]
introom has quit [Read error: Connection reset by peer]
introom_ has joined #ocaml
introom_ has quit [Remote host closed the connection]
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 245 seconds]
Yoric has joined #ocaml
n06rin has quit [Quit: Leaving.]
<adrien> nlucaroni: try setting up an oasis project
<adrien> nlucaroni: I find that ocamlbuild is fairly annoying for C stubs without a myocamlbuil.ml
<adrien> and oasis will give you one
<adrien> (properly set)
ontologiae has joined #ocaml
tianon has quit [Quit: "I'm a very important man. I've got a tower!"]
amirmc has joined #ocaml
_andre has quit [Quit: leaving]
zpe has quit [Remote host closed the connection]
carleastlund has joined #ocaml
oriba has joined #ocaml
ontologiae has quit [Ping timeout: 264 seconds]
jayprich has quit [Quit: jayprich]
Snark has quit [Quit: leaving]
tianon has joined #ocaml
ggole has quit []
Neros has quit [Ping timeout: 240 seconds]
stevej has joined #ocaml
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
Yoric has quit [Remote host closed the connection]
tane has quit [Ping timeout: 261 seconds]
Yoric has joined #ocaml
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
thomasga has quit [Quit: Leaving.]
zpe has joined #ocaml
ollehar has quit [Ping timeout: 264 seconds]
zpe has quit [Ping timeout: 260 seconds]
Neros has joined #ocaml
<nlucaroni> adien: I had used oasis, but I have c-files that are generated with rules and wasn't able to include them persistently when remaking the setup. Unless there was something I missed in the docs...
<nlucaroni> adrien* opps, sorry.
dfan has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
snearch has joined #ocaml
amirmc has quit [Quit: Leaving.]
nlucaroni has quit [Quit: leaving]
Yoric has quit [Ping timeout: 246 seconds]
smondet has quit [Remote host closed the connection]
pkrnj has joined #ocaml
beginner42 has joined #ocaml
pkrnj has quit [Quit: Computer has gone to sleep.]
Neros has quit [Remote host closed the connection]
Neros has joined #ocaml
walter has joined #ocaml
beginner42 has quit [Quit: Leaving]
snearch has quit [Quit: Verlassend]
Simn has quit [Quit: Leaving]
csakatoku has joined #ocaml
n06rin has joined #ocaml