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
companion_square is now known as companion_cube
raichoo has quit [Quit: leaving]
sebz has quit [Quit: Computer has gone to sleep.]
emmanuelux has quit [Read error: No route to host]
emmanuelux has joined #ocaml
Drakken has joined #ocaml
letrec has quit [Ping timeout: 252 seconds]
sebz has joined #ocaml
letrec has joined #ocaml
yroeht has quit [Ping timeout: 245 seconds]
oriba has quit [Quit: oriba]
Drup1 has quit [Quit: Leaving.]
yroeht has joined #ocaml
bobry has quit [Remote host closed the connection]
upgrayeddd has quit [Remote host closed the connection]
lopex has quit [Remote host closed the connection]
joewilliams has quit [Remote host closed the connection]
fantasticsid has joined #ocaml
upgrayeddd has joined #ocaml
bobry has joined #ocaml
bobry has quit [Remote host closed the connection]
upgrayeddd has quit [Remote host closed the connection]
bobry has joined #ocaml
upgrayeddd has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
lopex has joined #ocaml
NihilistDandy has quit [Quit: Linkinus - http://linkinus.com]
emmanuelux has joined #ocaml
letrec has quit [Ping timeout: 260 seconds]
emmanuelux has quit [Ping timeout: 240 seconds]
sgnb` has quit [Ping timeout: 255 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
BiDOrD has joined #ocaml
sebz has joined #ocaml
BiDOrD_ has quit [Ping timeout: 252 seconds]
joewilliams has joined #ocaml
letrec has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
fantasticsid has quit [Read error: Connection reset by peer]
fantasticsid has joined #ocaml
sebz has joined #ocaml
Snark has joined #ocaml
MarcWeber has left #ocaml []
ttamttam has joined #ocaml
ttamttam has left #ocaml []
Snark has quit [Quit: Quitte]
edwin has joined #ocaml
milosn_ has quit [Ping timeout: 240 seconds]
Snark has joined #ocaml
Kakadu has joined #ocaml
milosn has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
edwin has quit [Ping timeout: 240 seconds]
edwin has joined #ocaml
letrec has quit [Ping timeout: 252 seconds]
fantasticsid has quit [Remote host closed the connection]
fantasticsid has joined #ocaml
probst has joined #ocaml
sgnb has joined #ocaml
fantasticsid has quit [Ping timeout: 245 seconds]
ikaros has joined #ocaml
Drup has joined #ocaml
iago has joined #ocaml
fantasticsid has joined #ocaml
milosn_ has joined #ocaml
milosn has quit [Ping timeout: 260 seconds]
ttamttam has joined #ocaml
<adrien> wmeyer: found!
milosn_ has quit [Ping timeout: 244 seconds]
<adrien> wmeyer: char d; value x = Val_int(d); <- d is a *signed* char; it gets cast to intnat which is defined to a *signed* long here
<adrien> and when d is negative, the sign bit is kept but moved
<adrien> and that makes the char something invalid for ocaml
milosn has joined #ocaml
<adrien> I had thought about the signed/unsigned char issue when I first wrote my C code (the protocol definition is a C struct) but thought that it wouldn't be an issue; I hadn't thought of integer promotion
milosn has quit [Read error: Operation timed out]
milosn has joined #ocaml
jlouis_ is now known as jlouis
philed has joined #ocaml
buriedhead has joined #ocaml
buriedhead has quit [Ping timeout: 260 seconds]
ftrvxmtrx_ has quit [Quit: Leaving]
ftrvxmtrx_ has joined #ocaml
buriedhead has joined #ocaml
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
pilki has joined #ocaml
The_third_man has quit [Read error: Connection reset by peer]
The_third_man has joined #ocaml
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
buriedhead has quit [Ping timeout: 268 seconds]
ygrek has joined #ocaml
ttamttam has quit [Quit: ttamttam]
milosn has quit [Ping timeout: 244 seconds]
milosn has joined #ocaml
letrec has joined #ocaml
buriedhead has joined #ocaml
buriedhead has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
emmanuelux has joined #ocaml
pilki has quit [Quit: This computer has gone to sleep]
ttamttam has joined #ocaml
ttamttam has quit [Client Quit]
ttamttam has joined #ocaml
avsm has quit [Quit: Leaving.]
emmanuelux has quit [Ping timeout: 240 seconds]
emmanuelux has joined #ocaml
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
oriba has joined #ocaml
ttamttam has left #ocaml []
emmanuelux has quit [Ping timeout: 240 seconds]
<edwin> adrien: write a Val_char macro that casts to unsigned char and then uses Val_int
<edwin> not sure why char defaults to signed char as its an annoyance most of the time, like indexing an array with a char: you have to use unsigned again. I don't think I can bring up an example where a signed char is actually useful
emmanuelux has joined #ocaml
<adrien> edwin: I've done the unsigned char cast as a temporary fix but it should at least be mentionned in the doc I think
<hcarty> adrien: Regarding your question yesterday about running a code when used as a program but not when used as a library - I don't think that is possible in a direct way, given that OCaml has no "main" function, so every linked module is on fairly equal footing.
<adrien> (part of my problem was that I wasn't sure how chars are stored in ocaml)
<adrien> hcarty: ='(
<adrien> edwin: I guess it defaults to signed because everything else defaults to signed too afaik
<hcarty> adrien: There was a stack overflow question about this I think. There may have been some kind of work-around.
emmanuelux has quit [Remote host closed the connection]
<hcarty> adrien: You could have a toplevel expression that only evaluates when a certain flag is passed in Sys.argv
<hcarty> adrien: But every linked module has its top level expression run. So if you want something like that it probably makes the most sense to have "let run () = ..." in foo.ml, then use bar.ml with "let () = run ()" to build the executable version.
<adrien> in caravel (where I control the usage both as a library and a program), I've added a check like: if Sys.argv.(0) = "current_filename.native" then ...
<adrien> hcarty: oh, I'll check SO, thanks
avsm has joined #ocaml
avsm has quit [Quit: Leaving.]
raichoo has joined #ocaml
fraggle_ has quit [Remote host closed the connection]
fraggle_ has joined #ocaml
<NaCl> adrien: caravel!!!!!!!!!!!!
<adrien> NaCl: build it! :P
raichoo has quit [Ping timeout: 268 seconds]
raichoo has joined #ocaml
jamii has joined #ocaml
letrec has quit [Ping timeout: 240 seconds]
philtor has joined #ocaml
<NaCl> adrien: laziness
ftrvxmtrx_ has quit [Ping timeout: 240 seconds]
ftrvxmtrx_ has joined #ocaml
<adrien> pffft, everything's ready!
<adrien> and you even get to have time-limited bugs if you build now!
<adrien> special offer, it won't last
<NaCl> ooooh
<NaCl> got a dual-way hashtbl-like data structure lying around anywhere?
<NaCl> adrien: what are the deps? I'll try running it on Mac OS.
<NaCl> never mind
* NaCl is a lazy bum
<adrien> NaCl: dep *1* is webkit-gtk >= 1.4.0
<adrien> it's the most annoying by far
<NaCl> indeed
sebz_ has joined #ocaml
<NaCl> ugh
<NaCl> laziness
<adrien> it's been quite funny because it turned out that the ocaml dependencies aren't a problem: the C ones are
<Drakken> Is there a way to install Batteries if you don't have tcl/tk? godi-console said it couldn't find some tcl header file(s), even after I installed tcl with netpkg.
<NaCl> Drakken: worked fine for me without it.
<NaCl> Built on Mac OS
<Drakken> Nacl here's the output: http://pastebin.com/GpEm9FXU
<adrien> Drakken: are you _only_ installing batteries?
<NaCl> tell godi to disable it
sebz_ has quit [Quit: Computer has gone to sleep.]
* NaCl doesn't use godi because he doesn't like the UI
<adrien> use the command-line UI ;-)
<Drakken> adrien I already installed Ocamlnet and yojson.
emmanuelux has joined #ocaml
<adrien> Drakken: I mean: if you install lablgtk with glgtk support, it will pull lablgl which will pull labltk iirc
<adrien> so, do you tell godi to build something else _now?
<Drakken> adrien how do I figure that out? I *think* I only selected Batteries, but I'm not sure how to verify it in godi_console. For some reason I got the impression that godi_console remembers uninstalled selections after you quit it.
<adrien> Drakken: can you pastebin the whole output from godi when you starart the process?
<Drakken> adrien how do I do that? I only see one screenful of output.
<adrien> Drakken: hmmm, on command-line, can you run: godi_wish -print
<adrien> ?
raichoo has quit [Ping timeout: 248 seconds]
raichoo has joined #ocaml
<adrien> yeah, you're pulling lablgl
<adrien> use godi_console to 'c'onfigure the package
<adrien> disable the tk stuff, and then unselect conf-tcltk and godi-ocaml-labltk packages
raichoo has quit [Ping timeout: 240 seconds]
raichoo has joined #ocaml
yroeht has quit [Ping timeout: 252 seconds]
avsm has joined #ocaml
ttamttam has joined #ocaml
yroeht has joined #ocaml
<Drakken> adrien how do you unselect a package?
raichoo has quit [Ping timeout: 252 seconds]
<Drakken> Oh. adrien nevermind.
<Drakken> I thought "keep as is" meant "don't change the current build params". Apparently it means "unselect".
raichoo has joined #ocaml
<Drakken> "Important note"
ttamttam has left #ocaml []
<adrien> Drakken: "keep as is" in godi is "cancel the request you've set"
<adrien> Drakken: have you unselected the conf-tcl package too?
<Drakken> adrien yea, I got that. What about that Important Note?
<Drakken> conf-tcltk and godi-ocaml-labltk
emmanuelux has quit [Ping timeout: 240 seconds]
<Drakken> by "conf-tcl" do you mean "conf-tcltk"?
emmanuelux has joined #ocaml
<adrien> yeah, that one
<adrien> and you've configured lablgl to not build TOGL?
<Drakken> I'm on the last screen ([o]k) before installation, so I can't see the package list without aborting.
<adrien> are you sure you've "saved" your changes? the UI is a bit vague for that
<Drakken> right. nb: <DELETE> works but <BACKSPACE> doesn't.
<adrien> try Ctrl-W (whole word)
<Drakken> I saw " = no" on the screen after I hit <RTRN>.
<Drakken> Is that not enough?
<oriba> someone here knows ocaml-ncurses?
<adrien> Drakken: hmm
<oriba> how does init_pair(1, COLOR_RED, COLOR_BLACK); attron(COLOR_PAIR(1)); be converted to Ocaml-ncurses? My attempts did not work in Ocaml, but work in C
<adrien> Drakken: try going over the 3 packages once more and then start the process
<Drakken> adrien is that "note" a problem?
philed has quit [Remote host closed the connection]
<adrien> Drakken: well, it shows that the conf-tcltk is still selected
philed has joined #ocaml
<adrien> maybe pulled by deps
<Drakken> I don't see a "b" next to it.
<adrien> when you tell godi to start, it first resolves deps (which can add packages) and then asks you for confirmation before building anything
<Drakken> the package screen says "[b]uild&install" instead of "[k]eep as is", so it's probably not selected.
<adrien> if you exit and run godi_wish -print again, what do you get now?
<Drakken> yep
<Drakken> oops strike that
<wmeyer> does anybody know how to force GODI to keep the build directory somewhere?
<adrien> wmeyer: dirty way 1: [a]bort the build when it's creating the package
<wmeyer> I've just playing around with ocamlspot and seems to work, but I am tired of rebuilding a package, and then copying around *.sp[oi]t files into the GODI tree
<wmeyer> (rebuilding, just copied from godi/dist-files)
<wmeyer> adrien: thanks, I tend to use godi-console, I wish there was a way of doing that nicely
<wmeyer> otherwise I admit ocamlspot is really good thing, I keep it as my default compiler
<adrien> Drakken: well, try to proceed with the build; it looks like it should be fine
<wmeyer> oriba: probably what you would like to look at is lambda-term.
<adrien> but according to the output from godi_console, it's going to build 10 packages while your output from godi_wish only shows 8
<adrien> wmeyer: you could hack the .mk files
<adrien> not guaranteed but should work for some/most packages
<wmeyer> adrien: yes that's another way
BiDOrD_ has joined #ocaml
<adrien> wmeyer: in pmake and therefore mk I think, when you write "install: foo", the "install" rule will _also_ depend on rule "foo"
<adrien> so you can add rules that way and they'll accumulate
BiDOrD has quit [Ping timeout: 245 seconds]
<adrien> wmeyer: see the lines after "The special package-building targets", "You probably won't need to touch these" in bsd.pkg.mk
<Drakken> adrien you were right, it's still looking for conf-tcltk, even after I deselected it. same result.
<wmeyer> adrien: It seems like it's not easy to achieve. The directory were the spot files are need to be permanent and is absolute, and the spot files needs to be copied where the package is being installed - so probably there is no easy way to do it.
<adrien> wmeyer: ah ='(
<adrien> Drakken: it's suprising but you could try disabling godi-lablgl ("keeping it as is") and disable gl support in lablgtk2
<wmeyer> adrien: yeah, so the easiest way is just to copy the packages incrementally when they are needed from godi, rebuild them, keep the contents of tarball, and copy spot files to the pkg-lib or site-lib.
<wmeyer> note, that you don't need to install the actual package, just copy the spot files.
<wmeyer> I was working on better integration of OCaml in Emacs, and I have incremental error highlithing via. flymake - as you type - and ocamlspot working across libraries.
<wmeyer> so now I need to write the actual code :(
<Drakken> adrien am I still *not* installing conf-tcltk and godi-ocaml-labltk?
* wmeyer procrastinating hard.
<wmeyer> Drakken: did you try: godi_console perform -build godi-ocaml-labltk ?
<Drakken> PS: those two packages keep getting automatically reselected. I have to keep re-UNselecting them.
<wmeyer> BTW: labltk is included in OCaml tarball
<adrien> he doesn't have tk
<Drakken> wmeyer I'm too much of a noob for that right now
<oriba> wmeyer, aha, lambda term... looking at "project homepage" I got: http://lambda-term.forge.ocamlcore.org/
<Drakken> wmeyer I mean no, I didn't know about it. I suppose I could try...
<adrien> actually you said you had tcl/tk installed now
<oriba> which looks quite empty ;)
<wmeyer> Drakken: Try, in many respects I found a command line tool better.
<Drakken> wmeyer does godi_console not count as a cl tool?
<Drakken> adrien did I?
<wmeyer> Drakken: Yes it does, but it's curses UI not a command line driven.
<adrien> or the opposite approach: instead of fighting to not install labltk, install it, but properly configured
<Drakken> adrien oh, I mean I installed it in my OS, not through godi.
<adrien> Drakken: you can configure the conf-tcltk package and set the right -I and -L options for gcc
<adrien> as it says: Set this option if the tcl/tk library is not found.
<wmeyer> oriba: but you need to install dependencies, like lwt and the other ones.
<oriba> wmeyer, follow the link "project page"
<wmeyer> oriba: http://forge.ocamlcore.org/frs/?group_id=230 is that not sufficient?
<oriba> no docs?
<wmeyer> adrien, Drakken : Yep, tcl packages always beat me down to search with apt-file, everytime I use godi I can't remember which -dev Ubuntu packages I need to install.
<wmeyer> oriba: you should be able to generate them via. ocamldoc, and *.mli files are usually sufficient. For the examples you can look at utop or zed.
<oriba> does not compile with my old lwt
<wmeyer> wow, the project suddendly start compiling after my destruction of GODI with ocamlspot
<oriba> Just to habve a better ocaml-ncurses documentation would be sufficient to me btw
<wmeyer> oriba: yes, the dependencies are PITA here.
<Drakken> adrien which way would you like to try first? (a) try disabling godi-lablgl ("keeping it as is") and disable gl support in lablgtk2, or (b) configure the conf-tcltk package and set the right -I and -L options for gcc?
<wmeyer> oriba: I don't know much about ocaml-ncurses..
<oriba> aha
<wmeyer> Drakken: which distro you on?
<oriba> and also nobody else seems to know it?
<Drakken> wmeyer Zenwalk 70. It's a Slack derivative.
<Drakken> used to be called "minislack"
<Drakken> 7.0
<wmeyer> Drakken: :O
<Drakken> wmeyer it's supposed to be "dev-centric" :/
<adrien> Drakken: (a) would be simpler, (b) is better in the long-run
<wmeyer> Drakken: yes, it's, now you are solving problems, and devs are solving problems :)
<adrien> I'd say (b) if you have 2 minutes to do it :-)
<wmeyer> so it's dev-centric in some sense
<wmeyer> so what's the exact problem Drakken
<wmeyer> ?
<wmeyer> with the tcl/tk?
<Drakken> adrien I have plenty of minutes, but I don't really know what I'm doing.
<adrien> well, slackware doesn't split packages into -run, -doc, -dev, ... so it already helps a lot
<Drakken> I'll need help.
<wmeyer> is gcc looking in a wrong place for the headers?
<adrien> Drakken: you're with ocaml 3.11 in godi?
<wmeyer> oriba: ocaml-ncurses looks like a pretty much tiny wrapper over ncurses..
<Drakken> wmeyer godi-console said it couldn't find some tcl header file(s), even after I installed tcl with netpkg.
<wmeyer> thin*
<wmeyer> Drakken: I had the same problem on Ubuntu
<wmeyer> Drakken: I installed some tcl package, and it started to work
<wmeyer> Drakken: Unfortunately I can't tell which one was it
<wmeyer> Drakken: You might just compile tcl/tk
<Drakken> adrien 3.12.1
<wmeyer> Drakken: and add it to your C_INCLUDE_PATH
<wmeyer> Drakken: Before you start the godi_console
<wmeyer> I would suggest getting the tarball, of tcl-tk
<Drakken> wmeyer I installed tcl/tk with negpkg into /usr/...
<wmeyer> you don't need to install it, just point to the right place with C_INCLUDE_PATH
<adrien> Drakken: do you have /usr/lib*/tk* ?
<wmeyer> yes, but it might not install the headers file there
<Drakken> neTpkg
<wmeyer> adrien: I think it looks for headers, like tcl.h or whatever
<oriba> wmeyer, looks like that, but colors don't work oin OCaml, so I wonder how to do that
<oriba> wmeyer, also, no forms and panels are there in OCaml
<wmeyer> adrien said that on Slack there is no division between -dev packages, so preasumbly there are somewhere
<adrien> Drakken: well, what does 'find /usr/ -name tk.h 2>/dev/null' show?
<wmeyer> adrien: Right, I would do the same..
<Drakken> adrien yes, plenty of tcl stuff in /usr/lib/
<wmeyer> but tk.h is siginifcant
<wmeyer> so not /usr/lib but /usr/include
<Drakken> adrien, wmeyer nothing
<wmeyer> Drakken: try: 'find /usr/ -name '*tk*.h 2>/dev/null
<wmeyer> find /usr/ -name '*tk*.h' 2>/dev/null
<wmeyer> locate tk.h
<wmeyer> :
<wmeyer> /usr/include/tcl8.4/tk.h
<wmeyer> /usr/include/tcl8.4/tk-private/generic/tk.h
<wmeyer> /usr/include/tcl8.5/tk.h
<wmeyer> /usr/include/tcl8.5/tk-private/generic/tk.h
<wmeyer>
<wmeyer> etc.
<hcarty> Drakken: Do you know what version of Tcl and Tk?
<hcarty> Drakken: I think GODI only auto-detects
<hcarty> < 8.5
<adrien> hcarty: <= 8.5 (just checked)
<hcarty> adrien: Ah, that's good. It wasn't that way last time I did a fresh GODI install.
<oriba> wmeyer if ocaml-ncurses is just a wrapper over ncurses, how then is init_pair(1, COLOR_RED, COLOR_BLACK); attron(COLOR_PAIR(1)); translated to ocaml-ncurses? I don't see that
<hcarty> oriba: Where is the documentation for ocaml-ncurses?
<hcarty> oriba: Or source code
<oriba> ah, I found it!
<Drakken> hcarty probably the most recent. netpkg did the download, so I don't have the tarball & I don't remember which one it was, and I don't see a -version arg to tclsh.
<oriba> A-module has a color_pair!!
<wmeyer> Curses.init_pair Curses.Color.red Curses.Color.black; Curses.attron (Curses.color_pairs 1)
<oriba> wmeyer, this seems to work: init_pair 1 Color.green Color.yellow; attron (A.color_pair 1);
<adrien> hmmm, tcl 8.6 is available
<adrien> that could be an issue
<hcarty> adrien, Drakken: That seems likely.
<Drakken> adrien, wmeyer too much output from *tk*.h. lots of gtk stuff.
<wmeyer> Drakken: sorry, i forgot about gtk
<adrien> Drakken: what about "find /usr/ -name "libtk*so" 2>/dev/null" ?
<wmeyer> yes, but you are looking now for tk.h really
<Drakken> is there a glob pattern for [^g] ?
<adrien> (it'll give the version number)
<adrien> afaict, godi should say " This version is not supported." when it encounters tcl 8.6 but the test might not work as it shoul
<adrien> d
<hcarty> Drakken: GODI godi_console remembers whatever installtion/removal selections you made between runs. So if a package was previously selected for installation but not installed, it will still be selected the next time you run godi_console.
<adrien> tcl 8.6 is from last august or earlier; hadn't seen that
<Drakken> hcarty what if it was UNselected and then I exited godi_console? It seems to get selected again.
<oriba> hcarty, ebven I found out the solution... you asked for the OCaml-Curses-docs: http://www.nongnu.org/ocaml-tmk/doc/
<hcarty> Drakken: If something else that is selected depends on a package then it will be selected again.
<Drakken> hcarty but that's not [my|the] highest priority right now, unless it's a clue to what godi_console is doing...
<Drakken> right
<hcarty> oriba: Thanks. I'm glad you found the fix.
<hcarty> oriba: Or, solution rather
<oriba> yes, solution. :)
<oriba> Didn't awaited the missing stuff to be located in the A-module; looked for it in Curses, not in Curses.A
<oriba> now I can go on :)
<Drakken> adrien /usr/lib/libreoffice3.3/basis3.3/program/libtkli.so
<adrien> hmmm, rather: "find /usr/ -name "libtk*so*" 2>/dev/null" (forgot one '*')
<Drakken> adrien same.
<adrien> it looks like tk didn't get installed (properly) then
ttamttam has joined #ocaml
milosn_ has joined #ocaml
milosn has quit [Ping timeout: 245 seconds]
Kakadu has quit [Quit: Konversation terminated!]
probst has quit [Quit: probst]
ttamttam has left #ocaml []
Snark has quit [Quit: Quitte]
lopex_ has joined #ocaml
avsm1 has joined #ocaml
lopex has quit [Excess Flood]
lopex_ is now known as lopex
edwin has quit [Remote host closed the connection]
philed has quit [*.net *.split]
avsm has quit [*.net *.split]
wmeyer has quit [*.net *.split]
rwmjones has quit [*.net *.split]
taupin has quit [Read error: Operation timed out]
sebz has joined #ocaml
sebz has quit [Client Quit]
sebz has joined #ocaml
Morphous_ has quit [Read error: Operation timed out]
raichoo has quit [Quit: leaving]
Morphous_ has joined #ocaml
ygrek has quit [Quit: Leaving]
sebz has quit [Quit: Computer has gone to sleep.]
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
oriba has quit [Quit: oriba]
mnabil has joined #ocaml
pango is now known as pangoafk
Drup has quit [Quit: Leaving.]
Drup has joined #ocaml
ikaros has quit [Remote host closed the connection]
mnabil has quit [Read error: Operation timed out]
sebz has joined #ocaml
mnabil has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
mdelaney has joined #ocaml
letrec has joined #ocaml
iago has quit [Quit: Leaving]
ulfdoz_ has joined #ocaml
jamii has quit [Ping timeout: 248 seconds]
ulfdoz has quit [Ping timeout: 248 seconds]
ulfdoz_ is now known as ulfdoz