ChanServ 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-lang.org
travisbrady has joined #ocaml
fusillia has quit [Remote host closed the connection]
ontologi1e has quit [Ping timeout: 244 seconds]
chambart has quit [Ping timeout: 246 seconds]
LowPotential has joined #ocaml
<LowPotential> Hi all. I'm trying to build a custom toplevel with modules that use "Batteries Included". I'm calling "ocambuild -use-ocamlfind mytoplevel.top" where "mytoplevel.mltop" lists the names of the modules I want included. I'm getting the error "File "/usr/lib/ocaml/batteries/battop.ml", line 1:Error: Reference to undefined global `Batteries_help'" when I try to run the resulting top-level. Batteries works great o
<LowPotential> therwise. Any ideas? I'm not experienced with these tools.
sivoais has quit [Quit: leaving]
sivoais has joined #ocaml
<thizanne> LowPotential: try with ocamlbuild -use-ocamlfind -package patteries
<thizanne> or is it another syntax ?
<thizanne> well I can't remember and can't check right now, but you have to tell him to use the batteries package
<LowPotential> thizanne: Thanks. It builds, but when I try to run it, I get the same error about "Batteries_help" missing.
joewilliams has left #ocaml []
avsm has quit [Quit: Leaving.]
ivan\ has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
LowPotential has quit [Remote host closed the connection]
ivan\ has joined #ocaml
mcclurmc is now known as mcclurmc_away
sepp2k1 has quit [Read error: Connection reset by peer]
travisbrady has quit [Quit: travisbrady]
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
diego_diego has joined #ocaml
diego_diego has quit [Quit: diego_diego]
tac has joined #ocaml
Progster has quit [Ping timeout: 276 seconds]
Drakken has quit [Ping timeout: 246 seconds]
Drakken has joined #ocaml
pr has quit [Ping timeout: 246 seconds]
pr has joined #ocaml
pr has quit [Changing host]
pr has joined #ocaml
diego_diego has joined #ocaml
diego_diego has quit [Client Quit]
wtetzner has quit [Ping timeout: 248 seconds]
wtetzner has joined #ocaml
wormphlegm has quit [Ping timeout: 248 seconds]
wormphlegm has joined #ocaml
tac has quit [Quit: Page closed]
ankit9 has joined #ocaml
ankit9 has quit [Quit: Leaving]
ankit9 has joined #ocaml
cdidd has joined #ocaml
BiDOrD has joined #ocaml
BiDOrD_ has quit [Read error: Operation timed out]
jewel has joined #ocaml
ulfdoz has joined #ocaml
ulfdoz has quit [Ping timeout: 276 seconds]
answer_42 has joined #ocaml
jewel has quit [Ping timeout: 268 seconds]
pango is now known as pangoafk
answer_42 has quit [Ping timeout: 276 seconds]
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
chambart has joined #ocaml
ankit9 has quit [Ping timeout: 264 seconds]
Cyanure has joined #ocaml
ankit9 has joined #ocaml
Neros has joined #ocaml
djcoin has joined #ocaml
theplanet^2 has joined #ocaml
elixey has quit [Ping timeout: 276 seconds]
andreypopp has joined #ocaml
cago has joined #ocaml
ankit9 has quit [Ping timeout: 245 seconds]
ontologiae has joined #ocaml
Arsenik has joined #ocaml
cago has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
arneis has quit [Ping timeout: 245 seconds]
wormphlegm has quit [Ping timeout: 264 seconds]
wormphlegm has joined #ocaml
Cyanure has quit [Remote host closed the connection]
avsm has joined #ocaml
cago has joined #ocaml
<f[x]> LowPotential: one needs cmi files around for the used toplevel modules
<f[x]> mfp, I've got a (simple) patch to generate `type t` alias for message types - it makes it easier to abstract over generated modules (wrapping into fcm), are you interested?
<f[x]> btw, maybe there is some reason that types are named by the name of the message but not `t`?
<f[x]> probably to reduce collisions when including several modules?
cago has quit [Read error: Connection reset by peer]
<f[x]> mfp, mmmm, I am talking about extprot :)
GnomeStoleMyBike has joined #ocaml
cago has joined #ocaml
<pippijn> I don't understand why ocamllex is slow
<pippijn> the engine is written in C
<f[x]> it allocates for each char
<pippijn> on the C side?
<pippijn> I'm making a drop-in for ocamllex
<GnomeStoleMyBike> \o Hi All
<pippijn> it generates code like this: http://paste.xinu.at/XSJEu/ocaml
<f[x]> I don't remember, probably caml side
<pippijn> it doesn't use Lexing, yet
<f[x]> my summary was that ocamllex is faster than scanf but still does some not necessary allocations
<f[x]> when one needs speed
<f[x]> for speed use ragel
<pippijn> ah, actually that code is currently broken
<pippijn> I like ocamllex' input syntax
<pippijn> there, now it works: http://paste.xinu.at/HMkjD/
_andre has joined #ocaml
Snark has joined #ocaml
fusillia has joined #ocaml
sepp2k has joined #ocaml
iago has joined #ocaml
avsm has quit [Quit: Leaving.]
sivoais has quit [Ping timeout: 244 seconds]
xavierm02 has joined #ocaml
mcclurmc_away is now known as mcclurmc
sivoais has joined #ocaml
avsm has joined #ocaml
GnomeStoleMyBike has quit [Quit: Changing server]
GnomeStoleMyBike has joined #ocaml
mcclurmc is now known as mcclurmc_away
iago has quit [Ping timeout: 240 seconds]
avsm has quit [Quit: Leaving.]
andreypopp has quit [Quit: sleep]
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
xavierm02 has quit [Ping timeout: 268 seconds]
chambart has quit [Ping timeout: 246 seconds]
Kakadu has quit [Read error: Connection reset by peer]
Kakadu_ has joined #ocaml
ontologi1e has joined #ocaml
ontologiae has quit [Read error: Connection reset by peer]
iago has joined #ocaml
uselpa has joined #ocaml
uselpa has quit [Remote host closed the connection]
gnuvince has quit [Read error: Operation timed out]
avsm has joined #ocaml
answer_42 has joined #ocaml
Arsenik has quit [Remote host closed the connection]
fraggle_laptop has joined #ocaml
iago has quit [Read error: Operation timed out]
chambart has joined #ocaml
mcclurmc_away is now known as mcclurmc
Tobu has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
avsm has quit [Ping timeout: 252 seconds]
cago has quit [Ping timeout: 245 seconds]
mcclurmc is now known as mcclurmc_away
travisbrady has joined #ocaml
travisbrady has quit [Client Quit]
mcclurmc_away is now known as mcclurmc
travisbrady has joined #ocaml
beginner42 has joined #ocaml
<beginner42> adrien: i try to get familiar with webkit and your binding, but i cant find any proper api. Could you tell me how i can download a the content of an given url?
<adrien> beginner42: it's over there: http://webkitgtk.org/reference/webkitgtk/stable/index.html and
<adrien> most of the time, you'll probably want to stay inside WebKitWebView
<adrien> WebKitWebFrame has some interesting things but you'll need them less often
<adrien> a starting code would be:
<adrien> let scroll = GBin.scrolled_window ~hpolicy:`AUTOMATIC ~vpolicy:`AUTOMATIC
<adrien> ~packing:(vbox#pack ~expand:true) () in
<adrien> let webview = GWebView.web_view ~packing:scroll#add () in
<beginner42> adrien: thanks, a lot. The resulting code, can hand that on to a html parser in webkit, to look for a specific element using xpath?
fraggle_ has quit [Ping timeout: 240 seconds]
<adrien> beginner42: well, I don't know all the webkit API so I can't really tell: you have to check in the page I've linked you to
<beginner42> adrien: ok. what parts of webkit are covered by your binding? There are so many functions
<adrien> beginner42: almost all the functions except those linked to libsoup (because I haven't made bindings to libsoup) and the DOM-related ones
<beginner42> adrien: so at the moment it is not possible to scan the html parse tree?
<adrien> the DOM would allow that but it
<adrien> but it has been added quite late and I haven't had time to handle it yet
<adrien> but it doesn't mean there is no other way
beginner42 has quit [Read error: Connection reset by peer]
UncleVasya has joined #ocaml
mcclurmc is now known as mcclurmc_away
Yoric has joined #ocaml
metasyntax has joined #ocaml
Kakadu_ has quit [Quit: Konversation terminated!]
ollehar has joined #ocaml
jewel has joined #ocaml
mcclurmc_away is now known as mcclurmc
Kakadu has joined #ocaml
gnuvince has joined #ocaml
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
tac has joined #ocaml
hkBst has quit [Quit: Konversation terminated!]
gnuvince has quit [Ping timeout: 265 seconds]
fusillia has quit [Ping timeout: 260 seconds]
gnuvince has joined #ocaml
mcclurmc is now known as mcclurmc_away
mcclurmc_away is now known as mcclurmc
enkomax has joined #ocaml
Cyanure has joined #ocaml
Cyanure has quit [Max SendQ exceeded]
Cyanure has joined #ocaml
fraggle_laptop has quit [Remote host closed the connection]
Anarchos has joined #ocaml
ollehar has quit [Ping timeout: 244 seconds]
Yoric has quit [Ping timeout: 252 seconds]
Reventlov has joined #ocaml
GnomeStoleMyBike has quit [Ping timeout: 248 seconds]
chambart has quit [Ping timeout: 248 seconds]
chambart has joined #ocaml
mcclurmc is now known as mcclurmc_away
munga has joined #ocaml
<munga> I'm playing with "include module type of" ... but I'm a bit stuck trying to type this functor ...
<munga> module type MySet = functor ( S : Set.S ) -> sig include module type of S val myfunction : int -> unit end
<munga> module T ( S : Set.S ) : MySet = struct include S let myfunction (l : int) = () end
<munga> what am I doing wrong ?
<_habnabit> munga, well, what's the problem?
<thelema> munga: what's the error?
<thelema> also, you probably don't need the module type to extend Set with functions
<munga> :) the error is a Error: Signature mismatch, but a bit long to cut and paste it on irc ...
<_habnabit> munga, that's what pastebins are for
travisbrady has quit [Quit: travisbrady]
<thelema> munga: instead of "include module type of S", why not just "include Set.S"?
<thelema> you're right that the error is non-helpful
jamii has joined #ocaml
<thelema> actually, it is helpful
<munga> if you remove the type annotation on T you get the two signatures that are suspiciously similar : http://pastebin.com/KPZVfpdQ
<thelema> the problem is that ": MySet" is being applied to the result of the functor application, not the functor itself
<_habnabit> munga, you're saying that your functor ret... ^
<thelema> if you want to apply it to the functor itself, you can't use the nice functor shortcut: module T : MySet = functor (S : Set.S) -> struct include S let myfunction ... end
<munga> mumble mumble ... I think I understand ...
pangoafk is now known as pango
sepp2k1 has joined #ocaml
sepp2k has quit [Ping timeout: 256 seconds]
munga has quit [Ping timeout: 248 seconds]
as has joined #ocaml
travisbrady has joined #ocaml
as has quit [Quit: as]
munga has joined #ocaml
rixed has quit [Ping timeout: 276 seconds]
rixed has joined #ocaml
rixed has quit [Ping timeout: 240 seconds]
fraggle_ has joined #ocaml
rixed has joined #ocaml
chambart has quit [Ping timeout: 260 seconds]
Neros has quit [Ping timeout: 264 seconds]
Neros has joined #ocaml
rrolles has joined #ocaml
<rrolles> trying to build a mixed-mode (C/OCaml) executable on Windows, which invokes FlexLink, which has weird behavior
<rrolles> C:\paframework\Z3\Distros\Z3-3.2\examples\ocaml>ocamlc -verbose -w -A -ccopt "" -o test_mlapi_byte.exe -I ..\..\ocaml z3.cma test_mlapi.ml
<rrolles> + flexlink -merge-manifest -exe -link /STACK:16777216 -o "test_mlapi_byte.exe" "-L..\..\ocaml" "-Lc:\ocamlms\lib" "C:\Users\Rolf\AppData\Local\Temp\camlprim3d3a18.c" "-LC:\Program" "Files" "(x86)\Microsoft" "Research\Z3-3.2\ocaml\..\bin" "-lz3" "ole32.lib" "-lcamlidl" "-lcamlrun" -I"c:\ocamlms\lib" advapi32.lib ws2_32.lib
<rrolles> camlprim3d3a18.c
<rrolles> ** Fatal error: Cannot find file "Files"
<adrien> don't install ocaml in Program\ Files
<rrolles> not OCaml, but Microsoft's Z3
<adrien> use environment variables (can't remember which ones) to let ocaml know where it is installed
<adrien> that's all I know
<rrolles> I did not install OCaml into a path with spaces in it
Neros has quit [Read error: Connection reset by peer]
<adrien> ah, woah, nice
<adrien> install Z3 in a path with no space :P
* adrien was too tired to try to read at first
Neros has joined #ocaml
UncleVasya has left #ocaml []
djcoin has quit [Quit: WeeChat 0.3.9]
arneis has joined #ocaml
<orbitz> Hrm, is the zarith pdf supposed to be locked down on ocamlforge?
andreypopp has joined #ocaml
GnomeStoleMyBike has joined #ocaml
travisbrady has quit [Quit: travisbrady]
<orbitz> "Bitwise logical negation" -- wouldn't jus tcalling it "bitwise negation" maek sense?
<tac> "Bitwise illogical negation"
<tac> Doesn't sound too useful to me
<orbitz> sounds almost contradictory
<wieczyk> What do you think about this language feature:
<wieczyk> module M :> MTYPE = struct ... end
<wieczyk> It checks if the module M satisfy the module type MTYPE, but does not cut the module interface.
<pippijn> I like it
<wieczyk> I think someone should request it, or maybe it is already in ocaml and I cannot see this in reference manual.
<pippijn> I don't think it's in
travisbrady has joined #ocaml
<wieczyk> Where is wmeyer? ;[
<pippijn> I don't know
<wieczyk> Ocaml-lang.org looks like Haskell.org clone
<adrien> looks quite different to me
<orbitz> they look pretty diff to me
<orbitz> ocaml-lang.org looks like every othe rbootstrap site...
<orbitz> but c'mon, 3 columns vs 2 columns, you'd have to be mad to equate those
uselpa has joined #ocaml
<adrien> yeah, it's the "discover", "docs", "community" stuff
<adrien> people want the same things
<adrien> we're not going to get all apple-samsung
Yoric has joined #ocaml
<wieczyk> 20:05 < orbitz> but c'mon, 3 columns vs 2 columns, you'd have to be mad to equate those
<wieczyk> hehe
<wieczyk> ocamlmklib
<wieczyk> is another ocaml feature which convince me that this language is very good.
<orbitz> ocaml++
<wieczyk> It allows to use Ocaml code in anyt other application.
<pippijn> funny, I haven't used that
<orbitz> If I could destructuvaly udpate the ocaml variable to epxress its goodness I would
<pippijn> oh, I probably have
<pippijn> with oasis
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
<pippijn> Pervasives.incr ocaml
tane has joined #ocaml
<wieczyk> If runtime would be good paralellized then maybe it could be possible to popularize Ocaml by doing some ocaml-written plugins to some mainstream C/C++ applications.
<orbitz> ohh cool, Z.to_bits
munga has quit [Quit: Ex-Chat]
xavierm02 has joined #ocaml
andreypopp has quit [Quit: sleep]
<orbitz> awesome, zarit hhas basically everything I want
andreypopp has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
<thelema> zarith is some good.
rwmjones has quit [Read error: Operation timed out]
gnuvince has quit [Ping timeout: 240 seconds]
uselpa has quit [Remote host closed the connection]
avsm has joined #ocaml
andreypopp has quit [Quit: sleep]
ontologi1e has quit [Ping timeout: 268 seconds]
emmanuelux has joined #ocaml
andreypopp has joined #ocaml
<orbitz> thelema: the only thing it lacks that I want is converting to a string with a particular base?
<orbitz> s/\?//
Xizor has joined #ocaml
<thelema> external format: string -> t -> string = "ml_z_format"
<orbitz> AFAIK that only does octal, hex, and dec?
<thelema> only the common bases, it seems
<orbitz> yeah
<thelema> and binary.
<orbitz> Well, I guess I don't *need* it
<thelema> there's the opposite for any base between 2 and 16 - external of_string_base: int -> string -> t = "ml_z_of_string_base"
<thelema> but no to_string_base
<orbitz> what I want to do is be able to compare to numbers N bits at a time. the prettiest way is to convert to a string of that base and do string compare
<thelema> why do you care how many bits at a time the numbers are compared?
rwmjones has joined #ocaml
<orbitz> It is the unit that we consider prefixes in
<thelema> I don't understand
<orbitz> so a string compare is 8 bits at atime, this particular problem requires N bits at a time (N will usually be small, ~4, but it is arbitrary)
<orbitz> I'm impleemnting Pastry which uses the prefix of the hash key to route messages between nodes
<thelema> ok, so you have a special string compare that gives you the prefix of the two strings that are equal...
<orbitz> Yes, more or less
<thelema> why N bits at a time? why not first unequal bit?
<orbitz> I'm actually looking for a value that has a prefix in common with a string that is longer than the one I have in common, in N unit bits, so being in common by a fraction of N is not ok
<thelema> sure, but isn't this the same as doing the compare with n=1 and then rounding down to a multiple of N?
<orbitz> yes
<orbitz> I think so
_andre has quit [Quit: leaving]
<orbitz> thelema: so if i can convert to this to a string in an arbitrary base it makes doing the compare easy as well as othe rnice things, like printing
theplanet^2 has quit [Remote host closed the connection]
elixey has joined #ocaml
<thelema> orbitz: you'll have to write your own converter. Batteries just got its own to_string function that works in arbitrary bases: https://github.com/ocaml-batteries-team/batteries-included/blob/master/src/batBig_int.ml
<thelema> you can use it as a basis
<orbitz> cool thanks
<orbitz> It's not that hard to do poorly, at least :)
<thelema> true, but if you want to do it well...
<orbitz> can I do this with some clever bit work..
<thelema> shift = divide, mask = modulo. yes, but it'll be the same basic algorithm
<orbitz> well I mean, I know the maximum number ofbits my number can be, so what if I build a lookup table
TDJACR has quit [Read error: Connection reset by peer]
jewel has quit [Ping timeout: 252 seconds]
avsm has quit [Quit: Leaving.]
<rrolles> dumb question, I just wrote a lexer/parser using ocamllex/ocamlyacc and I want to pass the resulting parser a raw string, but it's expecting a "lexbuf" type... is there a lexbuf_of_string type of function?
ftrvxmtrx has joined #ocaml
sepp2k1 has quit [Remote host closed the connection]
<Qrntz> rrolles, Lexing.from_string?
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
<rrolles> yay!
<rrolles> thank you
<Qrntz> you're welcome
Xizor has quit [Remote host closed the connection]
larhat has quit [Quit: Leaving.]
TDJACR has joined #ocaml
Snark has quit [Quit: Quitte]
Neros has quit [Ping timeout: 252 seconds]
answer_42 has quit [Ping timeout: 276 seconds]
Neros has joined #ocaml
Submarine has quit [Quit: Leaving]
chambart has joined #ocaml
rwmjones has quit [Ping timeout: 255 seconds]
tautologico has joined #ocaml
nooy has joined #ocaml
rwmjones has joined #ocaml
avsm has joined #ocaml
<ImAlsoGreg> I'm testing elements in an array in a random sequence, in a while loop, and raising an exception with the found index to break out. But now I read that this is bad form. Is there a quick explanation why?
ontologiae has joined #ocaml
<jbrown__> ImAlsoGreg: it's partly a matter of taste I guess, partly that exceptions (though fast) are possibly not the most efficient way of doing things -- though the latter would apply to e.g. C++ more than OCaml.
<jbrown__> probably Array.fold would be more idiomatic
<_habnabit> ImAlsoGreg, it isn't really bad form. where did you read it was?
<_habnabit> jbrown__, you can't break out of a fold without an exception, though
<jbrown__> ...although then you'd be iterating over elements after you found the one you were interested in, I suppose.
Kakadu has quit [Quit: Konversation terminated!]
ontologiae has quit [Ping timeout: 265 seconds]
<_habnabit> ImAlsoGreg, so, you're trying to write a do-while, and looked at this page to see how to do it in ocaml?
<ImAlsoGreg> Nope - I started with a normal while loop, and tried to look for examples of exceptions & whiles online, after getting some compile errors.
<ImAlsoGreg> Found this example and was surprised to learn that it's bad style.
<_habnabit> i don't think i've ever used the ocaml 'while' loop
<_habnabit> this is just some random wiki author's opinion, though
<_habnabit> it's fine to use exceptions for flow control, but that particular example is a bit silly
<ImAlsoGreg> Yes. But I'm new enough that my own judgment on these things is probably below chance level :)
<ImAlsoGreg> I see.
<_habnabit> anyway, i almost always write loops by using a tail-recursive auxillary function
<_habnabit> er
<_habnabit> auxiliary
<jbrown__> you can write it out "in full" using recursion -- err, what _habnabit said.
<ImAlsoGreg> Ok, that sounds closer to jbrown_'s suggestion, except that
<ImAlsoGreg> Ahh, yah - it's easier for me to see the aux way than the fold left way.
<_habnabit> see the first example in the ocaml section
<_habnabit> except i normally call it 'aux' and not 'loop'
<_habnabit> also that's some bad indentation, dang
<_habnabit> editing this page
<_habnabit> ... or not. can't be bothered to make an account
<ImAlsoGreg> Incidentally, I just found the ocaml etiquette guide today. Useful reading for me. http://caml.inria.fr/resources/doc/guides/guidelines.en.html#equivalenceprogrammes
<ImAlsoGreg> Thanks very much habnabit, jbrown! I'll give this a try your way.
GnomeStoleMyBike has quit [Ping timeout: 246 seconds]
GnomeStoleMyBike has joined #ocaml
andreypopp has quit [Quit: sleep]
avsm has quit [Quit: Leaving.]
Neros has quit [Read error: Connection reset by peer]
gnuvince has joined #ocaml
travisbrady has quit [Quit: travisbrady]
sivoais has quit [Read error: Operation timed out]
sivoais has joined #ocaml
tac has quit [Ping timeout: 245 seconds]
tane has quit [Quit: Verlassend]
cdidd has quit [Ping timeout: 276 seconds]
jamii has quit [Ping timeout: 260 seconds]
fraggle_ has quit [Ping timeout: 264 seconds]
hto has quit [Ping timeout: 264 seconds]
notdan has quit [Ping timeout: 264 seconds]
notdan has joined #ocaml
notdan has quit [Changing host]
notdan has joined #ocaml
hto has joined #ocaml
TDJACR has quit [Ping timeout: 264 seconds]
TDJACR has joined #ocaml
fraggle_ has joined #ocaml
GnomeStoleMyBike has quit [Ping timeout: 255 seconds]
Cyanure has quit [Remote host closed the connection]
chambart has quit [Ping timeout: 246 seconds]