gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
ulfdoz has quit [Ping timeout: 252 seconds]
ulfdoz_ is now known as ulfdoz
sliquister has joined #ocaml
<sliquister> is anyone familiar enough with the datastructures in batteries to tell me what the conventions are
<sliquister> the functions that are expected to be defined
<sliquister> whether functions should throw exceptions or return options
<sliquister> that kind of things
<sliquister> or naming conventions maybe
<orbitz> reading throuhg documentation doesn't give any clue?
<orbitz> Core uses _exn in situations an exception will be thrown
<sliquister> well i actually looked at mlis, not at the documentations
<sliquister> i grepped for _exn, and there were very few matches
<sliquister> and even less for _opt
<sliquister> is there an actual document presenting batteries, or did you mean the documentation generated by ocamldoc ?
<orbitz> Since Batteries is trying to be a drop in replacement for stdlib, AFAIK, I don't think you'll find a nice naming convention since teh stdlib lacks one
letrec has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
<sliquister> there could be one in the modules were you don't have some compatibility constraints
sebz has joined #ocaml
<sliquister> thelema: any opinion on the subject?
sliquister has quit [Quit: Page closed]
sebz has quit [Quit: Computer has gone to sleep.]
iago has quit [Quit: Leaving]
abdallah has joined #ocaml
lopex has quit [Read error: Connection reset by peer]
joewilliams has quit [Remote host closed the connection]
bobry has quit [Read error: Connection reset by peer]
tonyg has joined #ocaml
<tonyg> Hi all - quick question - how can I get an out_channel that acts like a Buffer.t which accumulates the output sent to it for later extraction as a string?
<tonyg> Google isn't helping me much :-/
<tonyg> I mean I could write things to a temporary file and then suck that back in, but that seems... roundabout
<tonyg> I am starting to believe that it can't be done with the standard library!
<tonyg> How strange
brooksbp has joined #ocaml
fantasticsid has joined #ocaml
<orbitz> tonyg: Like C, I don't think Ocaml has a string stream like object
<hcarty> tonyg: I'm fairly certain Batteries provides the means to do what you're asking.
<hcarty> tonyg: Which means that it can be done with the stdlib, but perhaps not in a line or two of code :-)
<_habnabit> tonyg, Batteries has a thing
<_habnabit> BatIO.output_string
<tonyg> orbitz, hcarty, _habnabit: thanks! I'll check that out.
sebz has joined #ocaml
philtor has quit [Ping timeout: 240 seconds]
brooksbp has quit [Quit: Leaving]
bobry has joined #ocaml
abdallah has quit [Quit: Ex-Chat]
letrec has quit [Ping timeout: 252 seconds]
pilki has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
tonyg has left #ocaml []
Drup has quit [Quit: Leaving.]
pilki has quit [Quit: This computer has gone to sleep]
vivanov has quit [Quit: leaving]
vivanov has joined #ocaml
fantasti` has joined #ocaml
fantasticsid has quit [Ping timeout: 276 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
fantasti` has quit [Ping timeout: 255 seconds]
emmanuelux has quit [Remote host closed the connection]
wagle has quit [Read error: Operation timed out]
sebz has joined #ocaml
sebz has quit []
sebz has joined #ocaml
sebz has quit []
fantasticsid has joined #ocaml
buriedhead has joined #ocaml
ocp has joined #ocaml
milosn has quit [Ping timeout: 260 seconds]
milosn has joined #ocaml
ttamttam has joined #ocaml
Snark has joined #ocaml
Kakadu has joined #ocaml
buriedhead has quit [Ping timeout: 252 seconds]
milosn has quit [Ping timeout: 240 seconds]
edwin has joined #ocaml
bwright has quit [Ping timeout: 255 seconds]
buriedhead has joined #ocaml
milosn has joined #ocaml
ikaros has joined #ocaml
ttamttam has quit [Quit: ttamttam]
Submarine has joined #ocaml
bobry has quit [Remote host closed the connection]
<adrien> NaCl: or in ocaml with lable! Hmmm I need a better name but these would be bindings to the enlightenment libraries
buriedhead has quit [Ping timeout: 240 seconds]
bobry has joined #ocaml
buriedhead has joined #ocaml
wagle has joined #ocaml
buriedhead has quit [Ping timeout: 240 seconds]
<Qrntzz> adrien: where does the labl- naming originate from, anyway? it's something I've been wondering upon for a while.
<adrien> Qrntzz: the label functionnality in ocaml as far as I understand; by Jacques Garrigue too
<adrien> labels and optional arguments
<adrien> if I look at lablgtk2's GWindow.window, there are 22 parameters, of which 21 are optional arguments (and therefore labelled)
<adrien> so I can see their usefulness in such cases
<adrien> but now, I think that no matter the bindings you want to do, people understand (labl)(foo) as being bindings to the GUI library named "foo"
buriedhead has joined #ocaml
buriedhead has quit [Read error: Connection reset by peer]
buriedhead has joined #ocaml
buriedhead has quit [Ping timeout: 252 seconds]
ulfdoz has quit [Quit: kernel upgrade]
buriedhead has joined #ocaml
ulfdoz has joined #ocaml
buriedhead has quit [Ping timeout: 252 seconds]
ulfdoz has quit [Remote host closed the connection]
ulfdoz has joined #ocaml
lopex has joined #ocaml
buriedhead has joined #ocaml
buriedhead has quit [Ping timeout: 240 seconds]
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
letrec has joined #ocaml
buriedhead has joined #ocaml
buriedhead has quit [Ping timeout: 240 seconds]
ankit9 has quit [Quit: Leaving]
buriedhead has joined #ocaml
buriedhead has quit [Read error: Connection reset by peer]
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
buriedhead has joined #ocaml
buriedhead has quit [Ping timeout: 252 seconds]
buriedhead has joined #ocaml
emmanuelux has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
buriedhead has quit [Ping timeout: 252 seconds]
buriedhead has joined #ocaml
buriedhead has quit [Ping timeout: 276 seconds]
letrec has quit [Remote host closed the connection]
letrec has joined #ocaml
raichoo has joined #ocaml
ttamttam has joined #ocaml
raichoo has quit [Ping timeout: 252 seconds]
raichoo has joined #ocaml
<NaCl> adrien: whoa
pilki has joined #ocaml
<Qrntzz> adrien: ah, thanks for clarifying that
<bobry> i wonder why oasis (finally) switched to batteries from extlib? why is it "dead"?
<adrien> oasis was using extlib?
<thelema> bobry: huh, oasis switched to batteries?
brooksbp has joined #ocaml
<bobry> yup, check out the last commit in the darcs repo
<thelema> extlib has had barely bugfixes over the last ... what, 3 years?
emmanuelux has joined #ocaml
<thelema> hcarty: maybe ocamlbrew could install git/darcs builds of batteries/oasis
<bobry> well, it sure isn't "actively developed" :)
<adrien> I had no idea oasis was using extlib
<adrien> also, only uses a handful functions
ttamttam has quit [Remote host closed the connection]
<thelema> hmm, bootstrapping... I guess it's not too bad that batteries can be built w/o oasis
<NaCl> BatVect. Never leave the cave without it
<adrien> thelema: well, if oasis depends on oasis for the build, that's first and biggest possible issue; I wouldn't bother with the dependency on batteries
<adrien> plus everything is nicely duplicated/copied
<adrien> I mean, batteries, oasis, ... are using DVCSes and have released tarballs which are available at a variety of locations
<thelema> NaCl: :) it is nice.
<NaCl> thelema: to append to it, am I supposed to put the Vect in a ref?
<NaCl> to keep the same vect through iterative constructs
<thelema> NaCl: yes, vect is functional, so appending to it returns a new vect
<thelema> I have meny vects in refs, as well as a little mini-library that encapsulates this for accumulating values by index, but not necessarily in order
raichoo_ has joined #ocaml
<NaCl> thelema: yay I'm not pulling a design pattern from space
raichoo has quit [Ping timeout: 252 seconds]
raichoo_ is now known as raichoo
<Drakken> thelema I put that batbench plot up onto github
<thelema> Drakken: one sec while I find it
<thelema> Drakken: where?
<thelema> Drakken: ah, i was expecting a fork of bench
<Drakken> thelema you forgot I'm a compleat nOOOb
<thelema> well, along those lines: ';' goes at the end of the previous line
<thelema> hmm, I'm tempted to leave this its own program, and to have it read the results of the last benchmark
<thelema> I think I can still include it in bench, but have it an optional compile target
<Drakken> whatever you want. Feel free to make up a wish list of whatever features you can think of.
<Drakken> There's a few lines of code to automagically adjust the plot style, but I can rip that out if it's too much.
<thelema> what's with the `set_default_width` function?
<Drakken> you said the target width was about 600--700 pixels
<thelema> yes
<Drakken> I hard-coded that in as a default
<thelema> yes, but why the function to modify default_width?
<Drakken> in case you change your mind
<thelema> default width can be changed directly
<Drakken> okay, I'll take those set functions out
<thelema> also, instead of `match xlabel with None -> () | Some v -> f v`, you can use BatOption.... oh, you're not using batteries
<thelema> well, it may be nice to factor that out into its own function
lopex has quit []
<thelema> let may f = function None -> () | Some v -> f v
Xizor has joined #ocaml
vivanov has quit [Quit: Lost terminal]
lopexx has joined #ocaml
<Drakken> archimedes doesn't seem to have any options to adjust the color or thickness of the margin.
<Drakken> thelema let me know if you want the plot in the bench project. That's what I was asking you about yesterday.
<thelema> ah, I didn't understand...
raichoo has quit [Quit: Lost terminal]
buriedhead has joined #ocaml
<thelema> nice examples, I like the switch bar -> impulse w/ ball -> impulse
<Drakken> It looks like there's only one size of ball.
<thelema> it doesn't look bad.
<Drakken> It might be good to add a style option just in case.
pilki has quit [Quit: This computer has gone to sleep]
<thelema> when making the executable, the .x extension is unusual
<Drakken> I'm still learning the build system. I assume the entire makefile is unusual.
<thelema> actually not so bad.
<thelema> foo.ml usually produces foo as executable
<thelema> also, no reason to depend on Unix for testplot
<thelema> probably best to just have -package archimedes
EmmanuelOga has joined #ocaml
Drup has joined #ocaml
iago has joined #ocaml
lopexx has quit [Ping timeout: 252 seconds]
letrec has quit [Ping timeout: 240 seconds]
buriedhead has quit [Quit: Leaving.]
BiDOrD has quit [Read error: Operation timed out]
BiDOrD has joined #ocaml
oriba has joined #ocaml
<thelema> hmm, I don't want to write even a CSV parser - what's the simplest way (except marshal) to write a float array to a file and read it back in?
<thelema> (no batteries, too)
philtor has joined #ocaml
<thelema> it's looking like I write one float per line and float_of_string (input_line ic)
<Drup> why don't you want to write a CSV parser ? it's very simple with ocamllex/yacc
<thelema> I'm trying to avoid even String.splitn
<Drup> but i suposed you could write one float per line and use a special separator to end an array line
<thelema> *very simple* implementation
<thelema> ah, I'm back in C land - first line is number of lines following (to allocate the reader's array)
<thelema> bah, I'm going to omit that and reverse the accumulator list and convert that to an array
zorun has quit [Ping timeout: 244 seconds]
<Drakken> thelema okay, the plot has styles now
<thelema> Drakken: shortly, you'll be able to make changes in the bench library (once I get this integrated)
<thelema> once I get ocaml rebuilt on my laptop
lopexx has joined #ocaml
<thelema> hcarty: oh yeah, as the ocaml configure script can't autodetect libX11 on ubuntu 11.10, this is one defect in obrew
<thelema> grr to emacs for not following my OCAMLPATH set in bashrc
ocp1 has joined #ocaml
ocp has quit [Read error: Connection reset by peer]
ocp1 has quit [Client Quit]
ocp has joined #ocaml
ocp has quit [Client Quit]
ocp has joined #ocaml
lopexx has quit []
lopex has joined #ocaml
lopex has quit [Client Quit]
lopex has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
ankit9 has joined #ocaml
Snark has quit [Quit: Quitte]
<hcarty> thelema: Yes, it works with trunk (and maybe version/3.12?) but not 3.12.1 sadly.
<hcarty> thelema: Do you know which flags are required to get OCaml's configure to detect X11 and Tk under more recent Ubuntus?
Anarchos has joined #ocaml
<thelema> I use ./configure --x11lib /usr/lib/x86_64-linux-gnu
<thelema> that fixes x11, I don't use tk
<thelema> so I don't care if it's broke
<hcarty> I only use tk for the module browser GUI
<hcarty> I would love a better way to access that information locally
<thelema> I've gotten by with the ocaml and manual documentation and lots of tabs
<hcarty> I mainly run into issues with locally written and installed modules, when "make doc && make install-doc" hasn't been run recently enough
<thelema> ah, I just use the ones off various projects' websites
<hcarty> I got a report that ocamlbrew works on OSX... so that's nice.
<hcarty> It makes sense that it would, given that OCaml, findlib, and odb all do.
<thelema> yup.
<thelema> although no tests are run, so it could be totally bonkers
<hcarty> I also added a list of recipes, including how to install trunk
<hcarty> thelema: Quite true
emmanuelux has joined #ocaml
<adrien> I've found ocamlbrowser terribly useful for lablgtk
<hcarty> adrien: Yes, I have found the same. Although I haven't had to use/fight lablgtk much recently.
<thelema> adrien: yes, lablgtk's documentation is particularly resistant to my techniques of finding what I need.
Drup has quit [Quit: Leaving.]
ftrvxmtrx_ has quit [Quit: Leaving]
<adrien> the main page should link to http://developer.gnome.org/gtk/stable/ I think
<adrien> and show the widget hierarchy
<adrien> do you think that improving http://lablgtk.forge.ocamlcore.org is important?
<adrien> (it should be done, but how important is it?)
<hcarty> adrien: Having a prominent link to the documentation would be helpful
<thelema> hcarty: it's there
<hcarty> thelema: I added a flag to ocamlbrew to allow you to pass configuration options to OCaml. Testing now, then I'll push.
<thelema> hcarty: a couple lines above "Download"
<hcarty> thelema: Oh right. Under the "ocamldoc generated documentation" text :-)
<thelema> hcarty: thanks - this helps
<adrien> _I_ have issues finding it actually
<hcarty> adrien: Maybe a "<big text>Documentation</big text>" like you have for downloads
<thelema> I just bookmark the top of the doc heirarchy
<adrien> simple stuff would probably to group lablgtk*1* stuff together (probably on another page), move win32 stuff together and factor some of the descriptive text (lots of win32-related repetitions) and maybe have a dedicated page for older releases
<thelema> still have a pointer from downloads to the win32 section
<adrien> yes, definitely
<adrien> do you tend to look at the "GTK documentation"?
<adrien> i.e. what is on gnome.org (see http://lablgtk.forge.ocamlcore.org/refdoc/GMisc.html for instance)
<thelema> yes, I often look there to find the name of what I'm trying to find in the lablgtk2 docs
Drup has joined #ocaml
<thelema> althought not using those links at the top of the lablgtk2 docs
<hcarty> thelema: Pushed
<hcarty> thelema: ./ocamlbrew -o -c "--x11lib /usr/lib/x86_64-linux-gnu"
<adrien> thelema: which ones exactly?
<adrien> as far as I'm concerned, it took me some time to start using the links to the gnome.org doc
ocp has quit [Ping timeout: 260 seconds]
<hcarty> thelema: The "-o" is build OCaml only... you may not want that
<thelema> adrien: digging from here: http://developer.gnome.org/gtk/stable/index.html
<thelema> hcarty: got it.
<adrien> I'm pondering making them more visible, maybe by putting them first in the section of each class instead of being at the end
<adrien> thelema: ah, ok
<hcarty> adrien: Anything that emphasizes the most recentl lablgtk2 release, its documentation, and its download location(s) would be helpful.
<hcarty> adrien: There is a lot of information on that landing page. It can be somehwat difficult to find what you want.
<adrien> agreed
<adrien> and I think I'll remove this "It is still under development, but already fully functional." :P
<adrien> (about lablgtk*2*)
<Qrntzz> Kakadu: hello
<Qrntzz> Kakadu: you here?
zorun has joined #ocaml
Anarchos has quit [Quit: will come back later]
<Kakadu> Qrntzz: отчасти )
<Qrntzz> Kakadu: alright, so what exactly was the problem with the qml/cpp code you provided? if that was the NOTIFY warning only, I fixed it :-)
<Kakadu> this warning is not a real problem
<Qrntzz> I know, it doesn't seem as one
<Qrntzz> other than the warning, this thing works as I can see
<Kakadu> let's try to replace width: 800; by width: gameMap.sizex ()
<Kakadu> wow
<Kakadu> it works
<Kakadu> nice
<Kakadu> in my last attemp I've forgoten braces
<Kakadu> So we shoul
<Kakadu> So we should
<Qrntzz> heh
<Kakadu> 1. Understand how to create apps in qml
<Kakadu> 2. Prototype hand-made bindings
<Qrntzz> I tried that a lot on my own, and just qml/js was quite easy
<Kakadu> 3. Write a little binding-generator which connects C++ classes with OCaml code.
<Qrntzz> but yeah, bindings are to be devised
fraggle_ has quit [Read error: Connection reset by peer]
fraggle_ has joined #ocaml
avsm has joined #ocaml
avsm has quit [Client Quit]
avsm has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
EmmanuelOga has quit [Quit: WeeChat 0.3.7-dev]
<bobry> How can i wrap a paragraph of text in OCaml? i think i need something similar to Python's textwrap module: http://docs.python.org/library/textwrap
<zorun> wrapping by cutting only between words?
<zorun> I've done that once, but I think it was by hand :)
<zorun> quick & dirty
<zorun> err, not so quick, actually
<bobry> yup, only between words
smondet has joined #ocaml
edwin has quit [Remote host closed the connection]
brooksbp has quit [Quit: Leaving]
milosn has quit [Read error: Operation timed out]
avsm has quit [Quit: Leaving.]
ikaros has quit [Quit: Ex-Chat]
<thelema> is the result of graphing these times: http://pastebin.com/kuZV54i2
<thelema> Drakken: Current code on my github - I added your benchplot.ml as a standalone program with some quick hacks to get it working
<Drakken> thelema looking...
Xizor has quit []
Morphous_ has quit [Ping timeout: 252 seconds]
letrec has joined #ocaml
<Drakken> thelema how do I test the plotting code now that it's part of an oasis project?
Morphous_ has joined #ocaml
<thelema> 1) ocamlbuild examples/foo.native
<thelema> 2) ./foo.native
<thelema> 3) make
<thelema> 4) ./benchplot.byte
<thelema> steps 1-2 make the times.flat file
<thelema> step 3-4 processes that file into times.png
<Drakken> thelema am I supposed to type "foo" literally, or what?
<thelema> no, pick one of the examples
<thelema> I used erf ... which isn't in the repo
<thelema> one sec while I check that in
<thelema> ok, pushed.
<thelema> oops. I guess I need to update the examples.
<thelema> try erf
<Drakken> thelema same (non)result
<thelema> really? odd...
avsm has joined #ocaml
<Drakken> thelema wait, that was bench_erf
<Drakken> :)
<thelema> just examples/erf.native
<thelema> hmmm...
<thelema> make clean
<Drakken> done
<thelema> hmm, why does it work for me...
<thelema> try pulling this update - I added Unix to _oasis
<Drakken> exactly the same result, except (2 cached) changed to (0 cached)
<Drakken> ... and "Finished, 0 targets" changed to "Finished, 1 target"
<thelema> same + ocamlfind ocamlopt -g -linkpkg src/bench.cmx examples/erf.cmx -o examples/erf.native?
<Drakken> Just for the record, I didn't see any uninstall directions in the INRIA download, so when I installed godi, I manually deleted /usr/lib/ocaml and everything in /usr/local/bin that looked like it was related to ocaml.
<Drakken> Who knows what I missed...
<Drakken> I mean /usr/local/lib/ocaml
<Drakken> same what?
<thelema> well, try adding "true: use_unix" to examples/_tags
<Drakken> where? top? bottom?
<thelema> anywhere
<thelema> _tags is unordered
<Drakken> done
<Drakken> what does "same +" mean?
<thelema> "+ ocamlfind ..." was the command used by ocamlbuild for compilation
<thelema> I was just asking if the compilation command was the same
<Drakken> where's the compilation command?
<thelema> in your paste, line 3
<Drakken> yes, it's exactly the same
letrec has quit [Ping timeout: 252 seconds]
<thelema> ok, screw all the addons...
<thelema> ocamlopt unix.cmxa src/bench.ml examples/erf.ml -o erf
dsheets has quit [Ping timeout: 240 seconds]
Drup has quit [Read error: Connection reset by peer]
<Drakken> thelema do I need to make clean?
<Drakken> File "src/bench.ml", line 1, characters 0-1:
<Drakken> Error: Could not find the .cmi file for interface src/bench.mli.
<thelema> blah, it checks for that? odd.
<thelema> 1) ocamlc src/bench.ml
<thelema> 2) ocamlopt unix...
<Drakken> dan[bench]$ ocamlc src/bench.ml
<Drakken> File "src/bench.ml", line 1, characters 0-1:
<Drakken> Error: Could not find the .cmi file for interface src/bench.mli.
<thelema> hmmm
<thelema> ok, ocamlc src/bench.mli
<thelema> then 2)
<thelema> this shows how rarely I compile things by hand
<thelema> grr that doesn't even work...
<thelema> okay, not on one line...
<thelema> cd src
<thelema> ocamlopt bench.mli
<thelema> ocamlopt unix.cmxa bench.ml
<Drakken> okay
<thelema> cd ../examples
<thelema> ocamlopt unix.cmxa -I ../src ../src/bench.cmx erf.ml -o erf
<Drakken> okay
pilki has joined #ocaml
<thelema> ./erf
<thelema> that shoudl run the benchmark
<thelema> and produce a times.flat file
<thelema> mv times.flat ..
<thelema> cd ..
<thelema> make
<thelema> ./benchplot.byte
<thelema> should produce the times.flat file
* NaCl just found a use for blit
pilki has quit [Client Quit]
ulfdoz_ has joined #ocaml
<Drakken> pkg_archimedes: ................................ /home/dan/.odb/lib/archimedes
<Drakken> That's not in my godi dir.
<thelema> run the sanitize script
<thelema> _build/sanitize.sh