watermind has quit [Read error: Connection reset by peer]
talzeus has joined #ocaml
watermind has joined #ocaml
chris2 has quit [Ping timeout: 260 seconds]
chris2 has joined #ocaml
mcclurmc has quit [Ping timeout: 250 seconds]
chris2 has quit [Ping timeout: 248 seconds]
chris2 has joined #ocaml
chris2 has quit [Read error: Operation timed out]
chris2 has joined #ocaml
darkf has quit [Quit: Leaving]
yacks has joined #ocaml
dsheets has quit [Ping timeout: 248 seconds]
thomasga has joined #ocaml
chris2 has quit [Ping timeout: 245 seconds]
chris2 has joined #ocaml
chris2 has quit [Ping timeout: 260 seconds]
chris2 has joined #ocaml
sagotch has joined #ocaml
mchqwerty has quit [Quit: Odcházím]
S11001001 has joined #ocaml
S11001001 has quit [Changing host]
S11001001 has joined #ocaml
jonludlam has joined #ocaml
jludlam has joined #ocaml
cdidd has joined #ocaml
jonludlam has quit [Ping timeout: 245 seconds]
struktured has joined #ocaml
<sagotch>
what is the best (simplest) way to install my own program. I already used ocamlfind install to install a library, but what about binary file? A tool to automatically find where to install bin
<companion_cube>
if you have a configure file (using oasis for instance) you can cp to the bindir
<flux>
I don't think there is one. programs usually just default to /usr/local/bin and if that's not ok, the user can somehow override it
<troydm>
what's the name of a function to extract value from option ?
<companion_cube>
match ... with
<companion_cube>
:D
<flux>
there is no such function in ocaml standard library
<flux>
(Batteries comes with Option.get and a variant, though)
<companion_cube>
basically options are designed to force you to pattern match
<companion_cube>
because you need to deal with both cases
<pippijn>
yes
<flux>
but, there can be cases where you just know there is a value
<pippijn>
yes
<pippijn>
rarely
cdidd has quit [Remote host closed the connection]
<pippijn>
and I tend to avoid those cases
<flux>
and doing a match in that case with just adds noise, not information
cdidd has joined #ocaml
<pippijn>
in most cases, you can add a match in the place where you gain the knowledge that it's Some
<pippijn>
by slightly restructuring the code, perhaps splitting off some code into another function
<pippijn>
if you know it by secondary circumstances, I don't think that's very good style
Kakadu has quit [Ping timeout: 245 seconds]
Kakadu has joined #ocaml
<pippijn>
let opt = if something then Some stuff else None in if something then (* I know opt is Some *)
<flux>
here is an example from my gtk-using app: let id = ref None in id := Some ( GMain.idle.add @@ fun -> GMain.idle.remove (Option.get id); .. more code ..
<flux>
is that a bad case to use?
<pippijn>
no
<pippijn>
I think that's reasonable
<pippijn>
I think you'd much more often get such cases in side-effectful code
<pippijn>
it's Option.get !id, right?
<flux>
right, I wrote that out as it was not an oneliner originally
<flux>
GMain.Idle as well :)
<ggole>
The alternative is to come up with a dummy value, which isn't always a good idea.
<companion_cube>
here, couldn't you use a function reference directly?
<pippijn>
ggole: right, actually I usually do that
<ggole>
It can be preferable to matching on options in a million places
<flux>
companion_cube, ?. note that I'm not assigning a function there.
<pippijn>
most of my record types have an empty_record value
<flux>
ggole, or maybe you could just use the equivalent of Option.get..
<companion_cube>
oh
<ggole>
But you are effectively lying to the type system by encoding your own "None"
<companion_cube>
ggole: you can use a monad on options
jludlam is now known as jonludlam
<companion_cube>
so that only to extract the final value is matching needed
ygrek has joined #ocaml
<ggole>
That's reasonable if you're going the option route, I guess.
<pippijn>
I love it when I have an actual use case for option monads
<bernardofpc>
adrien: """GtkPixmap has been deprecated since GTK+ 2.0 and should not be used in newly written code. Use GtkImage instead.""" Is there GtkImage in lablGtk ?
<adrien>
use GtkPixmap :P
<adrien>
bernardofpc: to use in what?
<adrien>
actually
<adrien>
try in GtkMisc, GMisc
Yoric has quit [Ping timeout: 265 seconds]
avsm has joined #ocaml
kyrylo has joined #ocaml
<adrien>
bernardofpc: yeah, there's GMisc.image
<bernardofpc>
adrien: my idea is that I will have a fair amount of graphics (say curves drawn point by point because simulation)
<bernardofpc>
so I want to render them in a layer-0
<adrien>
I guess they deprecated it because they were switching to Cairo
<bernardofpc>
and then some part will do an animation, which I'd put on layer-1
<bernardofpc>
so that I can care about managing layer-1 only, and then render will properly (I don't know how yet) fuse them
<bernardofpc>
so I started learning more about pixmaps
<bernardofpc>
and then I found the deprecation just now
<adrien>
I wasn't aware of it, or at least I kept on forgetting it
<adrien>
I'm not a huge fan of Cairo
<adrien>
it's fairly slow
<bernardofpc>
well, I can take a suggestion on my basic problem ;-)
samebchase has quit [Ping timeout: 260 seconds]
<adrien>
GMisc.image? :P
<bernardofpc>
I don't know how it works, but I'll look into it
<bernardofpc>
oh, other quesiton
<bernardofpc>
is there some place where the magic constants GDK_BUTTON1_MASK get declared ?
<bernardofpc>
grep did not answer me)
samebchase has joined #ocaml
mort___ has joined #ocaml
samebchase has quit [Remote host closed the connection]
samebchase has joined #ocaml
<bernardofpc>
o bit-test (GdkEvent.Motion.state ev) for the button pressed
<bernardofpc>
*to bit-test
<adrien>
bernardofpc: remove "GDK_"
<adrien>
check again
Thooms has joined #ocaml
lovethroat has joined #ocaml
avsm has quit [Quit: Leaving.]
<bernardofpc>
no luck :/
<bernardofpc>
I do find a lot of BUTTON1, but those are variants
<bernardofpc>
`BUTTON1 or alike
<adrien>
:)
<bernardofpc>
the compiler seems not to like comparing these with integers
<adrien>
bernardofpc: you're grepping in the source?
<bernardofpc>
(but maybe I shouldn't land them)
jwatzman|work has quit [Quit: jwatzman|work]
<bernardofpc>
adrien: both the source and the /usr/lib/ocaml/lablgtk2/ dir
<adrien>
look at .vars file
<adrien>
they're read by varcc and that creates several files which are then compiled
<adrien>
the "GDK_" bit is factored from the names
<bernardofpc>
how nice of them :/
<bernardofpc>
(well, It's better for maintainability, worse for grep)
<bernardofpc>
still I see no "BUTTON1"
<bernardofpc>
hum, so maybe they are "GDK_" `BUTTON1_MOTION instead of _MASK
jonludlam has joined #ocaml
<bernardofpc>
oh no
<bernardofpc>
its B1_MOTON_MASK
<bernardofpc>
with a GDK in front
<bernardofpc>
ok...
<bernardofpc>
by the way
<bernardofpc>
how do I mention a variant `BLAH in module Foo ?
<bernardofpc>
Foo.(`BLAH) ?
<adrien>
`BLAH
<bernardofpc>
variants have no namespace ?
<adrien>
oh
<adrien>
I've discovered a new thing in the syntax of .var files
<adrien>
bernardofpc: no; but I meant using it to quickly get the type of a function and navigate to the related functions
<bernardofpc>
right, this certainly will help
<flux>
nice, it covers operators as well :) Error: Unbound value -~. Did you mean --., -. or ~-.?
Yoric has quit [Ping timeout: 265 seconds]
contempt has quit [Ping timeout: 245 seconds]
lovethroat has quit [Ping timeout: 272 seconds]
contempt has joined #ocaml
oriba has quit [Quit: oriba]
jwatzman|work has joined #ocaml
lovethroat has joined #ocaml
mreca has joined #ocaml
axiles has quit [Remote host closed the connection]
<adrien>
pippijn: around?
jonludlam has quit [Remote host closed the connection]
<pippijn>
adrien: just in time
<pippijn>
adrien: yes
Thooms has quit [Read error: No route to host]
<adrien>
pippijn: I wanted to ask you what "Sie verzichten damit aber auf Zusatzleistungen und Services für die wir Ihre Kundendaten benötigen." would mean, it's from notebooksbilliger.de and I roughly understand it but it's not very clear
Thooms has joined #ocaml
<pippijn>
with this action, you waive your right to additional services and.. services for which we would need your customer data
<adrien>
and notebooksbilliger has a freedos option which is way less expensive
<pippijn>
yeah
<pippijn>
freedos = no OS
<pippijn>
essentially :)
<pippijn>
but it's funny that they actually bother to put it on there
<adrien>
heh, I've been looking at it for some time now but since I'm leaving for 4-5 days on tomorrow, I want to buy it before I leave to not delay it too much
<adrien>
they might have to ship at least something
<adrien>
hmm, they only ship in germany and austria
tobiasBora has joined #ocaml
xaimus has joined #ocaml
<erider>
hi all
<companion_cube>
hi erider
WraithM has quit [Ping timeout: 248 seconds]
WraithM has joined #ocaml
dsheets has joined #ocaml
WraithM has quit [Read error: Operation timed out]
lovethroat has quit [Ping timeout: 250 seconds]
contempt has quit [Ping timeout: 260 seconds]
contempt has joined #ocaml
WraithM has joined #ocaml
ontologiae has quit [Ping timeout: 250 seconds]
<ArthurB>
would it be fair to say that the difference between class and module in ocaml maps well to the difference between class with no virtual calls in C++ and those that do use dynamic binding?
<companion_cube>
I'm not sure, because in Ocaml modules and classes are totally different wrt typing
<companion_cube>
whereas in C++ they are almost the same ("virtual" excepted)
<ArthurB>
in this respect, emulating inheritance with a functor is the equivalent of the Curiously Recurring Template trick
<ArthurB>
companion_cube: they look similar but they are quite different
<companion_cube>
in ocaml they don't look similar at all
<companion_cube>
(but yeah, modules are static dispatch, objects dynamic dispatch)
ousado has joined #ocaml
ocp has joined #ocaml
venk has quit [Remote host closed the connection]
thomasga has joined #ocaml
<ArthurB>
I'm somewhat new to ocaml development
<ArthurB>
what do most people commonly work with, modules or objects?
<bitbckt>
modules.
<companion_cube>
ArthurB: you had a fair point though, objects are sometimes used when dynamic dispatch is useful
Arsenik has quit [Remote host closed the connection]
<ArthurB>
so in CPP, you can do a lot with the templating language to help you resolve types at compile time
<ArthurB>
I work in hft where the cost of virtual calls is too high, and there are very often static workarounds
<companion_cube>
apparently some trading can be done in ocaml, see Jane Street ;)
Yoric has joined #ocaml
avsm has joined #ocaml
<Drup>
(adrien : do you have a proposition for a drawing engine to replace cairo ?)