flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
kg4qxk has quit ["messing with the server"]
kg4qxk has joined #ocaml
seafood has joined #ocaml
seafood has quit [Client Quit]
longh has quit [Read error: 104 (Connection reset by peer)]
onigiri has joined #ocaml
onigiri has quit []
Mr_Awesome has quit [Read error: 60 (Operation timed out)]
snhmib has quit ["Good riddance!"]
seafood has joined #ocaml
seafood has quit [Client Quit]
pango has quit [Remote closed the connection]
pango has joined #ocaml
Mr_Awesome has joined #ocaml
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
Associ8or has joined #ocaml
Associat0r has quit [Read error: 104 (Connection reset by peer)]
<guyzmo> hi
<guyzmo> how do I access line n in a file ?
netx has joined #ocaml
jeddhaberstro has quit []
<guyzmo> I found 'seek_in c n' followed by 'input_line c' but I've got a bug : the first character of the line is not output :-S
<thelema> guyzmo: I bet the first character is getting eaten by the seek_in, and needs to get prepended.
<guyzmo> thelema - how can I do that ? I mean, I don't know what character it should be
<guyzmo> shall I seek_in n-1 and input_line two times ?
<guyzmo> hm.. that'd be stupid on one line file it won't work
<thelema> best fix is to change seek_in
<guyzmo> ugh ?
<guyzmo> I'm still a noob at ocaml :|
<thelema> wait, are you mixing Unix IO with stdlib IO?
<guyzmo> I don't know, it's not impossible
<guyzmo> I'm using open_in
<thelema> n/m...
<thelema> you're good. I missed it in pervasives.
<guyzmo> how could I tell whether I'm using unix io or stidlib ?
<guyzmo> ok
<guyzmo> I'm noob, so I'm rtfming a lot (and getting headaches :p)
<thelema> you're using stdlib unless you do things like [open Unix] or use Unix.* functions
<thelema> if you seek_in n-1, what do you get on input_char?
<guyzmo> well, I'm testing on one line files :)
<thelema> the beginning of the file is position 0, right?
<guyzmo> hm... it seems it's 1
<guyzmo> uh
<thelema> it's 0 on my computer.
<guyzmo> right that's why I 'uh'ed
<guyzmo> lex is starting at 1
<guyzmo> but seek_in at 0
<guyzmo> hm think that was the problem
<guyzmo> but weird that it ate the first char instead of raising an error or whatever
<guyzmo> thanks
christo_m has joined #ocaml
<christo_m> how can i iterate over a list of ints in ocaml?
<guyzmo> christo_m - List.iter
<thelema> or if you're feeling imperative, for i = 0 to List.length lst do ... done
<thelema> but the List.nth solution isn't very efficient.
<thelema> better for arrays.
<christo_m> say i have a seperate module with a list of test values and its called test2.ml
<christo_m> do i just put open test2 in my main file?
Associ8or has quit []
<christo_m> ??
<guyzmo> ok thanks good night ;)
<christo_m> guyzmo:
<christo_m> help me out bud
<guyzmo> christo it's 6am here, and I have to be up in a few hours
<guyzmo> and I'm a ocaml noob, so I'm off to bed :)
<christo_m> goodnight
<christo_m> thelema: ?
<christo_m> i love u :)
<guyzmo> well you could put the values in functions in Test2 and open them from the main file, yes
<guyzmo> but I'd better use stdin for testing
<christo_m> no its not about htat
<guyzmo> though it depends on what you're coding
<guyzmo> anyway
<guyzmo> gn :)
<guyzmo> +
<christo_m> the requirements neeed me to do it this way
<christo_m> lol goodnight
* guyzmo &
<christo_m> thelema: you thereee
<thelema> back. [open Test2]
<christo_m> why does it need to be capitalized
<christo_m> the files called test2.ml
<thelema> the name of the module is Test2
<thelema> modules always start with a capital letter.
<thelema> Just an oddity of ocaml you'll have to accept.
filp has joined #ocaml
<christo_m> even if the file isnt capitalized
filp has quit [Client Quit]
<thelema> yes.
<christo_m> if i just have a list defined in Test2
<christo_m> can i just access it lke Test2.mylist
<christo_m> im thinking like python here
<thelema> yes.
<christo_m> bomb
<christo_m> so List.iter myfunc Test2.mylist would work
<thelema> good luck from here - gotta sleep.
<flux> christo_m, open Test2
<flux> uh, never mind :)
<christo_m> haha
<christo_m> flux: thanks anywya tho
<christo_m> whats this about: Unbound module Test2
<flux> christo_m, ocamlc -o proggy test2.ml yourotherfile.ml
<flux> christo_m, note that if a module depends on another module, the dependant module must be after its dependency
<christo_m> flux: i also put open List at the top didnt help
<christo_m> something wrong with the !x
rmns has left #ocaml []
<christo_m> any ideas?
<christo_m> flux: ?
<flux> christo_m, what is the problem? it produces something for me..
<christo_m> h realy?
<christo_m> chris@chris-laptop:~/Programming/ex-2-a$ ocamlc -o testprog test2.ml prog2.ml
<christo_m> File "prog2.ml", line 19, characters 1-3:
<christo_m> This expression is not a function, it cannot be applied
<flux> right
<flux> I didn't have Test2 so I did without
<flux> the problem is that a module can consist of either expressions or one top-level statement
<flux> whitespace isn't significant in ocaml, so what you have there means actually: !x List.iter totient Test2.test_values
<flux> that is: call function !x with these three values
<flux> you need to add ;; after !x
<flux> or you can add let _ = before the List.iter
<christo_m> flux: This expression has type int -> int but is here used with type int -> unit
<christo_m> i get that then
<flux> what do you have now?
<christo_m> i just showed u
<flux> how is Test2.test_values defined?
<christo_m> let test_values = [12;24;36]
<christo_m> ;;
<flux> that looks ok
<flux> but you have some other problem with prog2.ml then
<christo_m> hmm
<christo_m> not quite sure
<flux> as I pasted the code before List.iter to my toplevel earlier, it worked just fine (after adding ;;, which is required in the toplevel)
<flux> so it must be a problem with the code you've added after that
seafood has joined #ocaml
<christo_m> flux: no idea man
<christo_m> flux: i showed u all the code there is lol
Mr_Awesome has joined #ocaml
christo_m has quit [Read error: 113 (No route to host)]
<palomer> where are the pcre docs
<palomer> I want to find out how to split a string by the format characters
<palomer> (\t\n )
<flux> Pcre.split ~pat:"[ \t\n]"
<flux> find pcre.mli..
<flux> but iirc that ~pat isn't properly documented there
mishok13 has joined #ocaml
<flux> I originally thought it was just a string, not a regular expressions that is automatically compiled
<palomer> that supports UTF8?
<palomer> ~flags:[`UTF8] doesn't work with split
<palomer> let (r:Pcre.regexp) = Pcre.regexp ~flags:[`UTF8] "(\t|\n| )+" in print_int (List.length (Pcre.split ~rex:r "haha hoho"))
<palomer> that returns 3
<palomer> for some odd reason
<palomer> ahh
<palomer> I have to use [\t\n ]+
<palomer> but why?
netx has left #ocaml []
<flux> hmm..
<flux> I can't say :)
Submarine has joined #ocaml
rmns has joined #ocaml
seafood has quit []
<palomer> and \s works great!
<flux> the regexp problem intriqued me so I asked on another channel
<flux> it turns out it's related to using group match, which always returns one element, or something :)
<flux> perhaps (?:\t|\n| )+ would work just as fine
<flux> (the problem is repeatable in perl, and the solution works there)
filp has joined #ocaml
Palace_Chan has quit [Client Quit]
Submarine has quit [Remote closed the connection]
<palomer> http://www.magnesium.net/~palomer/snapshot1.png <--how do I get rid of the unevenness?
<palomer> flux, ahh, that's what I suspected
_zack has joined #ocaml
<flux> palomer, have you tried different packing options?
<flux> iirc there was some homogenous-option
<flux> (it's been eons since I've last touched gtk)
Camarade_Tux has joined #ocaml
<palomer> there's no packing involved
<palomer> add_child_at_anchor <--I'm using this function
<palomer> I'm starting to think maybe I shouldn't be using a text view...
<palomer> is it possible to have a table and not specify the number of columns?
bohanlon has quit [Connection timed out]
<palomer> actually
<palomer> that wouldn't work
<Camarade_Tux> palomer, if you're trying to figure out the problems you've posted on the lablgtk mailing-list, I think I solved it once by using tables, that was several months ago but it could be the only solution
<Camarade_Tux> disclaimer: woke up nine minutes ago ;)
<palomer> tables would make my life __way__ easier
<palomer> BUT, I'd want every cell to decide its own width
<palomer> can I do that with tables
<Camarade_Tux> I think so
<palomer> so to mix text and entries I would use labels?
<Camarade_Tux> I need to find my source code
<Camarade_Tux> I don't know if it still contains that, need to install the ao bindings
<palomer> hrmph
<palomer> maybe I can just shrink the entry
<Camarade_Tux> there was this message at the beginning of the year on the lablgtk mailing-list too :http://yquem.inria.fr/pipermail/lablgtk/2008-February/000091.html
<palomer> yay!
<palomer> changing the font size of the entry works great
<Camarade_Tux> great then :)
<Camarade_Tux> hmm, I'll need to reinstall godi
tcr has joined #ocaml
<palomer> hrmph
<palomer> I need to make my font itty bitty
<palomer> still a little ugly
rstites has quit [Remote closed the connection]
<Camarade_Tux> somebody pointed me to the piet programming language : http://www.dangermouse.net/esoteric/piet.html
<Camarade_Tux> be sure not to miss the examples : http://www.dangermouse.net/esoteric/piet/samples.html
rstites has joined #ocaml
<grirgz> the pietre programming langage ? :p
rstites has quit [Remote closed the connection]
<Camarade_Tux> grirgz, lol ;)
<Camarade_Tux> but I can believe anybody can do anything in piet !
<Camarade_Tux> s/can/can't
<Camarade_Tux> of course ;)
rwmjones_ has quit [kornbluth.freenode.net irc.freenode.net]
grirgz has quit [kornbluth.freenode.net irc.freenode.net]
det has quit [kornbluth.freenode.net irc.freenode.net]
hcarty has quit [kornbluth.freenode.net irc.freenode.net]
ski_ has quit [kornbluth.freenode.net irc.freenode.net]
jonafan has quit [kornbluth.freenode.net irc.freenode.net]
rwmjones_ has joined #ocaml
grirgz has joined #ocaml
det has joined #ocaml
jonafan has joined #ocaml
ski_ has joined #ocaml
hcarty has joined #ocaml
<tcr> Can anyone explain why List.map2 (fun x y -> (x,y)) results in monomorph types, or refer to some informational resource explaining it?
rstites has joined #ocaml
rmns has quit [kornbluth.freenode.net irc.freenode.net]
Mr_Awesome has quit [kornbluth.freenode.net irc.freenode.net]
rodge has quit [kornbluth.freenode.net irc.freenode.net]
gildor has quit [kornbluth.freenode.net irc.freenode.net]
fremo has quit [kornbluth.freenode.net irc.freenode.net]
olegfink has quit [kornbluth.freenode.net irc.freenode.net]
OChameau has joined #ocaml
mattam has joined #ocaml
rmns has joined #ocaml
Mr_Awesome has joined #ocaml
rodge has joined #ocaml
fremo has joined #ocaml
olegfink has joined #ocaml
gildor has joined #ocaml
<Camarade_Tux> google definitely changes the results, I searched for "artistic" and got wikipedia's article on the artistic license as the first result (which was what I was looking for ;) ), that's scary
<mfp> tcr: google for "value restriction"
<mfp> tcr: the standard workaround is eta expansion -> instead of let f = List.map2 (fun x y -> (x,y)), let f a b = List.map2 (fun x y -> (x,y)) a b
<mfp> (btw., this function is also called List.combine)
<tcr> mfp: Yes, I know about the workaround. I'm interested in what's causing it (Haskell's `zipWith (,)' doesn't result in a monomorph constrain.)
<tcr> mfp: Thanks for the value restriction pointer, seems to be exactly what I was looking for. I'll read through it later.
<rwmjones_> tcr there's a faq page about this ... let me find it
seafood has joined #ocaml
seafood has quit [Connection reset by peer]
mattam has quit [Remote closed the connection]
seafood has joined #ocaml
seafood_ has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood_ has quit [Client Quit]
seafood has joined #ocaml
seafood has quit [Read error: 54 (Connection reset by peer)]
seafood has joined #ocaml
seafood_ has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
seafood_ has quit [Read error: 104 (Connection reset by peer)]
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
rmns has left #ocaml []
Associat0r has joined #ocaml
seafood has quit []
mattam has joined #ocaml
GustNG has joined #ocaml
<_zack> rwmjones: funny that that FAQ is written entirely in English beside the last sentence which is in French :)
<guyzmo> hi
<guyzmo> _zack - the sentence in french is the same at the one before
<_zack> guyzmo: yup, I know, I was just pointing at the refuse
<guyzmo> I'm sure they forgot to remove it when they translated the doc
<_zack> indeed
<guyzmo> hm got a question: I'm refactoring a project by moving files into a directory, so I have parsing/parser.ml parsing/lexer.ml that I will access from main.ml, instead of parser.ml and lexer.ml that I used to access from the same directory as main.ml
<thelema> the only difference is when you compile, you have to compile with the files in the parsing directory -- they're still called Parser and Lexer in your main.ml
<guyzmo> ok
<ertai> hcarty: thanks!
tomh- has joined #ocaml
<hcarty> ertai: You are quite welcome. Thank you! This is a huge help.
<ertai> hcarty: Have you tried some more complex usage examples ?
gim has joined #ocaml
willb has joined #ocaml
<hcarty> ertai: I've tried the Jane St. OSP pa-do project, pa_openin, other small extensions written by myself and others and the revised and standard syntax extensions from the toplevel and compiled code
<hcarty> ertai: Under OCaml 3.10.2 I have not run in to any errors. I have tested less (pa_do, standard and revised syntaxes) with CVS HEAD because of some godi/library issues that I have not had time to look in to
sporkmonger has joined #ocaml
<hcarty> ertai: The CVS unified diff applied pulled from the OCaml anonymous CVS web interface applied to 3.10.2, with the only broken piece being the revision comment at the start of the diff
<hcarty> ertai: I also rebuilt my godi install with the patched 3.10.2, somewhere between 30 and 35 packages, with the patched 3.10.2 without issue. This includes the Jane St. sexplib and Martin Jambon's mikmatch.
<hcarty> ertai: Perhaps this change could make it in to 3.10.3, if there is such a release?
<guyzmo> hm... so about my seperated compilation problem : I have the parsing directory where I have my Makefile and where I do compile several .cmo and I have main.ml in the source's root directory... I want to create a project's root Makefile where I compile main.ml using parsing/*.cmo... I was able to create main.cmo using ocamlc -I parsing/, but I don't know how can I 'ocamlc -o compiler main.cmo' using parsing/*.cmo without having to reference explicitely
<guyzmo> I'm trying to find relevant rtfm... but my googling haven't been good so far
Smerdyakov has quit [Read error: 110 (Connection timed out)]
Morphous has joined #ocaml
tomh- has quit ["http://www.mibbit.com ajax IRC Client"]
<guyzmo> damn I hate loosing time on makefiles :(
Amorphous has quit [Connection timed out]
GustNG1 has joined #ocaml
mishok13 has quit [Read error: 110 (Connection timed out)]
pango has quit [Remote closed the connection]
marmotine has joined #ocaml
GustNG has quit [Read error: 110 (Connection timed out)]
GustNG has joined #ocaml
GustNG1 has quit [Read error: 110 (Connection timed out)]
Smerdyakov has joined #ocaml
jlouis has joined #ocaml
pango has joined #ocaml
_zack has quit ["Leaving."]
christo_m has joined #ocaml
<christo_m> my test2.ml is this let test_values = [12;24;36] ;;
<christo_m> any idea why i get this: File "prog2.ml", line 21, characters 10-17:
<christo_m> This expression has type int -> int but is here used with type int -> unit
pierre- has joined #ocaml
<flux> christo_m, List.iter expects a function that returns unit
<flux> your function returns an integer
<flux> maybe you want something like List.iter (fun x -> Printf.printf "%D\d\n" (totient x)) Test2.test_values
<flux> the printf format string is messed up
<flux> but I'll get back to you once I get off the mobile irc,, within an hour
munga has quit ["Leaving"]
longh has joined #ocaml
jlouis has quit [Read error: 104 (Connection reset by peer)]
jlouis has joined #ocaml
snhmib has joined #ocaml
filp has quit ["Bye"]
TheLittlePrince has joined #ocaml
jlouis has quit [Remote closed the connection]
<flux> christo_m, so the like would've been: List.iter (fun x -> Printf.printf "%d\n" (totient x)) Test2.test_values
<flux> line, even
jlouis has joined #ocaml
Linktim has joined #ocaml
rwmjones_ has quit ["Closed connection"]
OChameau has quit ["Leaving"]
TheLittlePrince has quit [Client Quit]
tomh- has joined #ocaml
tomh- is now known as tomh
Yoric[DT] has joined #ocaml
Palace_Chan has joined #ocaml
mishok13 has joined #ocaml
netx has joined #ocaml
_zack has joined #ocaml
rwmjones_ has joined #ocaml
Snark_ has joined #ocaml
mishok13 has quit [Read error: 110 (Connection timed out)]
Linktim_ has joined #ocaml
christo_m has quit [Read error: 113 (No route to host)]
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
tcr has quit ["Leaving."]
GustNG1 has joined #ocaml
pierre- has quit [Success]
Linktim has quit [Read error: 113 (No route to host)]
GustNG has quit [Read error: 110 (Connection timed out)]
GustNG1 has quit ["Leaving."]
Submarine has joined #ocaml
Snark_ has quit ["Ex-Chat"]
Submarine has quit [Remote closed the connection]
Submarine has joined #ocaml
Smerdyakov has quit ["Leaving"]
Smerdyakov has joined #ocaml
jeddhaberstro has joined #ocaml
ulfdoz has quit [Remote closed the connection]
<Yoric[DT]> Ok, fix for [Ref] bug confirmed.
<Yoric[DT]> Now, attempting to fix that annoying documentation bug.
tomh has joined #ocaml
<palomer> [Ref] bug?
rwmjones_ has quit ["Closed connection"]
<Yoric[DT]> palomer: a bug in Batteries Included
<Yoric[DT]> This bug prevented Batteries from working in the toplevel.
hkBst has joined #ocaml
<palomer> ah
* palomer wishes batteries existed before
ulfdoz has joined #ocaml
* Yoric[DT] too.
* Yoric[DT] wouldn't have had to write it, for one thing :)
<olegfink> Yoric[DT]: does Batteries have ($) and (.)
<olegfink> ?
* olegfink feels that he has asked before
<Yoric[DT]> Batteries has
<Yoric[DT]> val ( |> ) : 'a -> ('a -> 'b) -> 'b
<Yoric[DT]> val ( <| ) : ('a -> 'b) -> 'a -> 'b
<Yoric[DT]> val ( |- ) : ('a -> 'b) -> ('b -> 'c) -> 'a -> 'c
<Yoric[DT]> val ( -| ) : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b
_zack has quit ["Leaving."]
<hcarty> Yoric[DT]: ertai was kind enough to fix the #use "foo.ml";; + camlp4 toplevel-breaking bug in CVS HEAD. So syntax extensions seem to work properly in the toplevel now, with the patch applied.
<Yoric[DT]> hcarty: great.
<Yoric[DT]> olegfink: unless I'm mistaken, $ is <|
* Yoric[DT] doesn't remember which one is .
<olegfink> yes, and . is |-
<olegfink> (I think)
<olegfink> forgot everything I never knew about haskell.
<Yoric[DT]> Of course, we can't use $ because of Camlp4.
_Jedai_ has joined #ocaml
Torment has joined #ocaml
<olegfink> (.) :: (b -> c) -> (a -> b) -> a -> c
<olegfink> ah, the other way around, -|
<Yoric[DT]> Yeah.
<hcarty> Yoric[DT]: I've heard that you can't use ( $ ) b/c of camlp4, but what does it break?
<zbrown> Hmmm whats the best way to check that a string only contains specified letters?
<Yoric[DT]> hcarty: anti-quotations.
<hcarty> Small tests seem to work, but I've only toyed around with it
<zbrown> like in python, you can use "all(s in "ABC" for s in str)"
<hcarty> Yoric[DT]: Does it break extension code, or code written using camlp4 extensions?
<Yoric[DT]> hcarty: probably extension code, although quotations/anti-quotations could be used as simple DSLs inside regular OCaml.
<Yoric[DT]> zbrown: well, with the standard library, there's nothing as simple.
<zbrown> hmmm
<Yoric[DT]> zbrown: with ExtLib, you could do something similar, though.
<hcarty> zbrown: String.iter wrapped with try ... with ... ?
<zbrown> hcarty: ya something like that is what I have
<zbrown> I just wasn't sure if there was anything that I had missed :)
<Yoric[DT]> Something along the lines of [Enum.exists (fun x -> String.find x "ABC") String.enum s]
<det> Batteries included should just depend on Xavier Leroy's Zip library, instead of providing only 1-way unzip functionality
<hcarty> zbrown: String.fold_left (fun accu c -> accu && c = 'A') true "AAA";; maybe?
<Yoric[DT]> det: fair enough.
<hcarty> zbrown: Though that gives "true" on an empty string, which may not be what you want.
<Yoric[DT]> det: Could you file a Request ffor Features?
<det> ok
<det> Does OBI encourage dependent libraries to be developed within OBI, instead of being a dependency ?
<Yoric[DT]> det: it seems that ocamlzip is packaged for Debian and GODI but I can't find it for Fedora, though, which may be a problem.
<Yoric[DT]> (we'll just need to nudge rwmjones into finding someone to take care of that:))
<det> ahh,
<Yoric[DT]> det: what do you mean?
<zbrown> Yoric[DT]: hmmm know of a way to use extlib modules with the Ocaml REPL?
<zbrown> ( I was going to test your suggestion)
<det> Can't you compile to a cma instead of executable and run ocaml on that
<hcarty> Yoric[DT]: ocamlzip is packaged for Fedora. I don't remember the package name though.
<Yoric[DT]> zbrown: I assume something along the lines of [#use "topfind";; #require "extlib";;].
<Yoric[DT]> hcarty: ok, good to know.
<Yoric[DT]> Oh, yeah, it's zipped.
<hcarty> Yoric[DT]: An annoying problem, though, is that godi and Debian/Fedora use different ocamlfind names
<Yoric[DT]> Sorry, packaged.
<Yoric[DT]> hcarty: gasp.
<Yoric[DT]> Is that true?
* Yoric[DT] wasn't aware of that issue.
<hcarty> Very, sadly
<det> Yoric[DT], Are bin-prot/type-cov/sexp-lib packaged for Deb/RPM ?
<hcarty> I have a "fake" package I install under godi to match the Debian naming
<Yoric[DT]> det: for Fedora, yes.
<zbrown> hmmm
<hcarty> Yoric[DT]: I think it's "camlzip" under godi and just "zip" in Debian and Fedora
<zbrown> Yoric[DT]: seems there is no 'Enum.exists' ?
<Yoric[DT]> zbrown: gasp.
<zbrown> I'm looking at docs and can't seem to find it
<det> in Ubuntu, it is libzip-ocaml and libzip-ocaml-dev
<det> Debian, too
<Yoric[DT]> zbrown: so it may be one of my patches which haven't been accepted yet, sorry.
<zbrown> oh ok
<zbrown> thanks though :)
* zbrown needs to run to class
<Yoric[DT]> det: yeah, bin-prot, type-conv and sexplib are in testing.
<det> ahh, cool :-)
<det> I'll get the source packages and upload them to a ppa for Ubuntu, see if they work out of the box
Linktim_ has quit ["Quitte"]
Jedai has quit [Read error: 110 (Connection timed out)]
* Yoric[DT] must admit he gave up on OCaml on Ubuntu some time ago and went GODI.
|Jedai| has quit [Read error: 110 (Connection timed out)]
willb has quit [Read error: 104 (Connection reset by peer)]
_zack has joined #ocaml
struktured has joined #ocaml
Camarade_Tux has quit [Remote closed the connection]
<zbrown> Yoric[DT]: I'm getting to the point where I agree.. I'm not sure the ocaml packager has it together on ubuntu
<Yoric[DT]> Yeah :/
<zbrown> i just actually got rid of the packages for ocaml and am doing a godi install now
Palace_Chan has quit ["Palace goes to sleep"]
hkBst has quit [Read error: 104 (Connection reset by peer)]
<det> I've never experienced ocaml problems on Ubuntu
<det> What is wrong ?
alexyk has joined #ocaml
<ertai> hcarty: No, a 3.10.3 release should not happen
<hcarty> ertai: Ok, I'll stick with my patched 3.10.2 for now then
<ertai> hcarty: only if 3.11 cause too much issues
<alexyk> how do I count how many spaces I have in a line in a *very* fast way? I need to count words in each line of a 50 GB file and to beat C with *c++==' ' !
<ertai> hcarty: thanks for the testing!
<hcarty> ertai: You are quite welcome. Thanks again for the fix! It has already helped me out
<struktured> alexyk: have you tried implementing any solution yet?
<hcarty> ertai: And it should remove the need for workarounds for at least a few extensions (mikmatch, pa-do)
<alexyk> struktired: I've been rusty for a few months... DO I need buffers at all or PLEAC-style readline loop will do?
<alexyk> I want SPEED
<alexyk> struktured I meant (sorry)
<jlouis> alexyk, how about doing an implementation first and then measure it
<jlouis> *any* implementation
<struktured> alexyk: I honestly don't know, but I'm curious to know what you end up writing. and jlouis is on the same track as me
bohanlon has joined #ocaml
<struktured> jlouis: you could write List.foldl pretty easily I bet
<alexyk> well then just wonder whether I need buffers at all... remember in spamoracle code there's lots of buffers
<struktured> alexyk: add that magic after the fact. start with correctness
<jlouis> it should be easy to get inside 50% of C's performance with a rather blind implementation I think
<jlouis> And you can probably get closer with a little manual unrolling to lower the pressure on the branch predictor
<jlouis> and then, you must begin thinking on bringing another CPU into the game...
<jlouis> so just start with the sequential solution that is naive
_zack has quit ["Leaving."]
jlouis has quit ["Leaving"]
<alexyk> so it's a bad taste to iterate along the characters of a string and count some? :)
<alexyk> w/o a recursion but just with a for? :)
vanjuggler has joined #ocaml
<vanjuggler> hi
* Yoric[DT] doesn't believe that [*c++==''] can be beaten.
<Yoric[DT]> hi vanjuggler
<vanjuggler> I'm very very new to ocaml, but i've found a bug in some ocaml code i'm using (ometastore) where it does 'Unix.mkdir e.path', but this fails if it needs to create several directories. I'd like it to do something more like `mkdir -p` in unix. any ideas?
alexyk has quit []
<gildor> vanjuggler: use ocam-fileutils
<vanjuggler> okay
scourge has joined #ocaml
<gildor> use "mkdir ~parent:true e.path"
scourge is now known as frozen_vegan
<vanjuggler> gildor: thanks - i think i'd need to backport ocaml-fileutils, ...
<gildor> backport to where ?
<vanjuggler> I'm on ubuntu dapper
<vanjuggler> gildor: i think you've set me down the right path
<vanjuggler> maybe no backporty
<gildor> Is there not already a libfileutils-ocaml-dev
<vanjuggler> ya, just found it.
<vanjuggler> but we've bumped ocaml-nox (IIRC), so we need to re-build
<gildor> just rebuild the package
<vanjuggler> ya
<gildor> It should works fine
<vanjuggler> #ocaml++
<vanjuggler> gildor: i'll have to "open FileUtils" or something too?
<gildor> wait a sec
<gildor> unfortunately this not as simple as i want (things are changing because i am working on it)
<gildor> open FileUtil;;
<det> does FileUtils 'mv' catch exceptions when the rename would be cross-device and do a copy ?
<gildor> open FilePath.DefaultPath;;
<gildor> open FileUtil.StrUtil;;
<gildor> no but this is a bug
<gildor> I hope to release a new version that correct this
<vanjuggler> after installing the package, I can't "open FilePath" or any other combo I try
<det> ahh, k
<gildor> have you included fileutils in your include path
<det> I implemented something similar in a program I made
<vanjuggler> heh, well i would ass-u-me that if i installed fileutils deb package, it would "just work"
<det> and had to catch the exceptions because it usually opened files from /tmp
<gildor> det: feel free to send me a patch if you have time ;-)
<det> I'm not sure how correct mine is
<det> I catch Sys_error
<gildor> vanjuggler: you to tell ocaml to use it when compiling
<vanjuggler> okay
<gildor> you have to tell
<vanjuggler> right
<det> No way to tell why Sys_error was raised
* vanjuggler hacks the makefile
<det> I could use Unix.rename instead, but I wonder if that is as portable
<gildor> det: in fact, you should use Unix.stat to determine if you are copying on the same device or not
<det> Yeah, you are probably right
<vanjuggler> okay, OMakefile now includes: "INCLUDES += /usr/lib/ocaml/3.10.2/fileutils/"
<vanjuggler> but FileUtil is still unbounded
<vanjuggler> hmm
<det> Is it a good idea to hardcode a path like that?
<gildor> INCLUDES += +fileutils
<vanjuggler> nope
frozen_vegan has left #ocaml []
<gildor> is it when compiling or linking ?
<vanjuggler> woot closer
<gildor> det: Unix.rename = Sys.rename
<det> they raise different exceptions
<det> I guess Sys.rename is a wrapper around Unix.rename
<gildor> but this is the same C call (rename)
<gildor> see byterun/sys.c (caml_sys_rename) and otherlibs/unix/rename.c
<gildor> in the ocaml source
<vanjuggler> hmm... here is the OMakefile we're starting with... I've tried a few different things now, but no luck during opening FileUtil
<vanjuggler> I get: Cannot find file fileutils.cmxa
<vanjuggler> i think it's looking for fileutils.cmxa in ./
<vanjuggler> not in my /usr/lib... area
<gildor> can you copy and paste your build output
<vanjuggler> nopaste
frozen_vegan has joined #ocaml
<vanjuggler> sure
* vanjuggler tries something else before pasting
<vanjuggler> gildor: okay, i got the compilation to work with the correct include path
<gildor> great
<vanjuggler> now though, it's complaining about different args to mkdir
<vanjuggler> so is it possible i need FileUtil.mkdir ?
<vanjuggler> if i'm opening Unix
<gildor> open Unix before open FileUtil.StrUtil
<gildor> this will override Unix definition
<vanjuggler> aha
<vanjuggler> i was only doing "open FileUtil"
<vanjuggler> but now i get No implementations provided for the following modules:
<vanjuggler> FileUtil referenced from ometastore.cmx
<gildor> there is .cmxa missing somewhere
<gildor> (in general you should use findlib, if it is possible -- you will have less problem with compilation in general)
<vanjuggler> i see
<vanjuggler> i'm basically just trying to fix a bug in this gibak tool
<vanjuggler> which uses ocaml for ometastore, which tracks file perms/ownerships of git repos
<vanjuggler> it's all cool stuff
Yoric[DT] has quit ["Ex-Chat"]
<vanjuggler> i see the .cmxa in /usr/lib/...
<vanjuggler> but it doesn't seem to be found
<gildor> see http://www.ocaml-tutorial.org/compiling_with_omake there is example to use findlib package with oamek
<gildor> USE_OCAMLFIND = TRUE
<gildor> OCAMLPACKS[] =
<gildor> fileutils
Submarine has quit [Read error: 110 (Connection timed out)]
<vanjuggler> OMG
<vanjuggler> the bug is fixed
Demitar has quit ["Burn the land and boil the sea. You can't take the sky from me."]
ulfdoz has quit ["deprecated"]
<vanjuggler> gildor++ you are great! Thank you so much for your help!
<vanjuggler> i owe you a beer
<vanjuggler> if you're ever in vancouver
<gildor> no problem, I hope fileutils will be better and easier to use in next version
Demitar has joined #ocaml
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
* thelema wonders if fileutils should get merged into batteries
<gildor> thelema: why not, but I am working on a version that is really most simple to use (in term of open XXX)
<gildor> and more clear wrt to the documentation
<gildor> and which fix some bugs in windows
marmotine has quit ["mv marmotine Laurie"]
<thelema> will still require cygwin under windows?
<gildor> I hope to migrate the buildsystem to ocamlbuild
ertai has quit ["leaving"]
<gildor> but ocamlbuild can require cygwin
<gildor> in the library itself, there is no need for cygwin
<gildor> this is pure ocaml + portable Unix
<thelema> fair enough. batteries needs ocamlbuild, so running it under windows will have to wait.
<thelema> hmm, I wonder if it'd be possible to have ocamlbuild output a build script to run all the commands it would run as part of building a project...
<vanjuggler> thanks folks, you've been a real help!
<thelema> doesn't solve the symlink problem, but it does allow ocamlbuild projects to run w/o ocamlbuild
vanjuggler has left #ocaml []
<gildor> thelema: when required i use ocamlbuild -classic-display and copy-paste-filter line with "^+"
<gildor> this is enough to build a shell/bat file with the good command
<thelema> :) nice trick.
frozen_vegan has left #ocaml []
Quadrescence has joined #ocaml
<Quadrescence> I think I will give ocaml another chance. :/
<thelema> it's worth some effort
longh has quit [Connection timed out]
viimrles has quit [Remote closed the connection]
mike_mcclurg has quit [Read error: 104 (Connection reset by peer)]
wlmttobks has joined #ocaml
<Quadrescence> Would anyone mind helping me get the necessary tools for programming in ocaml?
<thelema> what OS?
<Quadrescence> Linux
<Quadrescence> (Ubuntu)
<Quadrescence> I mean, I could just apt-get, but the versions aren't the latest.
* thelema uses Ubuntu
<thelema> but I also compile from CVS
<Quadrescence> And I'm not sure if there are tools like Cabal for Haskell in ocaml.
<thelema> look up GODI
<Quadrescence> GODI, haha, I forgot all about that.
bohanlon has quit ["ERC Version 5.2 (IRC client for Emacs)"]
longh has joined #ocaml