seafood has quit [Read error: Connection reset by peer]
seafood_ is now known as seafood
mjonsson has quit [Quit: Leaving]
dnolen has quit [Quit: dnolen]
seafood has quit [Quit: seafood]
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
hto has quit [Quit: Lost terminal]
arubin has quit [Quit: arubin]
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
DimitryKakadu has joined #ocaml
bzzbzz has quit [Quit: leaving]
sebz has joined #ocaml
<rgrinberg>
can you add guards when you catch exceptions with "with"?
Associat0r has joined #ocaml
<DimitryKakadu>
Hallo men!
<DimitryKakadu>
let f ((a,_) as x) = a;;
<DimitryKakadu>
why I can't write let f (a,_) as x = a;; ?
<adrien>
that looks pretty confusing
<DimitryKakadu>
Is it obvious to recover parenthetes around keyword `as`?
<adrien>
and if you add more parameters, let f (a, _) as x b = a;;
<DimitryKakadu>
adrien: why?
<DimitryKakadu>
I think that alone identificator can be after `as` keyword
<DimitryKakadu>
only
<adrien>
I mean, for the human reader, I find it pretty hard to read
Associat0r has quit [Quit: Associat0r]
jimmyrcom has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
zorun has quit [Quit: leaving]
zorun has joined #ocaml
rgrinberg has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
Cyanure has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
surikator has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
surikator has quit [Quit: surikator]
sebz has joined #ocaml
surikator has joined #ocaml
<diml>
olasd: i can't escape it either, but adding some spaces seems to make ocamldoc happy
iratsu has quit [Ping timeout: 245 seconds]
Yoric has joined #ocaml
ikaros has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
ftrvxmtrx has joined #ocaml
lopex has joined #ocaml
ygrek has joined #ocaml
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
lpereira has joined #ocaml
Yoric has quit [Quit: Leaving.]
jimmyrcom has joined #ocaml
BiDOrD has joined #ocaml
BiDOrD_ has quit [Ping timeout: 264 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
<olasd>
diml: thanks :)
ikaros has quit [Quit: Ex-Chat]
lopex has quit []
tomprince has joined #ocaml
<tomprince>
IS this the right place to ask about ocamlbuild? Is there any way to change the output directory (within _build) for generated executables? Symbolic links won't work, since the program looks through symbolic links.
<adrien>
tomprince: I think -build-dir should work
sebz has joined #ocaml
<ygrek>
tomprince, place the corresponding main.ml in your source tree where you want the resulting binary
<adrien>
oh, I had misread, sorry: thought you wanted to change "_build" to something else
<tomprince>
A bit more detail. I ave two executables (scripts/coqc and toplevel/coqtop). coqc calls (depending on arguments) coqtop.byte or coqtop.opt, and expects it to be in the same directory as itself. Now, this works fine after installtion. but fails for running tests.
<tomprince>
To complicate matters, coqc looks through symbolic links, to find out where it is located. Which is good for when it is installed, since you can add a symbolic link from $HOME/bin to the installtion directory, for example.
<tomprince>
But that means that even if I generate symbolic links side-by-side, coqc still looks for _build/scripts/coqtop.{opt,byte}
<ygrek>
add argument for coqc to specify exact coqtop command to use?
<ygrek>
and use it in tests
<ygrek>
how did it work pre ocamlbuild?
<tomprince>
It just generates all the binaries in bin/ when not using ocamlbuild.
<adrien>
hmmm, or use a Makefile which calls ocamlbuild and then cp everything in a tree looking like / after the installation?
sebz has quit [Quit: Computer has gone to sleep.]
<tomprince>
Is there any way to teach ocamlbuild to do that copy after the binaries are built?
<adrien>
you can probably do that with myocamlbuild.ml but I don't know how to do it
<ygrek>
there is cp rule builtin in ocamlbuild
iratsu has joined #ocaml
<ygrek>
you need to add a rule to myocamlbuild.ml and use cp there
iratsu has quit [Ping timeout: 258 seconds]
fabjan has quit [Remote host closed the connection]
Associat0r has joined #ocaml
Associat0r has quit [Changing host]
Associat0r has joined #ocaml
lpereira has quit [Ping timeout: 240 seconds]
lpereira has joined #ocaml
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
Associat0r has quit [Quit: Associat0r]
ikaros has joined #ocaml
fabjan has joined #ocaml
<tomprince>
So how does one add a rule to create bin/coqtop.opt from toplevel/coqtop.native? I trie
<Dynetrekk>
hi, I am having problems compiling unison from source (I do not know ocaml but I want to use an older version for compatibility): http://paste.pocoo.org/show/469548/
<Dynetrekk>
can anyone see what's wrong?
<DimitryKakadu>
Dynetrekk: have u declared value Update.split?
<Dynetrekk>
DimitryKakadu: as I said, I do not know the code
Yoric1 has quit [Ping timeout: 240 seconds]
<Dynetrekk>
DimitryKakadu: I could probably paste you the relevant code
<NaCl>
the source code checks for extended input devices by iterating over all devices and checking if one ends with "eraser"
<NaCl>
While the type may be opaque, the device "name" is unresolvable
<adrien>
what is the corresponding gdk function?
<NaCl>
gdk_devices_list
<NaCl>
which returns a linked list of void pointers to GdkDevices
<NaCl>
rather GdkDevice*'s
<NaCl>
I could implement this in C, but this sounds like it would get messy
<NaCl>
but I still need a way to resolve the device name
<NaCl>
interactively
lopex has joined #ocaml
<adrien>
hold on young padawan
<NaCl>
Don't you "young padawan" me
<adrien>
;-)
<adrien>
I need to check how lablgtk extracts stuff from GSList
Yoric has joined #ocaml
<adrien>
NaCl: can you prepare a short test code that would use such a function? I think I can add it
joewilliams_away is now known as joewilliams
<adrien>
I'm going to hunt for food and I need to hurry up: I found a place nearby where fruits, vegetables and animals are close to each others and not moving much, I should get there before they move
<NaCl>
let f dev = Printf.printf "%s\n" dev#name in
<NaCl>
List.iter f (Gdk.devices_list ())
<NaCl>
adrien: or I could just call it from C
joewilliams is now known as joewilliams_away
<NaCl>
actually, that would probably be simpler than extending lablgtk
surikator has joined #ocaml
<NaCl>
sweet I got it to segfault
<adrien>
NaCl: simpler? you're talking to someone who's maintaining a branch named "api-additions"
<NaCl>
oh
<NaCl>
haha
<adrien>
it's actualy fairly easy to add something to lablgtk, the issue is that there are many conversion functions and it takes time to get to know them
<NaCl>
so, uh
<NaCl>
mystery segfault
surikator has quit [Quit: Computer is sleeping. I'm probably not.]
ygrek has quit [Ping timeout: 245 seconds]
<NaCl>
adrien: the drawing.ml example segfaults here
<adrien>
oh
<adrien>
how do you start it?
ikaros has joined #ocaml
<adrien>
and
<adrien>
are you using my META file? =)
<NaCl>
no
<adrien>
and of course, do you have a backtrace? ;-)
<adrien>
so it only segfaults in native code? if so, can you add "module X = GtkInit" at the top of the file and try again in native code?
<NaCl>
no such module GtkInit
<NaCl>
uh
<adrien>
link against "gtkInit.cmx"
bzzbzz has joined #ocaml
<adrien>
(ah, that reminds me of a comment from someone about having to reference modules or not to get their side-effects depending on whether they are .cmo/.cmx)
* NaCl
wonders how he did it with flamel
* NaCl
wuts
<adrien>
simply add "gtkInit.cmx" to the command-line for linking
<NaCl>
it auto-worked there
<NaCl>
-lib wants a cmxa
<NaCl>
bleh
* NaCl
is useless
<adrien>
I mean for drawing.ml, so use -verbose and hand-edit the command-line
<NaCl>
yup
* NaCl
wonders why the META doesn't like me
<adrien>
how so?
<NaCl>
flamel linked against gtkinit fine
<adrien>
btw, does 'ocamlfind list | grep lablgtk' return anything?
<NaCl>
lablgtk2 (version: 2.12.0)
<adrien>
it didn't install using findlib by itself, right?
<NaCl>
huh?
<NaCl>
what do you mean
<adrien>
I was checking that a default lablgtk2 installation wasn't using findlib, and considering the git never mentions "ocamlfind", it probably doesn't
<NaCl>
and that META is old
<adrien>
yeah, that's why I made a new one =)
<adrien>
but actually, if the other thing is painful, drop my META in place of the old one, and link against the package "lablgtk2.init" in your _tags
* NaCl
does not understand why this does not workr
<adrien>
which steps/command are you doing exactly?
<NaCl>
ocamlbuild -use-ocamlfind
<NaCl>
using the default meta
<NaCl>
to hell with this
<adrien>
try by hand for now so at least we know if that's the reason of the drawing.ml segfault
<NaCl>
it worked if I included it
<adrien>
I don't see the usual stuff which shouts "missing gtk_init() and friends" so I'm not sure
<adrien>
ah, ok, good to know
<adrien>
should I mention my META file a bit more? I'll merge it in master in a few hours anyway so you might as well use it now :P
<NaCl>
emphasis on "to hell with this
<NaCl>
"
<adrien>
='(
<NaCl>
I'm getting it now
<adrien>
=)
<NaCl>
I though that's what I was intending. xD
<adrien>
heh
<adrien>
well, I'm going to see for the API you need, I don't think it's going to be an issue
<adrien>
(famous last words)
* adrien
readies several bottles of beer, don't fear the code quality
* NaCl
kills iframes
<NaCl>
it worked
<NaCl>
yay
<adrien>
\o/ (what worked?)
<NaCl>
your META
<adrien>
\o/
blinky- has joined #ocaml
* NaCl
now goes to figure out why his mouse event isn't working
Reaganomicon has quit [Read error: Connection reset by peer]
* NaCl
can't seem to get the drawingarea to appear
<adrien>
are you using a ~packing?
<NaCl>
yes
<NaCl>
I set the background to white, but nothing appears
<adrien>
on the drawable?
<NaCl>
no
<adrien>
how do you set the background then?
<NaCl>
drawable#set_background
ikaros has quit [Quit: Ex-Chat]
<NaCl>
drawable#set_background (`NAME "white") ;;
<adrien>
so on the drawable :P
<NaCl>
yes
<NaCl>
...bleh
<adrien>
^ ^
<NaCl>
THIS DOES NOT MAKE SENSE
<adrien>
do you implement "expose" (drawing_area#event#connect#expose)
<NaCl>
there is no way to pack a drawing area
<NaCl>
no
* NaCl
asks this question
<NaCl>
How was I supposed to know this?
<adrien>
there is definitely a way to pack a drawing_area with ~packing
<NaCl>
drawing_area? sure
<NaCl>
drawable? no
<adrien>
but: let drawable = new GDraw.drawable drawing_area#misc#window in
<adrien>
I'm not sure that implementing expose will fix your issue but you'll need it sooner or later anyway (very very soon actually)
<NaCl>
it doesn't
<adrien>
how did you write it?
<NaCl>
let redraw _ = drawable#set_background (`NAME "white") ; false
<adrien>
it's actually quite clearly stated in the gtk/gnome.org documentation
* NaCl
doesn't feel like going and poking at the documentation
<NaCl>
it's quite thick
<adrien>
I think I'll edit the ocamldoc stuff in lablgtk2 and make the link to that documentation much better, noone checks it
<adrien>
NaCl: for only one module? I find that it's actually quite readable and easy to go through quickly
oriba has joined #ocaml
<adrien>
actually, now, I first find the lablgtk2 function I want and then immediately load the gnome.org documentation
<NaCl>
The sematics are different
<NaCl>
and it can be difficult to determine the translation
<adrien>
otherwise, in practice, you're hitting an API with side-effects until it works
<adrien>
oh?
<NaCl>
gtk_event_add is a function
<adrien>
it's: get_foo -> #foo, set_foo -> #set_foo, first argument of the C function becomes the object, enums are polymorphic variants
<adrien>
well, here, #event#add
<adrien>
I have to say #misc and #event are hard to get used to
<NaCl>
yes.
<adrien>
in particular, when you're after some function, you often don't know where it is hidden
<NaCl>
because they could have been implemented as methods in the classes directly
<adrien>
hmmmm
<NaCl>
that made it work
<adrien>
=)
<NaCl>
And I personally found that signals and slots were a bit easier to deal with than this
<adrien>
I've been really pissed off at Qt after I got code that compiled but no signal->slot connection, and no error or warning
<adrien>
I would *only* get that when running the application inside gdb
* NaCl
senses that the moc should have been able to pick that up
<adrien>
it definitely takes some time to get used to lablgtk2 but once you start grokking its organization, it starts being much easier to use
<adrien>
no, moc never picked anything
<NaCl>
Qt wins points for making sense organizationally
<adrien>
Qt loses points for its horrible layout management and the fact that layouts are widgets
* NaCl
hasn't had a problem with that
<NaCl>
then again, I used the designer for everything
<adrien>
and you end up having to create both layouts and and corresponding widgets most of the time
<adrien>
well ;-)
<adrien>
what lablgtk2 needs is a few peoples who don't know lablgtk2 and simply ask "where is this?" and "why is it there?"
* NaCl
has been
<adrien>
so we can then make some kind of guide to it
<adrien>
there's actually already some stuff but it's probably not visible enough
<NaCl>
so, to detect a mouse drag, I would detect a mouse click, then observe the motion of the mouse in a motion_notify, then stop recording when the button is released?
<adrien>
sounds good
<rgrinberg>
anybody here use tuareg-mode? how come some of my menu commands are greyed out? usefull stuff like show type at point, etc.
<NaCl>
rgrinberg: install caml-mode
<rgrinberg>
NaCl, gotcha let me google it
<adrien>
NaCl: did you get your list of devices from gdk?
<NaCl>
did I?
<NaCl>
I've been working on the drawing routines
<adrien>
because it seems that there might be more work than I expected since the whole module is missing currently
<NaCl>
yeah
<NaCl>
I noticed that
<rgrinberg>
Isn't caml-mode a replacement for tuareg-mode, I'm not sure how I'd use them both
<NaCl>
you don't
<NaCl>
C-c C-t calls a function in caml-mode
<NaCl>
that doesn't need it to be running, apparently
<adrien>
NaCl: ok, do you need the device list soon? it's probably easy to add the new module
<adrien>
the harder is going to be the makefile
<rgrinberg>
C-c C-t does nothing for me. I'm not sure how to install caml-mode then :/ won't the usual (setq auto-mode-alist etc...) override tuareg-mode
<NaCl>
adrien: nope
<adrien>
NaCl: ok, but ping me daily about it so I don't forget however
* adrien
is supposed to release caravel 4 today
<NaCl>
ok
<NaCl>
maybe I'll try it if it doesn't require me recompiling half of my system
* NaCl
doesn't feel like tweaking spec files today
sebz has joined #ocaml
<adrien>
currently I'm using react and lablgtk2 (since it's lablgtk-react and not caravel actually)
<NaCl>
adrien: am I supposed to use cairo to draw stuff, or gdk itself?
<adrien>
good question
* NaCl
senses a disturbance in the Force
<adrien>
if you want with cairo, use cairo from cairo.forge.ocamlcore.org
<NaCl>
I'm not doing stuff complicated
<adrien>
conversely, if you don't want to use cairo from cairo.forge.ocamlcore.org, don't use cairo
<NaCl>
What do I want to use?
<adrien>
gdk directly
<adrien>
well, "directly" is the wrong word here
<NaCl>
eventually, this may get more complicated
<adrien>
I think the APIs are quite similar between cairo and gdk so you can probably migrate a bit later to cairo if you feel like doing it
<adrien>
don't wait too long of course but it might make sense to start with gdk, toy a bit with it, experiment and prototype
<NaCl>
true
<NaCl>
although this thing may be gobbled up by my employer
<NaCl>
but I doubt it
<NaCl>
adrien: the gtk docs suggest that the gdk drawing routines may be deprecated
<rgrinberg>
dumb question but how do i use ocamlc to compile an .ml file that uses batteries
<adrien>
they are already deprecated, in gtk3
<NaCl>
they are deprecated in gtk2
surikator has joined #ocaml
<adrien>
sorry, they are removed in gtk3
<adrien>
in gtk2, they exist just fine
<NaCl>
yeah, except it looks like I may need pathing
<NaCl>
drawing a bunch of points does not look viable
<adrien>
cairo2 it is then
<adrien>
rejoice, it's using oasis
<NaCl>
woohoo
* NaCl
was hoping not to make a new spec file today
<adrien>
this one should really be easy to make
<NaCl>
because it already exists in Fedora
Yoric has quit [Quit: Leaving.]
<adrien>
cairo or cairo2?
<adrien>
and cairo2 should be like anything using oasis, meaning copy-paste + a few search-replace should work
<NaCl>
just cairo
<adrien>
how old is it? which version is it?
<NaCl>
1.2.0
<adrien>
so not "cairo2"
<adrien>
afaik, "cairo2" was created because "cairo" wasn't very good and had memory leaks
<adrien>
now, if I got cairo2 working on windows in a few minutes, I'm sure you can get it packaged in a few seconds :P