flux changed the topic of #ocaml to: Yes, inria.fr is back up! | Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0beta1 available from http://caml.inria.fr/pub/distrib/ocaml-3.11/ | Or grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html
mfp has joined #ocaml
vixey has quit [Read error: 113 (No route to host)]
Palace_Chan has joined #ocaml
Demitar has quit [Read error: 110 (Connection timed out)]
ched has joined #ocaml
ched__ has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
jeddhaberstro has quit []
seafood has joined #ocaml
<palomer> hrmph
<palomer> given a tree
seafood has quit []
<palomer> how would you guys find all the nodes to the right of a node
<palomer> followed by all the nodes to the left
<palomer> in order of closeness
<thelema> all the right nodes, pre-order, and then all the left nodes, pre-order?
<thelema> in order of closeness by the comparison function that decides the binary tree node order, or by # of tree-pointers followed order?
<palomer> http://ocaml.pastebin.com/m68d0d7d1 <--my solution
<palomer> here is the order:
<palomer> the smallest node is the current node
<palomer> followed by the leftmost child
<palomer> followed by the leftmost child of its leftmost child
<palomer> etc...
<palomer> followed by its second leftmost child
<palomer> etc
<palomer> the algorithm pretty much defines it
<thelema> up_right?
seafood has joined #ocaml
<thelema> ah, go up, while heading right
<palomer> righto
<palomer> that's the best solution I've come up with
<palomer> so, let's say you're editing an AST
<palomer> and you're looking for the closest node holding a property
<palomer> you'd use this function to find it
<palomer> seems like a generic solution to all traversal problems
* thelema imagines there's some way to take the given node and pull the tree up like a spider, so that a breadth-first traversal of the tree would give you the desired property
<thelema> i.e. reverse the direction of the parent links of all ancestors of the given node to form the new tree
<palomer> yeah
<palomer> thought of it too
seafood has quit []
<thelema> it looks like you effectively do that, although I think you might be doing depth first traversals in your 5 directions
<palomer> that would involve embedding my datastructer into something like type 'a foo = [`Node of 'a * ('a foo list)]
<palomer> datastructor
<palomer> yeah, depth first
<palomer> since a textual representation of an AST is text
<palomer> so the closest node, text wise, is the leftmost deepest
<thelema> the right-most child of the left sibling, no?
<thelema> (or vice versa, for the other side)
<palomer> that would be the node corresponding to the text before the current node
<thelema> so if you want to do "closest - by text distance", wouldn't you have to alternate between left and right sides?
<palomer> ah, righto
<palomer> but I also want to call this function many times to iterate through all the nodes
<palomer> (all the nodes "after" the current node)
<palomer> actually, I'm just iterating through the lefs
<palomer> leafs
<palomer> leaves
<palomer> I'm actually only interested in the "right" nodes
<palomer> and the children
johnnowak has joined #ocaml
<thelema> and you're always starting from a leaf?
|Jedai| has quit [Connection reset by peer]
Jedai has joined #ocaml
_Jedai_ has joined #ocaml
Torment has quit [Read error: 110 (Connection timed out)]
<palomer> nope
<palomer> whew
<palomer> you guys know the feeling of coming to the end of a long project?
<thelema> projects end?
<palomer> ok
<palomer> coming to the point where you're sick of it and you've implemented most of it
<palomer> and everything else will simply be minor
<thelema> heh, lablgtk doesn't compile under 3.11 -- Error: Invalid source file name: "Gdk-pixbuf-mlsource" is not a valid module name.
<thelema> yes, I know that point.
<palomer> ie, you've removed all the print_endline from your code
<thelema> you're nearly there?
<palomer> yeah
<thelema> feels good
<palomer> feels...strange
<thelema> you'll find another project.
<thelema> Or you'll enter the maintenance phase of your current project, if you turn it loose on the community
<palomer> yeah, I'll find another project
<palomer> and i'll probably turn this one loose
<palomer> once I figure out how to package it
Smerdyakov has quit [Read error: 110 (Connection timed out)]
pierre- has joined #ocaml
seafood has joined #ocaml
<palomer> hmm
<palomer> here's a tough question
<palomer> I've got a ton of ml files in one directory
<palomer> and a few others in another directory
<palomer> how do I compile everything together?
<thelema> ? try ocamlbuild
seafood has quit []
<palomer> im using omake
<palomer> is ocamlbuild that much better?
<palomer> is there an easy tutorial?
<thelema> not that I know - ocamlbuild just does a good job of working out intra-project dependencies.
<palomer> but how do you specify those dependencies?
<thelema> you don't have to specify dependencies between files inside your project, only external dependencies.
<thelema> and the name of the main program
<thelema> = main module
<palomer> so you specify the ml files
<palomer> and that's it?
<thelema> pretty much. you're using lablgtk, which should integrate easier than what I'm doing, but this is what I'm doing:
<thelema> are your dependencies ocamlfind packages?
<palomer> I did it like this:
<palomer> OCAMLFLAGS += -dtypes -I +lablgtk2 -I /usr/lib/ocaml/3.10.0/pcre -I /usr/lib/ocaml/3.10.0/extlib extLib.cmxa pcre.cmxa lablgtk.cmxa gtkInit.cmx unix.cmxa -g
<thelema> ocamlbuild -cflags -I,+lablgtk2 -lflags -I,+lablgtk2 -libs lablgtk <name of main module>/native
<thelema> my _tags file has:
<thelema> <*>: thread, unix, pkg_batteries
<thelema> but you'd probably use <*> pkg_extlib, pcre
<thelema> and I did have to add the line:
<thelema> let _ = GtkMain.Main.init ()
<thelema> to initialize Gtk (I couldn't get ocamlbuild to work with gtkinit.cmx)
<palomer> hrmph
<palomer> couldn't I just copy the .o files?
<thelema> I don't think so.
<thelema> anyway, time for me to sleep. Good luck.
<palomer> night
<thelema> (on yeah, to use pkg_* tags, you'll need to get a copy of the generic myocamlbuild.ml file)
yziquel has joined #ocaml
<yziquel> Hi. I've been trying to compile some bindings into a .cma recently. Using ocaml for ubuntu. Som 3.09 version, as I recall. Did not work out properly, (complaining about not finding symbol caml_c_call). Is there a minimum version to use for creating .cma libraries with dynamic libraries?
<flux> well, if there is, it isn't 3.09
<flux> (but something less)
<flux> have you looked at how other packages do it?
_Jedai_ has quit [Read error: 104 (Connection reset by peer)]
Smerdyakov has joined #ocaml
jknick has joined #ocaml
<yziquel> flux: yes. I've done one or two myself, and it usually worked quite well. I was binding some libs in /usr/lib on a Debian amd64, and I'm now trying to bind some plain custom C code on a Ununtu i386...
<yziquel> Ubuntu...
seafood has joined #ocaml
<flux> yziquel, so the problem comes from using your own .c-files for building it?
<flux> or how has the situation changed
<yziquel> I can create a .cma out of it. When I load it in the toplevel, I can access my ocaml values. However, if I ocamlfind install it, and reload the same .cma in the toplevel (load the .cma file, not #require-ing the package), then I cannot access the symbols anymore, and it complains about not finding caml_c_call in the dll....so file).
<yziquel> which I find rather weird.
<palomer> hee hee
<palomer> my program has no less than 59 mutable variables
<flux> yziquel, can the toplevel find the corresponding .cmi-files when you load the .cma-file into it?
<flux> I just use #require, makes life easier
<yziquel> flux: I'll recompile it on my machine before answering the first question. I also use #require when I can, but the package doesn't work. The .cma works before installing the package, and not after. But the package doesn't work because of the caml_c_call thing...
<flux> yziquel, I'm guessing you're not installing all the relevant files
<flux> otherwise, why would it matter where the files are placed at?
<flux> yziquel, btw, beware of name collision between the c-files and the .ml-files
<flux> having foo.ml and foo.c will fail
<flux> atleast when building a native library
<flux> I don't remember what happens with byte code libraries
<yziquel> foo.ml and foo.c is probably the issue...
<yziquel> flux: you amaze me... you always get to the point...
<flux> :)
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
<flux> perhaps I've made the same mistakes myself ;)
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 joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
pierre- has quit [Read error: 110 (Connection timed out)]
<palomer> oh boy
<palomer> my program is slow as molasses
Palace_Chan has quit [Client Quit]
mishok13 has joined #ocaml
<electronx> lol
Mr_Awesome has joined #ocaml
<electronx> try haskell
ulfdoz has joined #ocaml
middayc has joined #ocaml
johnnowak has quit []
seafood_ has quit [Read error: 60 (Operation timed out)]
seafood has joined #ocaml
seafood has quit [Client Quit]
electronx has quit []
filp has joined #ocaml
Camarade_Tux has joined #ocaml
middayc has quit [Read error: 60 (Operation timed out)]
thelema has quit [Read error: 60 (Operation timed out)]
middayc has joined #ocaml
jknick has quit [Remote closed the connection]
jknick has joined #ocaml
rwmjones_ has joined #ocaml
jknick has quit ["leaving"]
domiel has joined #ocaml
yziquel has quit [Remote closed the connection]
Yoric[DT] has joined #ocaml
<Yoric[DT]> hi
<Yoric[DT]> rwmjones: ping
<Yoric[DT]> grmph, more type aliases disappearing because of a pack
onigiri has joined #ocaml
middayc has left #ocaml []
onigiri has quit []
onigiri has joined #ocaml
onigiri has quit [Client Quit]
onigiri has joined #ocaml
onigiri has quit [Client Quit]
onigiri has joined #ocaml
onigiri has quit [Client Quit]
<Camarade_Tux> ocaml programs really don't like being 'made' with several jobs at once...
<Camarade_Tux> anyway, John Harrop told me it took hours to rebuilt all the ocaml libraries, it took about about 30 to 40 minutes here :)
<Yoric[DT]> :)
yangsx has quit [Read error: 110 (Connection timed out)]
<rwmjones_> gildor_, ping
<Camarade_Tux> bah, school, have to go
<Camarade_Tux> Camarade_Tux 's livecd is nearing completion \o/
onigiri has joined #ocaml
Camarade_Tux has quit ["Leaving"]
<gildor_> rwmjones_: pong
<gildor_> rwmjones_: I have answered your bug
<Yoric[DT]> rwmjones_: ping
<rwmjones_> gildor_, yes I see & agree. The problem is that we get PO files which are crap, full of parsing problems, built by all sorts of strange tools. The translators themselves aren't technical so can't fix this, and also they have a fairly mindnumbing job, so we need to be kind to them and go easy on any parsing errors.
<rwmjones_> Yoric[DT], pong
<Yoric[DT]> rwmjones_: I've spent a few hours trying to write a [input -> in_channel] (respectively [output -> out_channel]) conversion.
<Yoric[DT]> In vain.
<Yoric[DT]> I'm now totally out of ideas, do you have any?
<rwmjones_> Yoric[DT], good luck :-) I'm missing something here, what is [input]?
onigiri has quit []
<Yoric[DT]> rwmjones_: it's an ExtLib data structure :)
<rwmjones_> ah ok ... possibly not one that I've used ever.
<flux> yoric[dt], how would one go about doing that, if not by using secret knowledge of their structure from C code or perhaps by spawning another thread?
<Yoric[DT]> Well, ExtLib redefines I/O around [input] and ['a output], which are abstracted versions of [in_channel]/[out_channel].
<Yoric[DT]> flux: well, threads are one option, although, of course, it wouldn't work in the non-threaded version.
<Yoric[DT]> flux: and yeah, C is the other one, but I somehow dislike it.
<flux> yoric[dt], do you think the problem needs solving?-)
<flux> have you looked how in_channel and friends are implemented?
<Yoric[DT]> Well, that's unfortunately the only way I can see of getting [Marshal.from_channel] to work without [in_channel].
<Yoric[DT]> (not yet, so far, I've been to scared)
<flux> right..
<flux> I'm thinking perhaps a better alternative would be to supplement Marshal with new functionality..
<flux> although such a conversion function would naturally be more general
<flux> but it might need low level access to actually pull that trick..
<Yoric[DT]> Well, let me rephrase.
onigiri has joined #ocaml
<Yoric[DT]> I don't see how I could implement [Marshal.from_input].
<Yoric[DT]> At all.
<flux> by looking at Marshal's implementation and copying it :)
<Yoric[DT]> Written in C.
<flux> well, if that's the way it's going..
<flux> so the way I see it one needs to get into modifying the standard library (down to C level) in any case
<flux> to implement the conversion functions cleanly, or to supplement Marshal with new functionality
<Yoric[DT]> Well, in that case, I'm afraid I need to remove functionality from Marshal.
<Yoric[DT]> Which is a tad annoying.
<flux> remove what functionality?
<flux> using IO directly?
<Yoric[DT]> Yes.
<Yoric[DT]> Which is annoying.
<flux> I guess you _can_ implement input/output-stuff in terms of strings
<flux> but it's just a bit less efficient
<Yoric[DT]> Not quite.
<flux> what do you mean "not quite"?
<Yoric[DT]> You still need to know the correct length of a string.
onigiri has quit []
<Yoric[DT]> Let me rephrase: to unmarshal some value from some kind of stream, you need to know how many bytes to read.
<flux> to implement from_input: first read Marshal.header_size bytes
<Yoric[DT]> That's the easy part.
<flux> then you use data_size on the buffer to how many bytes to read next?
<flux> and once you've done that, call Marshal.from_string to the resulting blob?
<Yoric[DT]> Actually, I hadn't seen that [data_size].
<Yoric[DT]> That should solve the issue.
<Yoric[DT]> Thanks.
<flux> happy to help
<flux> it still isn't optimal, but it's better than nothing
<flux> unless from_channel does the same internally
<flux> who knows, it might
<flux> it's annoying that the standard library has such doubled interfaces, but it never occurred to someone to extend in_channel etc to support that functionality..
<Yoric[DT]> Right now, I'm looking for the source code of [from_channel] (well [caml_input_value]) and I can only find it for the bytecode version.
<Yoric[DT]> Strange.
<gildor_> rwmjones_: no problem, just give me as much input as you can (to allow easier job of translator), I will try to correct it
onigiri has joined #ocaml
onigiri has quit [Client Quit]
onigiri has joined #ocaml
onigiri has quit [Client Quit]
onigiri has joined #ocaml
onigiri has quit [Client Quit]
_zack has joined #ocaml
_zack has left #ocaml []
onigiri has joined #ocaml
onigiri has quit [Client Quit]
seafood has joined #ocaml
onigiri has joined #ocaml
seafood has quit [Client Quit]
onigiri has quit [Client Quit]
onigiri has joined #ocaml
onigiri has quit [Client Quit]
Demitar has joined #ocaml
onigiri has joined #ocaml
seafood has joined #ocaml
onigiri has quit [Read error: 110 (Connection timed out)]
_andre has joined #ocaml
<_andre> hello
<Yoric[DT]> hi
<_andre> does anyone know of an ocaml library that provides shell globbing functions?
domiel has quit ["Leaving"]
<_andre> i don't think there's anything in the standard library
<flux> wrapping glob() from c should not be a big effort, given you know how :)
<_andre> i actually do but it's too much work for what i need to write
<_andre> i thought maybe someone had already done it :p
thelema has joined #ocaml
<_andre> then again i may get bored enough some day and do it :p
<gildor_> _andre: I think there is some code in ocamlbuild that do it
<gildor_> maybe you can copy and paste it
<thelema> Yoric[DT]: ping
<Yoric[DT]> pong (but briefly)
<thelema> just about to commmit substring.ml
<Yoric[DT]> ok
<thelema> What support for conditional compilation do we have with ocamlbuild?
<Yoric[DT]> Not much, for the moment.
<Yoric[DT]> If any.
<Yoric[DT]> I mean, I'm sure we can write a plug-in for this.
<thelema> 3.11 needs some chanes to batlib_baselib_unix
<Yoric[DT]> But there's none so far.
<Yoric[DT]> The TCP stuff?
seafood has quit []
<thelema> hmm, I wonder if there's any ocamlp4 to do conditional compilation based on ocaml version
<thelema> yes, the tcp stuff.
<thelema> really simple patch, just changing external blah into val blah.
onigiri has joined #ocaml
<Yoric[DT]> That should be feasible.
<Yoric[DT]> Not much time for that atm, though.
<gildor_> thelema: camlp4 macro ?
<thelema> maybe someone else'll take up that project.
<thelema> gildor_: yes.
<gildor_> it already exists
<thelema> name?
<gildor_> pa_macro
<thelema> that's an old one.
<gildor_> Camlp4MacroParser
<gildor_> for the new one (but it installs an alias for ascending compat)
<gildor_> in ocaml/camlp4/Camlp4Parsers
<gildor_> there is a big comment at the beginning of the file telling you how to use it
<gildor_> (and it works, since I use it)
<Yoric[DT]> thelema: have you taken care of Rope already?
<thelema> I'm finishing up substring -- I haven't made any changes to rope (i.e. feature parity)
<thelema> that's next on my list (although I have the feeling I'll end up using substring to do some of the changes.)
rwmjones_ has quit ["Closed connection"]
<Yoric[DT]> ok
<Yoric[DT]> I'm currently hunting occurrences of [in_channel]/[out_channel].
<Yoric[DT]> We now have a version of Pervasives which doesn't use them.
<thelema> how to flush stdout?
<Yoric[DT]> flush stdout, as usual
<thelema> hmm, I got an error in my code that did that.
<Yoric[DT]> ?
xevz has quit [Read error: 110 (Connection timed out)]
<thelema> maybe flush isn't in extPervasives yet
<thelema> File "coml.ml", line 236, characters 8-14:
<thelema> Error: This expression has type unit Batteries_core.System.IO.output
<thelema> but is here used with type Batteries.out_channel = out_channel
<thelema> L236: flush stderr
<Yoric[DT]> When did you last update?
<thelema> last night
<thelema> (umm, 8 or 9 hours ago)
<thelema> aha, I see some new versions. maybe fixed already.
<thelema> I'll check again.
<Yoric[DT]> At the moment, wfm.
<thelema> ok.
<thelema> time for me to go. ttfn
<Yoric[DT]> me to
sporkmonger has joined #ocaml
onigiri_ has joined #ocaml
onigiri has quit [Read error: 104 (Connection reset by peer)]
onigiri_ has quit []
GustNG has joined #ocaml
onigiri has joined #ocaml
GustNG has quit [Read error: 60 (Operation timed out)]
onigiri has quit [Client Quit]
_andre has quit ["leaving"]
GustNG has joined #ocaml
Axioplase_ is now known as Axioplase
<thelema> Yoric[DT]: fixed the flush problem, now have [Reference to undefined global 'ExtPervasives'] in my project and a really wierd string [Batteries.t != string Enum.t error] in [make examples]
sebaseba has joined #ocaml
GustNG1 has joined #ocaml
GustNG has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]> thelema: ok, I'll try examples.
<Yoric[DT]> Normally, the ExtPervasives problem looked solved to me, but I'll take another look.
<Yoric[DT]> thelema: make examples works for me.
olegfink has quit [Read error: 104 (Connection reset by peer)]
olegfink^ has joined #ocaml
<flux> yoric[dt], btw, I took a look at the sources, and it looks to me Marshal.from_channel does read the data into memory before deserializing it
<flux> yoric[dt], so using your own string buffers is just as good
<Yoric[DT]> Thanks.
olegfink^ is now known as olegfink
<Yoric[DT]> I wasn't able to find from_channel with a quick grep.
<flux> external from_channel: in_channel -> 'a = "caml_input_value"
<flux> (in stdlib/marshal.ml)
<flux> and byterun/intern.c has the relevant functions: caml_input_value, caml_input_val, caml_input_value_from_string, caml_input_val_from_string
<Yoric[DT]> Yeah, but that's where my investigation stopped.
<Yoric[DT]> If that's the bytecode version, where is the native version
<Yoric[DT]> If that's the bytecode version, where is the native version?
<flux> hm, why should native version be different?
<flux> if there are two versions, doesn't it show in the from_channel signature
<flux> something like "caml_input_value" "caml_input_value_native" ?
<flux> ah, there is indeed directory asmrun which also has those functions
longh has joined #ocaml
<Yoric[DT]> Well, I don't know my way around the C sources of OCaml, but I kind of assumed that byterun != asmrun.
<Yoric[DT]> It's in asmrun, too?
<flux> looks like copy paste
* Yoric[DT] wonders why his grep didn't find that.
<Yoric[DT]> Which file is that?
<flux> asmrun/intern.c
<flux> I'm looking at ocaml 3.09.3
<Yoric[DT]> Mmmhh....
<Yoric[DT]> That file doesn't seem to exist in my tarball.
<Yoric[DT]> Maybe I did something wrong.
<flux> did you compile it?
<flux> because it doesn't exist in mine either
<flux> I'm guessing it's copied..
<flux> ah
<flux> it's a symbolic link :-)
<flux> so it is indeed the same file
<Yoric[DT]> arf
<Yoric[DT]> That's probably it :)
<flux> many other files in the directory are also symbolic links to byterun
<flux> infact only 4 of 35 files are real files
<Yoric[DT]> Well, that solves my problem.
<Yoric[DT]> Thanks, flux.
GustNG has joined #ocaml
GustNG1 has quit [Read error: 60 (Operation timed out)]
GustNG has quit [Client Quit]
GustNG has joined #ocaml
<maxote> hi, what's the main change between 3.11beta1 and 3.10.2?
<Smerdyakov> Did you look for a changelog?
filp has quit ["Bye"]
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
Axioplase is now known as Axioplase_
_andre has joined #ocaml
<_andre> should ocamlfind work fine with an ocaml installed by the package manager (in /usr/bin) and a library installed manually (in /usr/local)?
<flux> yes
<_andre> i'm getting this: http://codepad.org/t0lOPY9W
<_andre> it works fine if i compile with just ocamlopt and pass it the -I argument
<flux> likely the package has something wrong
<flux> especially its META-file
<flux> try adding linkopts(native) = "-locaml_glob" to it (disclaimer: I'm not sure this is the proper thing to do, and almost sure of the opposite, but it's what I found from one of my packages)
<flux> but I'll be leaving, I hope someone else can help you
<_andre> ok
<_andre> i'll try it, thanks
mishok13 has quit [Read error: 110 (Connection timed out)]
<_andre> no luck
zenhacker_rouan has joined #ocaml
<zenhacker_rouan> hi everyone
<zenhacker_rouan> is there a way to provide a virtual method in a base class with a code body
<zenhacker_rouan> :)
pierre- has joined #ocaml
sebaseba has quit []
pango has quit [Remote closed the connection]
zenhacker_rouan has quit ["Lost terminal"]
pango has joined #ocaml
sebaseba has joined #ocaml
Camarade_Tux has joined #ocaml
middayc has joined #ocaml
<_andre> anyone using ocamlmakefile to build a C extension?
<mfp> is it a large project? things might be easier with omake...
<_andre> no, really small
<_andre> just one function exported from C
<mfp> btw. has anybody used CSML? I suppose it's main appeal is the GUI stuff? > http://www.reddit.com/r/programming/comments/78g9i/csml_highlevel_bindings_between_ocaml_and_c_now/
<mfp> _andre: I don't use OCamlMakefile, but if you're willing to switch to OMake this minimal example might help you > http://pastebin.com/m69336563
<_andre> i'm willing to change to anything that works :)
<mfp> that example builds mylib.cma from mylib.ml and mylib_stubs.c
<mfp> +mylib.cmxa
<mfp> there might be a more elegant way to build OCaml libs with stubs, but I never found it in OMake's manual
<_andre> hmm
<_andre> i guess the problem was a naming one
<_andre> i had foo.ml and foo.c
<mfp> when there are no stubs, it's just OCamlLibrary(libname, the modules you want)
<_andre> renamed foo.c to foo_stubs.c and it worked
<mfp> oh noes
<_andre> oh, there's a variable in OCamlMakefile that sets that suffix
middayc has left #ocaml []
<mfp> <mfp> btw. has anybody used CSML? I suppose it's main appeal NOOO "its"
<_andre> which defaults to "_stubs" ...
<mfp> (in my defence, this happened because I was phrasing it differently and edited the line. argh I wish xchat supported vim keybindings)
<flux> _andre, really? I just helped one guy about that problem
<flux> _andre, but your names seemed different so I didn't think of giving that piece of advice to you :)
<_andre> heh
<_andre> well, i'm glad it worked
<flux> that is so common problem that I wonder if a bug should be raised to make the compiler somehow detect the situation :)
<_andre> does it actually need the .c and .ml to have different names?
<flux> the name of the c-file doesn't get written anywhere, but the resulting .o-file is the problem..
<_andre> ah
<flux> ocamlopt -c produces .o-files
<_andre> that makes sense
snhmib has joined #ocaml
itewsh has joined #ocaml
Snark has joined #ocaml
itewsh has quit [Read error: 60 (Operation timed out)]
snhmib has quit ["Good riddance!"]
itewsh has joined #ocaml
snhmib has joined #ocaml
<flux> yoric[dt], do you have a godi command to retrieve all the dependencies for batteries?
<Yoric[DT]> Besides installing Batteries?
<Yoric[DT]> Not that I know.
<flux> well, the thing is, I have recent godi and batteries-0.20081011, and make byte opt doc install fails with Unbound type constructor CamomileLibrary.UChar.t
<flux> so it looks to me I might have a too old version of camomily
<flux> camomile, even
<det> Is it better to use Godi than Debian packages ?
<flux> well, if you want to keep consistent ocaml installation when you have different distributions installed..
<flux> or even solaris
<flux> (I'm actually upgrading godi on solaris right now)
<flux> in general debian packages are quite nice
<flux> godi also has one nice feature: it can retrieve the latest ocamlc from the CVS and recompile all packages against that
<flux> but that's hardly needed for production purposes
<flux> dpkg, even if it very slow, is also much faster than godi :)
<flux> (well, atleast a bit faster)
marmotine has joined #ocaml
<Yoric[DT]> flux: you will probably need to update Camomile, indeed.
<Yoric[DT]> The latest version of Camomile is available for OCaml 3.10
<Yoric[DT]> (I've packaged it about 2 weeks ago)
<hcarty> Yoric[DT]: Since ertai has fixed the camlp4 + toplevel bugs (at least the ones that were giving me trouble), I have been playing with pa-do some more
<Yoric[DT]> Great :)
<hcarty> Yoric[DT]: I have a few patches to submit upstream - but are you interested in/planning on including pa-do in Batteries?
<Yoric[DT]> Interested in: definitely.
<Yoric[DT]> Planning to: not yet.
<Yoric[DT]> But we're just barely starting to plan what's going to happen after release one.
<flux> yoric[dt], and that upgraded camomile is not in godi?
<Yoric[DT]> flux: it should be.
<Yoric[DT]> I put it there myself :)
<Yoric[DT]> hcarty: bluestorm is in charge of everything Camlp4 for Batteries.
<hcarty> Yoric[DT]: Ah, ok. I have not seen bluestorm around #ocaml in a while
<Yoric[DT]> hcarty: he was just admitted in the best Grande École in France, it may take him some time to get settled :)
<hcarty> Congratulations to bluestorm, then :-)
vixey has joined #ocaml
<Yoric[DT]> :)
<flux> yoric[dt], ok, I actually didn't even have it installed
<flux> I was hoping some incantation that would make sure that I have all the dependency packages before make :)
<Yoric[DT]> flux: does this mean I forgot to put a dependency in the package for Batteries?
<flux> yoric[dt], I don't know how it works, I just know make didn't work :)
<flux> I'm guessing I would need to have some godi package of batteries before it would automatically retrieve dependencies?
<Yoric[DT]> yes
itewsh has quit [Connection timed out]
itewsh has joined #ocaml
johnnowak has joined #ocaml
johnnowak has quit [Client Quit]
johnnowak has joined #ocaml
LeCamarade has joined #ocaml
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
<hcarty> Has anyone here used FrGui from http://code.google.com/p/ocamlrt/ ? Specifically, is it usable with the latest lablgtk2 release(s)?
<flux> well, last changes are from 2006..
<flux> which is a shame
<flux> but I suppose anyone could pick it up, the source is there ;)
<hcarty> flux: Yes, I'm considering it /if/ the task is relatively straightforward :-)
<hcarty> I'm attempting a GUI with lablgtk (and Gtk+ in general) for the first time
<hcarty> Glade isn't as straightforward as I had hoped, so I'm using "raw" GUI building in the code. FrGui looks like it would be a potentially cleaner option.
<flux> the day guis are written these days is pretty primitive, and functional reactive systems have some promise in them
zenhacker_rouan has joined #ocaml
<flux> no kidding, the documentation phase of batteries takes.. some.. time..
LeCamarade has quit [Read error: 110 (Connection timed out)]
<hcarty> Curses. Old camlp4 is apparently part of the base Fr library.
<fremo> It has some code for midi protocol ! ... great, I was looking for it :)
Linktim has joined #ocaml
<Camarade_Tux> I've tried glade and simply did not understand it, *at all*
<Camarade_Tux> I too would really like to hear about a program using 'reactive toolkit' btw
<hcarty> The pa_fr extension does not compile as-is with camlp5 either, sadly
<flux> what did the extension do?
<hcarty> flux: I'm not sure? But it's used in the library code
<Camarade_Tux> pafr seems to be the basis of ocamlrt
<Camarade_Tux> The pa_fr grammar extension introduces two constructs, on and lift, intended
<Camarade_Tux> to enhance readability of certain Fr idioms.
_JusSx_ has joined #ocaml
<flux> well, either the compatiblity fixes are bugs in camlp5 or should otherwise be easily remedied?
<Camarade_Tux> anybody know lucid-synchrone or reactive ml ?
<hcarty> File "pa_fr.ml", line 24, characters 39-55:\nThis expression has type Lexing.position but is here used with type int
<flux> hcarty, well, looks like simple to fix?
<flux> yoric[dt], perhaps adding something along the lines "godi_console perform -build godi-bin-prot -build godi-camomile" would be a good idea in the README
<hcarty> flux: I hope so
itewsh has quit [Connection timed out]
itewsh has joined #ocaml
<hcarty> flux: Which of these elements do you think it should be? http://caml.inria.fr/pub/docs/manual-ocaml/libref/Lexing.html#TYPEposition
<hcarty> flux: If you have any idea, that is...
ygrek has joined #ocaml
<hcarty> pos_cnum allowed Fr to compile
<flux> :)
mishok13 has joined #ocaml
<hcarty> camlp5 does not seem to have ocamlfind support though
<hcarty> At least, not through GODI
<Yoric[DT]> flux: ok, I didn't know about that specific command line.
* Yoric[DT] always used the menu-based UI for GODI.
<flux> yoric[dt], I'm guessing the list isn't complete
Linktim has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]> flux: well, if you use the UI, it downloads all the dependencies.
<flux> yoric[dt], right.. now that you mention it, I notice there indeed is package godi-batteries...
<Yoric[DT]> tsssss
<Camarade_Tux> ^^
<flux> I'll try that next ;)
itewsh has quit ["KTHXBYE"]
johnnowak has quit []
Linktim has joined #ocaml
mishok13 has quit [Read error: 110 (Connection timed out)]
<jonafan> i am implementing a btree in ocaml
<flux> wel, how's it going?-)
<jonafan> remove is killing me
pierre- has quit [Read error: 110 (Connection timed out)]
Snark has quit [Remote closed the connection]
<flux> I can imagine
<jonafan> the code is so gross.. all the other operations are simple
<jonafan> but remove... it is not meant to be implemented in any language or in any style
<flux> maybe you're doing it wrong ;-)
<Camarade_Tux> patricia trees are a lot of fun too ;)
<flux> I've found dealing with binary trees is nice in O'Caml, but b-tree is something else
<jonafan> yeah, binary trees are nice
<flux> in any case, you should end up in something cleaner than this: http://istoyanov.blogspot.com/2007/11/b-tree-remove-elementnode.html (because that's not ocaml ;))
<jonafan> probably my favorite data structure
Snark has joined #ocaml
<flux> another reason: because that is php!
<jonafan> well..... it's definitely approaching that level of grossness
<Raevel> hey how ugly can it be when you don't have to put $'s everywhere
<hcarty> With some massaging, Fr and FrGui build with GODI + OCaml 3.10.2 + Camlp5 3.08
<Camarade_Tux> hcarty, nice ! pleeeaaase tell us about your experience when you've got a first application :)
<hcarty> The problems are as much or more with GODI + camlp5, as no META file is installed by GODI
<hcarty> Camarade_Tux: I certainly will :-)
Palace_Chan has joined #ocaml
sebaseba has left #ocaml []
Palace_Chan has quit ["Leaving"]
middayc_ has joined #ocaml
jeddhaberstro has joined #ocaml
<Camarade_Tux> I'm really having a lot of fun doing my livecd
<Camarade_Tux> after removing /bin and /usr, after compiling the same libraries ten times in a row, I now tried to gzip my whole 6.6GB /
<Camarade_Tux> =)
Linktim has quit [Read error: 110 (Connection timed out)]
middayc_ has quit [Client Quit]
<hcarty> And now the FrGui test program builds! Nifty.
<Camarade_Tux> does it run too ? xD
<hcarty> Camarade_Tux: Indeed :-)
_andre has quit ["*puff*"]
<Camarade_Tux> hcarty, have you looked at the test program source yet ?
<Camarade_Tux> according to the announcement on the mailing-list, the libray was not that easy to use
<hcarty> It looks like it would be relatively easy for a very simple GUI. I don't know how well it would work for anything advanced.
ygrek has quit [Remote closed the connection]
vpalle has joined #ocaml
<Camarade_Tux> hcarty, I think that'd be more than enough, for advanced GUIs, you'd probably want more control and could build your own abstraction without spending much time (proportionnaly speaking) anyway
wlmttobks has quit ["Leaving"]
seafood has joined #ocaml
<hcarty> Camarade_Tux: It doesn't seem to quit cleanly in the toplevel, whereas a well-behaved vanilla lablgtk app does
<hcarty> I'm not sure why
seafood has quit []
GustNG has quit ["Leaving."]
|jeremiah has quit [Read error: 104 (Connection reset by peer)]
tomh has joined #ocaml
Snark has quit ["Ex-Chat"]
<zenhacker_rouan> hi everyone
<zenhacker_rouan> is there a way to define a body for a virtual function in the virtual class and override it in the derived class
wlmttobks has joined #ocaml
vpalle has quit ["Leaving"]
<_JusSx_> why so many ppl in the channel? what happened?
vpalle has joined #ocaml
<vpalle> hi, does anyone here know of an EOPL like book, with ocaml as the implementation language instead of scheme.. ?
jeremiah has joined #ocaml
<vixey> vpalle: strange kind of question to ask
<palomer> hrmph
<palomer> is there any way to find duplicate function names in the same module?
<palomer> (really, it should be illegal)
<palomer> (or at least give a warning)
wlmttobks has quit [K-lined]
<hcarty> palomer: If it were illegal, then how would modules be extended?
<palomer> good point
<palomer> well, there should be a flag that tells you when it happens
<jonafan> remove........ remove........... remove.......
<mfp> zenhacker_rouan: what's the point? By making it virtual, you're demanding that derived classes define that method anyway, so you could use another private method with a default implementation --- or just a normal function, if it doesn't use instance variables.
_andre has joined #ocaml
<zenhacker_rouan> mfp: i want the base class to provide a default behaviour and override the behaviour in the derived class
<mfp> zenhacker_rouan: why do you need to make it virtual?
<zenhacker_rouan> mfp: i want to use this for override polymorphism
<mfp> zenhacker_rouan: this is not C++, you can override any method
<zenhacker_rouan> so i want to create a list of the base class, but put in objects of the derived class, and calling the method should then execute each derived classes own implementation
<zenhacker_rouan> lol
<zenhacker_rouan> mfp: my background is very C++ oriented
<mfp> take a look at sections 3.5 and 3.6 in http://caml.inria.fr/pub/docs/manual-ocaml/manual005.html
<mfp> "private" also means something different
<zenhacker_rouan> i have already been through those sections
_JusSx_ has quit ["leaving"]
<zenhacker_rouan> mfp: i think i confused myself in the process
<zenhacker_rouan> mfp: but thanks for the help
<jonafan> speaking of confused, removing items from btrees is hard
<vixey> got any description of a btree?
<vixey> just curious what it is
<jonafan> the wikipedia article explains it fairly well
<jonafan> it's sort of a self balancing array/tree hybrid
<jonafan> although i am using lists instead of arrays because i like them more
<mfp> zenhacker_rouan: np. OCaml's OO is quite different from C++ (structural typing & stuff), and it's easy to carry misconceptions.
* mfp afk
<zenhacker_rouan> mfp: yeah, im used to marking a method as virtual before i can override it in the derived class
<palomer> let insert_after str c to_insert = String.concat ((String.make 1 c) ^ to_insert) (String.nsplit str (String.make 1 c)) <--anyone have any idea how to make this function utf8 friendly?
<vixey> that's interesting
<vixey> and I've only skimmed this but it does seem that list is sensible
<jonafan> all the operations other than remove are pretty simple
<jonafan> btrees are most useful when getting a node involves latency
jeremiah has quit [Connection reset by peer]
marmotine has quit ["mv marmotine Laurie"]
Submarine has joined #ocaml
<palomer> http://pastebin.com/m66353144 <--could someone tell me why this doesn't work?
<jonafan> i give up
<jonafan> there's gotta be a better way to write this
<jonafan> well over 100 lines
<Yoric[DT]> Mmmhhhh....
<Yoric[DT]> palomer: probably because PCRE is involved:)
<palomer> :/
* Yoric[DT] is waaay to scared/scarred to try and attempt PCRE.
<palomer> scarred by PCRE?
<palomer> it's worked for me sofar
<fremo> 0 result found for 'btree' in 'The Caml Hump'
<Camarade_Tux> google is starting to scare me : if you search for "btree", it will also give results for "binary tree" ...
<palomer> let _ = print_int (List.length (split_by_newline "haha \n hoho hihi moo")) <--this prints 2
<palomer> that's really weird
jeremiah has joined #ocaml
* Camarade_Tux has troubles seeing why it is weird...
<hcarty> palomer: I agree with Camarade_Tux -- why is that weird?
<palomer> he hasn't said anything about my problem
<palomer> and err
<palomer> yeah, it isn't weird
<palomer> i just confused
* palomer jumps!
<Camarade_Tux> fremo, I'm starting to think you'll soon be contributing the first b-tree library for ocaml ;)
<fremo> heh :P
<Camarade_Tux> fremo, you might as well annoy everybody on the channel during one week or two in order to get a very fast tree and never release it because you're too lazy to write a doc and a *makefile
<Camarade_Tux> that's what I did two months ago :)
<fremo> hahaha, so just release it and let somebody else do the rest :P
<Camarade_Tux> no, I can still have fun with it, I intend to code regular expression on it (it is a patricia tree on text) ;)
<Camarade_Tux> I still haven't written a single char though :p
<Camarade_Tux> anyway, bedtime :)
<fremo> yes !
* fremo look at patricia tree before...
* Camarade_Tux knows that on tomorrow morning, the script he will run will produce a completely working ocaml package :)
<Camarade_Tux> well, I hope...
Camarade_Tux has quit ["Leaving"]
Submarine has quit [Read error: 110 (Connection timed out)]
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
<palomer> releasing software is tough work
<palomer> seriously
<palomer> someone should make it easy as PIE
<Raevel> mm pie?
<palomer> tell me you saw the pi music video
<Raevel> i did not
vanjuggler has joined #ocaml
<vanjuggler> hello again
jstash has joined #ocaml
<Raevel> oh wait, that one :-)
<palomer> hmmm
<palomer> String.nsplit "\n" "\n" returns a list of length 2
<palomer> while Pcre.split ~rex:(Pcre.regexp ~flags:[`UTF8] "\\n") "\n" returns a list of length 0
<palomer> I want the second behaviour
<palomer> but nsplit doesn't work very well with UTF8 strings
vpalle has quit [Connection timed out]
<palomer> hrmph
<vanjuggler> jstash and lukec level up in O'caml
* palomer wonders where the pcre documentation is
vanjuggler has left #ocaml []
<jstash> hmm... List.map() versus List.rev(List.rev_map())
ulfdoz has quit ["deprecated"]
Palace_Chan has joined #ocaml
<Palace_Chan> is there a logical XOR in ocaml ?
vixey has quit [Read error: 113 (No route to host)]
<Yoric[DT]> Good night everyone.
Yoric[DT] has quit ["Ex-Chat"]
yangsx has joined #ocaml
Squirrel has joined #ocaml