gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
<MarcWeber> How to get smallest, biggest key of a Map ?
<sgnb> MarcWeber: since 3.12.0, there is {min,may}_binding
<sgnb> s/may/max/
<sgnb> otherwise, it should be doable with fold (but probably less efficient)
<MarcWeber> I have 3.11.1
<MarcWeber> sgnb: How to iterate over key value pairs?
<MarcWeber> IntMap.iter( fun(key,value) ->print_int key; print_string value )
<MarcWeber> I tried this, but I'm getting: Error: This pattern matches values of type 'a * 'b
JimmyRcom has joined #ocaml
gildor has joined #ocaml
npouillard has joined #ocaml
Edward has quit []
valross has joined #ocaml
mjonsson has joined #ocaml
mjonsson has quit [Remote host closed the connection]
mjonsson has joined #ocaml
npouillard has quit [Read error: Operation timed out]
gildor has quit [Ping timeout: 240 seconds]
gildor has joined #ocaml
mjonsson has quit [Ping timeout: 272 seconds]
mjonsson has joined #ocaml
npouillard has joined #ocaml
_unK has quit [Remote host closed the connection]
<thelema> MarcWeber: decurry! [iter (fun key value -> ... )]
JimmyRcom has quit [Ping timeout: 255 seconds]
mjonsson_ has joined #ocaml
mjonsson has quit [Read error: No route to host]
mjonsson_ has quit [Remote host closed the connection]
ulfdoz has joined #ocaml
ygrek has joined #ocaml
ttamttam has joined #ocaml
ulfdoz has quit [Ping timeout: 265 seconds]
ttamttam has quit [Ping timeout: 265 seconds]
Yoric has joined #ocaml
Amorphous has quit [Ping timeout: 276 seconds]
ygrek has quit [Ping timeout: 245 seconds]
ygrek has joined #ocaml
Amorphous has joined #ocaml
ikaros has joined #ocaml
Yoric has quit [Quit: Yoric]
ttamttam has joined #ocaml
|marius| has joined #ocaml
valross has quit [Quit: Ex-Chat]
|marius| has quit [Read error: Connection reset by peer]
|marius| has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
Yoric has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
ftrvxmtrx has joined #ocaml
|marius| has quit [Remote host closed the connection]
verte has joined #ocaml
avsm has joined #ocaml
avsm has quit [Client Quit]
iago has joined #ocaml
alpounet has quit [Quit: Bye.]
alpounet has joined #ocaml
vpalle has joined #ocaml
avsm has joined #ocaml
thelema has quit [Read error: Connection reset by peer]
thelema has joined #ocaml
avsm has quit [Quit: Leaving.]
npouillard has quit [Ping timeout: 272 seconds]
Yoric_ has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
Yoric_ is now known as Yoric
ikaros has joined #ocaml
vpalle has quit [Ping timeout: 240 seconds]
Edward has joined #ocaml
Yoric has quit [Quit: Yoric]
vpalle has joined #ocaml
Edward has quit []
JimmyRcom has joined #ocaml
barismetin has joined #ocaml
iago has quit [Quit: Leaving]
vpalle_ has joined #ocaml
vpalle has quit [Ping timeout: 240 seconds]
sepp2k has joined #ocaml
fabjan_ has left #ocaml []
avsm has joined #ocaml
alpounet has quit [Read error: Connection reset by peer]
alpounet has joined #ocaml
avsm has quit [Ping timeout: 258 seconds]
mjonsson has joined #ocaml
pesadilla has joined #ocaml
iratsu has quit [Ping timeout: 240 seconds]
iratsu has joined #ocaml
roconnor has joined #ocaml
* roconnor goes back to wrestling with ocamlfind
<gildor> roconnor: what's the problem with ocamlfind
<roconnor> I've installed lablgtk into a non-standard directory, but ocamlfind keeps claiming it is installed in the default location
<roconnor> lablgtk's make process doesn't install using ocaml find, so I just copied the META file to where it is installed.
<gildor> which distribution ?
<roconnor> I'm trying to package it for nix
<gildor> nixos ?
<roconnor> yes
<roconnor> nix is the package manager
<roconnor> which in theory can run on other distributions other than nixos
<roconnor> though I haven't done that myself
<roconnor> does ocamlfind keep a database of installed stuff?
<gildor> what is the content of your META
<roconnor> I just assumed it browses through the OCAMLPATH looking for META files
<gildor> no DB, just a bunch of META in subdirectories
<roconnor> let me paste it
<gildor> ocamlfind printconf will tell you where it looks for META
<roconnor> that is the contents of the META file
mjonsson has quit [Ping timeout: 272 seconds]
<gildor> the directive "directory=+lablgtk2" make it look for lablgkt in $(ocamlc -where)/lablgtk2"
<roconnor> oh!
<gildor> where did you install it ?
<roconnor> It is installed in /nix/store/979vbpcqzvvmisyd77028gdpax3hi2gr-lablgtk-2.14.1/lib/ocaml/3.11.1/site-lib/lablgtk2
<roconnor> but lablgtk's installer doesn't use ocamlfind
<gildor> is the META in the directory where lablgtk*.cma located ?
<roconnor> I just copied the META file that happend to be in the distribution
<roconnor> gildor: yes
<gildor> just remove the "directory=" directive, that'll do
<roconnor> thanks!
<roconnor> gildor: I would have never figured that out
<gildor> FYI, I think this is a Debian created META file that was in METAS/META.lablgtk, where directory directive is useful because the META is outside the lablgtk directory
<roconnor> gildor: That sounds right
<roconnor> yay, ocamlfind seems to be returning a resonable location now
<roconnor> Now I can go back to trying to build lablgtkmathview. Thanks!
<gildor> np
dark has joined #ocaml
<dark> before loading batteries (and camlp4), it was all ok. now, ocaml says {< s = x; p = y >} has a problem (it interprets it as s = (x; p =y))
<dark> how to make an object that is a shallow copy, changing more than one field?
<dark> I want to try the 'functional style' described at manual005.html#toc30
avsm has joined #ocaml
vpalle_ has quit [Ping timeout: 265 seconds]
<thelema> hmm, what's your exact code?
<thelema> camlp4 shouldn't affect that code
<dark> http://paste.pocoo.org/show/257634/ , it doesn't do anything (but used to be accepted by the interpreter)
<dark> lines 56-57
<dark> without the open Batteries and the proposed .ocamlinit, i get this http://paste.pocoo.org/show/257638/
<thelema> I get a type error somewhere in obj when pasting that into my (batteries-enabled) typelevel...
<dark> yes.. i get it too. then i debugged with C-x C-e at tuareg
<dark> until i found the place
<dark> with a file and ocamlc it would be easier i suppose
<dark> the type error is that it interprets that as s= (x; p = y), so it expects x to be unit, and p = y to be bool
<thelema> ah, that would explain the two messages...
<dark> maybe it will get it right if i sat (s = x); (p = y)?
<dark> say
<thelema> maybe...
vpalle_ has joined #ocaml
<dark> now it says syntax error
<dark> is there a way to have Batteries at toplevel without camlp4?
<thelema> yes, in the battop.ml files (installed with batteries), change ext_syntax to false
<thelema> Line 35
<dark> what would be the syntax extensions? #help etc?
<thelema> no, pa_string and pa_comprehension
<thelema> for list comprehensions and unicode rope literals
<dark> list comprehension would be nice
mceier has joined #ocaml
<dark> also 'local opening of modules' is something i always wanted (but now ocaml has an alternative syntax)
<thelema> odd - can you reproduce the problem in the compiler (and not toplevel)?
<dark> how to compile something with batteries? ocamlc somemodule.cma myfile.ml?
<dark> i saw some omake, etc. things, that would use findlib i guess
<thelema> I use ocamlbuild, for which you have to set up _tags and get a myocamlbuild.ml file
Proteus has joined #ocaml
vpalle_ has quit [Ping timeout: 252 seconds]
<dark> ocamlc -I `ocamlfind query batteries` batteries.cma ahm-game.ml
<dark> this compiles
<dark> (an a.out that does nothing)
<thelema> yes, but desn't use any camlp4
<dark> hm. maybe i should just call ocaml toplevel with that parameters
<dark> (but when I try to actually open Batteries, it says Reference to undefined global `CamomileLibrary', so i need to load something else too..)
<thelema> yup, camomile
<dark> how to compile with ocamlc, but with camlp4 extensions?
<thelema> I don't know - findlib takes care of that for me
<thelema> you're right, it's a camlp4 problem, not related to batteries, as if I just load camlp4o, the same error happens
<kaustuv_> Batteries still depends on camlp4?
<thelema> the toplevel init by default loads it, the package for camlp4 is separate
<roconnor> I have another small question. ml_gtk_mathview.c includes files such as <caml/mlvalues.h> etc, But the parameter given to gcc is -I$OCAML_LIB_DIR/caml. The net result is that it cannot find $OCAML_LIB_DIR/caml/caml/mlvalues.h
<roconnor> My question is, which caml subdirectory should I remove
<dark> i would like to change this default without changing batteries code itself
<roconnor> the ones in the .c file, or the parameter to gcc?
<dark> i.e. only at ocamlinit
<gildor> roconnor: in gcc of course
<thelema> dark: remove the last line of batteries' ocamlinit and replace it with the contents of battop.ml
<gildor> -I$OCAML_LIB_DIR
<roconnor> gildor: sure, I find that natural, however I fibed a little. it is actually gcc -I$OCAML_INCLUDE_DIR where OCAML_INCLUDE_DIR is set to $OCAML_LIB_DIR/caml (or /usr/include/caml) in ./configure
<roconnor> gildor: does this mean that ./configure is broken?
<gildor> don't know
<dark> Hmmmm. nice. also this explains how to not print the greeting message.^^
<roconnor> gildor: okay, I'll patch ./configure
<gildor> what is your configure invocation
<dark> #install_printer is something nice. is it from batteries, or from the toplevel itself?
<thelema> dark: toplevel itself
th5 has joined #ocaml
<dark> everything is fine now:)
<roconnor> gildor: ./configure --prefix ...
<gildor> I just remember that in Debian we have a symlink from /usr/include/caml to +caml/
ikaros has quit [Quit: Leave the magic to Houdini]
_unK has joined #ocaml
<gildor> this makes -I$OCAML_LIB_DIR useless
<gildor> and you can fix your problem without patch using INCLUDE=$INCLUDES:$OCAML_LIB_DIR make ...
<roconnor> gildor: this is probably why the build worked for the person who made the tar ball.
<roconnor> gildor: and why it works on debian.
verte has quit [Quit: ~~~ Crash in JIT!]
<roconnor> gildor: ya, that is a tempting alternative
<gildor> sorry INCLUDE_PATH=$INCLUDE_PATH:$OCAML_LIB_DIR
<gildor> more than tempting I think ;-)
<gildor> env variables are here for that
<roconnor> but ./configure is broken :)
<dark> this kind of variable prompted security warnings recently
<dark> but it was with LD_LIBRARY_PATH=$LD_LIBRARY_PATH:..
<gildor> dark: what kind ?
<dark> what happens when the variable is empty?
<gildor> dark: LD_LIBRARY_PATH is really another problem ;-) (because it involves runtime invocation and override of libc)
<dark> well, yes
<gildor> when INCLUDE_PATH is empty ? Nothing get added to include path of gcc
<dark> but if the INCLUDE_PATH is :/a/b
<dark> would it include the current directory first? (but anyway, this seems less of a problem)
<gildor> maybe you can trick someone by placing a stdio.h in you $OCAML_LIB_DIR and divert various function when compiling C code
<gildor> dark: the current directory is anyway in the search path
<dark> so it isn't a problem at all
<gildor> indeed ;-)
<roconnor> gildor: I'm going to look into making sure that the headers are aways in the Include path when ocaml is a build input.
<gildor> why not add a symlink from /usr/include/caml to +caml ?
<gildor> roconnor: ^^^
<roconnor> gildor: nix doesn't have a /usr directory
<gildor> how gcc manage to find its /usr/include ?
<avsm> its built in
<avsm> cc -print-search-dirs
<avsm> for example
<roconnor> gildor: it is some magic combination of a gcc-wrapper and possibly gcc is patched
<roconnor> I don't know the details myself
<gildor> avsm: thanks, but roconnor tells that on nixos there is no /usr/include (I suppose there is one foreach package, which can makes a lot of include dir)
<avsm> -nostdinc
<avsm> then turns that off
<roconnor> gildor: the gcc command lines can get quite long
<avsm> i havent followed the rest of the thread, but you just disable standard includes from gcc with that
<avsm> and then you specify -I directly
<roconnor> gildor: are your caml/foo.h files installed in something/lib/ocaml/caml/foo.h ?
<gildor> roconnor: just for fun what is the output of gcc -print-search-dirs | wc -c
<gildor> 1250 on Debian
<roconnor> 2184
<gildor> not that big ;-)
<roconnor> I'll paste it
<avsm> thats for libraries, it doesnt really matter
<gildor> roconnor: maybe there is a standard way on nixos to add a new search path to gcc, you should try to use it to add +caml to it
<roconnor> gildor: ya that is what I'm looking into now
<roconnor> gildor: are your caml/foo.h files installed in something/lib/ocaml/caml/foo.h ?
<gildor> roconnor: I don't often distribute .h files in my OCaml projects
<gildor> (I don't in fact)
<roconnor> gildor: I mean the ones that come with ocaml
<roconnor> e.g. caml/mlvalues.h
<gildor> its installed in /usr/lib/ocaml/caml/
<gildor> e.g. /usr/lib/ocaml/caml/mlvalues.h
<roconnor> gildor: good
<roconnor> gildor: though, don't you find that a strange place for header files?
<gildor> that is the reasone why it is linked to /usr/include/caml
<gildor> but .cmi are also headers file
<gildor> header files
<roconnor> okay
<roconnor> I think I know what I need to do now
<gildor> and you can even find .mli in these directories (which are non-precompiled header files, just like .h files)
<roconnor> I think I'll more or less follow you advice
<roconnor> if I make a symlink from include/caml to lib/ocaml/caml as a post build step
<roconnor> then the headers should automatically come available to any package that depends on ocaml
* roconnor tries
iago has joined #ocaml
<roconnor> sadly this means rebuilding ocaml and every ocaml package (the ocaml packages are rebuilt because it doesn't know that it hasn't really changed)
<roconnor> but it should be good in the long run
Yoric has joined #ocaml
barismetin has quit [Remote host closed the connection]
<roconnor> (and thanks to nix I can keep my old ocaml installation while working on building a new one)
<dark> nix?
<dark> roconnor: nixos, or nix on top of something else?
<roconnor> nixos
<roconnor> though it theory it would work with nix anywhere
<dark> interesting.. i'm about to install, but i'm having some hard time at the fundamentals
<dark> it looks like there is not much documentation
<dark> i use gentoo right now
<roconnor> dark: I get a lot of help on the irc channel
<dark> and i'm constantly paying the price for mutable, in-place software updates
<roconnor> It was a bit tough at first but I quickly got the hang of it.
<dark> roconnor: yeah i was able to get past of some difficulties there
<roconnor> dark: partly because I wanted to start with encrypted root
<dark> yes, i have an encrypted partition, and inside it an lvm volume
<roconnor> so I had to learn some unsual boot hooks off the bat
<dark> hmm
<dark> i don't need to manage the boot inside nix..
<dark> i actually manage grub from debian (i have debian and gentoo right now)
<dark> and my initrd is homemade
<roconnor> nixos keeps old system configurations around on the grub menu so you can revert to any previous configuration at boot time if you want
<dark> do it support grub2?
<roconnor> dark: yes
<roconnor> though I think grub1 is still the default
<dark> well, i can have it producing /etc/grub.d files, and feeding it to my usual grub installation
<roconnor> I don't know grub2, sounds plausible though
<dark> grub1 is default at gentoo, and i can't get to install grub2:(
<roconnor> I ran grub2 for a while, but I couldn't figure out the syntax to get it to boot windows properly
<roconnor> not that I really wanted to boot windows
<roconnor> but I figured I'd return the lab's laptop in a mode where they could recover windows if they wanted to
<dark> it comes with a predefined os detector (at least in debian), but i disabled it
<roconnor> dark: I've never used gentoo, but I get the feeling that gentoo users would like nixos.
<dark> yes, i found nixos interesting :) but some concepts are quite different
<dark> well i have to go, bye
dark has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ttamttam has quit [Remote host closed the connection]
<roconnor> gildor: my symlink seems to have worked
ikaros has joined #ocaml
sepp2k has quit [Read error: Connection reset by peer]
|marius| has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
|marius| has quit [Remote host closed the connection]
|marius| has joined #ocaml
|marius| has quit [Ping timeout: 240 seconds]
Edward has joined #ocaml
<gildor> roconnor: good news
|marius| has joined #ocaml
|marius| has quit [Remote host closed the connection]
th5 has quit [Quit: th5]
<roconnor> gildor: I sent a patch to the developers of nixpkgs
|marius| has joined #ocaml
ygrek has joined #ocaml
iago has quit [Quit: Leaving]
Yoric has quit [Quit: Yoric]
caligula_ has quit [Read error: Connection reset by peer]
ulfdoz has joined #ocaml
caligula_ has joined #ocaml
jakedouglas has joined #ocaml
avsm has quit [Quit: Leaving.]
eldragon is now known as maharba
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 260 seconds]
mcclurmc has joined #ocaml
oriba has joined #ocaml
Edward has quit []
vpalle_ has joined #ocaml
Anarchos has joined #ocaml
Associat0r has joined #ocaml
TaXules_ has joined #ocaml
TaXules has quit [Remote host closed the connection]
fraggle_ has quit [Remote host closed the connection]
Edward has joined #ocaml
ulfdoz has quit [Ping timeout: 245 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
jakedouglas has quit [Quit: Leaving.]
JimmyRcom has quit [Read error: Connection reset by peer]
Associat0r has quit [Quit: Associat0r]
fraggle_ has joined #ocaml
fraggle_ has quit [Quit: -ENOBRAIN]
fraggle_ has joined #ocaml
vpalle_ has quit [Ping timeout: 276 seconds]
npouillard has joined #ocaml
jakedouglas has joined #ocaml
Modius_ has joined #ocaml
Modius has quit [Ping timeout: 260 seconds]
ygrek has quit [Ping timeout: 245 seconds]
tautologico has joined #ocaml
vpalle_ has joined #ocaml
roconnor has quit [Remote host closed the connection]
JimmyRcom has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
vpalle_ has quit [Ping timeout: 265 seconds]
jakedouglas has quit [Quit: Leaving.]
tautologico has quit [Remote host closed the connection]
olauzon has joined #ocaml
boscop has quit [Ping timeout: 245 seconds]
oriba has quit [Quit: Verlassend]
boscop has joined #ocaml
jakedouglas has joined #ocaml
mceier has quit [Quit: leaving]
Nutssh has joined #ocaml
Nutssh has quit [Ping timeout: 240 seconds]
valross has joined #ocaml
|marius| has quit [Ping timeout: 272 seconds]
Nutssh has joined #ocaml
|marius| has joined #ocaml
Nutssh has quit [Ping timeout: 272 seconds]