javamonn has quit [Remote host closed the connection]
mlb has joined #ocaml
AltGr has joined #ocaml
mlb has quit [Client Quit]
justgage has quit [Ping timeout: 256 seconds]
dav has quit [Ping timeout: 252 seconds]
keen___ has joined #ocaml
keen__ has quit [Ping timeout: 272 seconds]
dav has joined #ocaml
asQuirreL has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
javamonn has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
darkf has joined #ocaml
yomimono has quit [Ping timeout: 252 seconds]
ldopa has quit [Ping timeout: 256 seconds]
lewis1711 has joined #ocaml
hilquias has joined #ocaml
osa1_ has joined #ocaml
<osa1_>
does anyone here have any experience with MetaOCaml? I'm trying to print a generated code but it's refusing to print it, saying "Warning 22: The CSP value is a closure or too deep to serialize" I want to print it no matter how big it is, any ideas?
jeffmo has joined #ocaml
kdef has quit [Ping timeout: 248 seconds]
swgillespie has joined #ocaml
javamonn has quit [Remote host closed the connection]
javamonn has joined #ocaml
meteo has quit [Quit: Leaving]
small-wolf has joined #ocaml
osa1_ has quit [Ping timeout: 256 seconds]
maufred has quit [Ping timeout: 256 seconds]
maufred has joined #ocaml
manizzle has quit [Ping timeout: 264 seconds]
nullcat_ has joined #ocaml
jeffmo has quit [Quit: jeffmo]
palomer has joined #ocaml
osa1_ has joined #ocaml
ygrek has joined #ocaml
javamonn has quit [Remote host closed the connection]
javamonn has joined #ocaml
mcclurmc_ has joined #ocaml
mcclurmc has quit [Ping timeout: 256 seconds]
ollehar has quit [Read error: Connection reset by peer]
BitPuffin|osx has quit [Ping timeout: 252 seconds]
ollehar has joined #ocaml
osa1_ has quit [Ping timeout: 265 seconds]
javamonn has quit [Remote host closed the connection]
justgage has joined #ocaml
Denommus has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ir2ivps4 has quit [Remote host closed the connection]
ir2ivps4 has joined #ocaml
mlb has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
osa1_ has joined #ocaml
osa1_ has quit [Ping timeout: 265 seconds]
struktured has joined #ocaml
javamonn has joined #ocaml
small-wolf has quit [Ping timeout: 248 seconds]
sdothum has joined #ocaml
idegen has quit [Quit: Leaving.]
javamonn has quit [Remote host closed the connection]
mlb has quit [Ping timeout: 264 seconds]
hilquias has quit [Ping timeout: 250 seconds]
mengu has joined #ocaml
mengu has joined #ocaml
JuggleTux has joined #ocaml
nullcat_ has quit [Ping timeout: 244 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
mengu has quit [Ping timeout: 256 seconds]
nullcat_ has joined #ocaml
mcclurmc_ has quit [Remote host closed the connection]
hilquias has joined #ocaml
ncthom91 has joined #ocaml
Denommus has joined #ocaml
Denommus has quit [Client Quit]
kushal has joined #ocaml
kushal has quit [Ping timeout: 255 seconds]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hellome has quit [Remote host closed the connection]
smondet has quit [Ping timeout: 245 seconds]
psy_ has quit [Ping timeout: 276 seconds]
hilquias` has joined #ocaml
hilquias has quit [Ping timeout: 256 seconds]
palomer has quit [Quit: palomer]
palomer has joined #ocaml
Tekilla has quit [Quit: Quitte]
MercurialAlchemi has joined #ocaml
palomer has quit [Quit: palomer]
badon has quit [Ping timeout: 250 seconds]
badon has joined #ocaml
shinnya has quit [Ping timeout: 252 seconds]
hilquias` has quit [Remote host closed the connection]
hilquias` has joined #ocaml
hilquias` has quit [Client Quit]
palomer has joined #ocaml
SomeDamnBody has joined #ocaml
<SomeDamnBody>
So I have a project that is built with ocaml
<SomeDamnBody>
I want to try having the compiler called with the flag -easy
<SomeDamnBody>
so that it generates more meaningful errors
<SomeDamnBody>
how do I specify that that should be passed to the compiler?
<MercurialAlchemi>
SomeDamnBody: don't see this flag for ocamlopt in 4.02.1
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<flux>
poor raspberry pi b, opam is compiling four packages at once..
<flux>
great though it does it these days apparently automatically, but shouldn't it default to number of cores or something? of course, some parts of the process are io-bound..
jonludlam has joined #ocaml
Haudegen has joined #ocaml
antkong has quit [Quit: antkong]
<struktured>
flux: here's a disgusting solution if you have proc: make -j`cat /proc/cpuinfo | grep processor | wc -l`
<flux>
how does that affect 'opam install xxx yyy zzz..'.. but I know about the environment variables, I would have expected the default functionality by single core or limited by the number of cores, not 4
<struktured>
well, make, omake, and other various tools have the -jN arg to use multiple cores. the project creator typically specifies the value N in their opam description file
scythe- has quit [Ping timeout: 264 seconds]
scythe- has joined #ocaml
<struktured>
yeah it would be cool if you could use some sort of magic opam variable which resolves to correct number of cores
<reynir>
using -j0 in opam would make it crash a while ago :v
<flux>
struktured, there is OPAMJOBS
<struktured>
just tried it with a makefile generated via oasis and it rejected the input
<struktured>
flux- cool, does it work? I will start using it
<flux>
so to be clear I mean opam doing this: Processing 20/34: [batteries: make all] [camlp4: make all] [re: ocaml setup.ml] [ssl: ./configure]
<flux>
not that a single package is compiled with multiple cores
<struktured>
oh ok
<struktured>
yeah that's different
<flux>
so that's what I believe OPAMJOBS affects
<struktured>
I wonder if you can piggie back off the value anyhow
<reynir>
Oh, the bug hasn't been fixed :)
<struktured>
reynir: no it doesn't crash, just shows help
<flux>
struktured, well you don't want both single packages and opam compile 4 jobs at once, because then you have 16 jobs running :)
<flux>
they should all be managed by some single batch executor, but that's not going to happen
<reynir>
Oh, I must have an old version of opam, then
<reynir>
Ah, 1.2.0
<struktured>
flux: yeah scheduler would be nice but using # of cores isn't a terrible heuirstic either
<struktured>
flux: in multicore ocaml you can write you own scheduler in < 30 lines of code :)
<flux>
struktured, but how do you make both opam and random opam packages use the same scheduler?
<struktured>
flux: can't really because they don't use the same build systems unfortunately, but pure ocaml solutio could do it
<flux>
yes.. and that's why it's not going to happen :)
<struktured>
eh let the OS figure it out :)
ia0 has quit [Quit: leaving]
ia0 has joined #ocaml
jonludlam has quit [Ping timeout: 256 seconds]
sgnb has joined #ocaml
<apache2>
how do I include libc constants in my ffi bindings?
dsheets has quit [Ping timeout: 256 seconds]
<flux>
you maybe make a C program that generates OCaml
<apache2>
I can do it the "old school" way by compiling a .o, was hoping there was a simpler way
<apache2>
sorry, it's early in the morning -- I was hoping I could do it from ctypes
nojb has joined #ocaml
smondet has joined #ocaml
<struktured>
so with depots in opam...can you still specify allowed version ranges?
<companion_cube>
not really, although you can write module type S = sig module Foo : Other_S ... end
<pippijn>
you can do: module type S = functor (M : sig end) -> sig end
<pippijn>
Sizur: is that what you want?
kakadu has joined #ocaml
<Sizur>
i need to understand what that means first
pobivan has joined #ocaml
asQuirreL has joined #ocaml
<Sizur>
module contains a type S that is another module or a signature?
<Sizur>
in the second case the functor evaluates to a signature?
<pippijn>
module M : S = functor(M : sig end) -> struct end;;
<pippijn>
Sizur: "module type" is a module signature
<pippijn>
Sizur: so that module type is parameterised by another module type
<pippijn>
module M has module type S
<pippijn>
you can apply the functor (function at the module level) to another module to get a module
<pippijn>
module F = M(struct end)
<pippijn>
now, this is a poor example, because all modules are empty
nojb has quit [Quit: nojb]
<Sizur>
module named M has type S, where the type S is functor(M : sig end) -> struct end?
<Sizur>
am i reading thsi right?
<pippijn>
almost
<pippijn>
module M has type S, but it's not really a module, yet; it's a functor that needs to be passed another module to return a module of type "sig end"
<pippijn>
the module expression "struct end" has type "sig end"
<Sizur>
what's the point of naming S when S's definition is literal here?
<Sizur>
just the syntax?
<companion_cube>
module type S = sig .... end is similar to type s = ...
<companion_cube>
it's giving a name to a (module) signature
octachron has joined #ocaml
<Sizur>
2:30am and my brain is shutting down. shouldn't ask interesting questions in the middle of the night :) i'll be back tomorrow
<Sizur>
thank you guys!
<companion_cube>
good night
antkong has joined #ocaml
TheLemonMan has joined #ocaml
dsheets has quit [Ping timeout: 276 seconds]
milosn has quit [Quit: leaving]
antkong has quit [Ping timeout: 250 seconds]
AltGr has left #ocaml [#ocaml]
nojb has joined #ocaml
nojb has quit [Quit: nojb]
milosn has joined #ocaml
milosn has quit [Client Quit]
cow-orker has quit [Ping timeout: 240 seconds]
mengu has joined #ocaml
cow-orker has joined #ocaml
jonludlam has quit [Ping timeout: 264 seconds]
sdothum has joined #ocaml
sdothum has quit [Client Quit]
yomimono has joined #ocaml
milosn has joined #ocaml
igitoor has quit [Ping timeout: 256 seconds]
igitoor has joined #ocaml
Haudegen has quit [Ping timeout: 264 seconds]
kushal has joined #ocaml
jonludlam has joined #ocaml
sdothum has joined #ocaml
lordkryss has joined #ocaml
Haudegen has joined #ocaml
igitoor has joined #ocaml
igitoor has quit [Changing host]
dsheets has joined #ocaml
kushal has quit [Ping timeout: 248 seconds]
mlb has joined #ocaml
thomasga has joined #ocaml
freling has quit [Quit: Leaving.]
thomasga has quit [Client Quit]
dsheets has quit [Ping timeout: 240 seconds]
thomasga has joined #ocaml
jonludlam has quit [Ping timeout: 264 seconds]
ygrek has quit [Ping timeout: 265 seconds]
jonludlam has joined #ocaml
<apache2>
I'm trying to find an example of packing integers in different byte orders. should I use sprintf, or is there a better approach?
<bernardofpc>
honestly I'd do that in a C library
<apache2>
I'm packing unix timestamps. also realized that ocaml has 31 integers and that instead of creating a proper type for 32bit integers (no one needs those, right!), whoever wrote the Unix.time implementation decided to just use floats
<apache2>
bernardofpc: I can do it with right shifts, it's just a bit of a wtf moment for me :(
psy_ has joined #ocaml
badkins has joined #ocaml
<flux>
well, it's pretty practical unix time format, because it comes with fractions
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ocaml
<adrien_znc>
(extunix)
_andre has joined #ocaml
thomasga has quit [Quit: Leaving.]
osa1_ has joined #ocaml
milosn has quit [Quit: leaving]
osa1_ has quit [Ping timeout: 256 seconds]
<haesbaert>
shouldnt menhir --strict --explain foo.mly generate a .conflicts for each conflict found ?
<haesbaert>
ohh I guess end of stream conflicts are not
<Drup>
it's a bit akward, but it's only for user customization using something similar to the file .Xressource
<Drup>
and I'm not sure how you would type that thing
ldopa has joined #ocaml
<companion_cube>
using universal types, I think
<companion_cube>
but indeed, parsing a file to set attributes becomes more verbose
<Drup>
I would believe in such a solution when I see an example of use that is not insanely type-verbose.
<companion_cube>
oh?
<companion_cube>
does something like mixtbl look too verbose to you?
<Drup>
the issue is for the keys comming from the config file
<companion_cube>
yes, I agree, every key would have to register a parser
<companion_cube>
a tuple (string * 'a key * (string -> 'a option)) basically
<Drup>
that's a lot of pain for something that is basically never an issue =')
<Drup>
companion_cube: if you want to contribute to some type spagetti, help me with https://github.com/Drup/furl :D
<companion_cube>
I've glanced at it
jeffmo has quit [Quit: jeffmo]
BitPuffin|osx has joined #ocaml
mcclurmc has joined #ocaml
agarie has joined #ocaml
yomimono has quit [Ping timeout: 276 seconds]
<Drup>
any opinon on the API ?
<companion_cube>
it looks a bit cryptic :p
<companion_cube>
but I'm sure it's nice once you read the types of operators
<Drup>
even the tutorial ?
<Drup>
well, you are not supposed to read the types of the operators really
<companion_cube>
you mean "quick look"?
psy_ has quit [Ping timeout: 256 seconds]
<Drup>
yes
<companion_cube>
%String <--- ok
<companion_cube>
?Nil <--- not that obvious
<Drup>
well, Nil is the end :D
<companion_cube>
but then why is there finalize?
<Drup>
yes, the finalize is something I want to remove
<companion_cube>
ok
<Drup>
it's used for converters, which is a feature not explaiend in the quick look and is similar to %a in format
<companion_cube>
I see the value restriction has struck again
<Drup>
yes
<Drup>
It's my biggest issue at the moment
<companion_cube>
if fetch_http a cohttp function?
jonludlam has quit [Ping timeout: 264 seconds]
<companion_cube>
or just pseudo code ?
<Drup>
it's an imaginary function from an imaginary http client.
<companion_cube>
sad
<companion_cube>
:D
<companion_cube>
I think I read a mail someone sent about making a high-level http client on top of cohttp
<Drup>
well, the core is agnostic from the actual client/server library
<companion_cube>
sure
jeffmo has joined #ocaml
octachron has joined #ocaml
<Drup>
but yes
mengu has quit [Remote host closed the connection]
struktured has quit [Ping timeout: 265 seconds]
thomasga has joined #ocaml
dav has quit [Ping timeout: 264 seconds]
dav has joined #ocaml
avsm has joined #ocaml
darkf has quit [Quit: Leaving]
yomimono has joined #ocaml
<apache2>
bernardofpc: I'd expect a runtime exception instead of silently truncating from (large float value) to (integer value 0)
<apache2>
in c you can at least detect such behavior through machine registers
yomimono has quit [Ping timeout: 248 seconds]
milosn has joined #ocaml
<companion_cube>
machine registers? in a portable way?
struk|work has quit [Quit: Page closed]
Sorella has joined #ocaml
struk|work has joined #ocaml
yomimono has joined #ocaml
palomer has joined #ocaml
osa1_ has quit [Ping timeout: 256 seconds]
avsm has quit [Quit: Leaving.]
remyzorg_ has quit [Ping timeout: 250 seconds]
mic_ has joined #ocaml
dav has quit [Ping timeout: 250 seconds]
dav has joined #ocaml
osa1_ has joined #ocaml
<mic_>
I want to modify an opam library and rebuild it. I am using a module from another library, and get "unbound module" error. Where is the place that I need to add the name of the library so installer can find it? Is it inside _oasis?
<companion_cube>
is the other library installed?
<mic_>
yes#
<companion_cube>
then you might need to edit BuildDepends: ...., mylib in _oasis
<mic_>
add opam name or ocamlfind name? they are different
<companion_cube>
ocamlfind
<companion_cube>
oasis mostly ignores opam
<mic_>
still receive the error
<companion_cube>
oasis setup
<mic_>
anything to be added to Modules: in _oasis?
<companion_cube>
no, it's BuildDepends:
<companion_cube>
Modules: is for modules of the library itself
<mic_>
ah, I thought opam install automatically calls oasis
mk270 has joined #ocaml
<mk270>
ocamlopt and ocamlc are giving me different .annot files; the ocamlopt-generated one is zero-length:
ollehar1 has quit [Remote host closed the connection]
rand000 has quit [Ping timeout: 264 seconds]
javamonn has quit [Remote host closed the connection]
javamonn has joined #ocaml
<mk270>
did anyone have any ideas about my "empty annot file under ocamlopt but not ocamlc" problem?
jwatzman|work has joined #ocaml
lopex has quit [Quit: Connection closed for inactivity]
javamonn has quit [Ping timeout: 265 seconds]
osa1_ has quit [Ping timeout: 272 seconds]
dsheets has joined #ocaml
ljs has quit [Quit: Be back later ...]
luzie has quit [Remote host closed the connection]
luzie has joined #ocaml
larhat has joined #ocaml
ncthom91 has joined #ocaml
osa1_ has joined #ocaml
kdef has quit [Quit: Leaving]
kdef has joined #ocaml
ljs has joined #ocaml
larhat has quit [Quit: Leaving.]
mlb has joined #ocaml
yomimono has quit [Ping timeout: 244 seconds]
lordkryss has joined #ocaml
ontologiae_ has joined #ocaml
nullcat_ has joined #ocaml
<bernardofpc>
adrien_znc: just after calling utop
avsm has quit [Quit: Leaving.]
<bernardofpc>
adrien_znc: is there a simple way to recompile *everything* on an ocaml switch (compiler inclusive) ?
ontologiae_ has quit [Ping timeout: 264 seconds]
tianon has quit [Ping timeout: 256 seconds]
thomasga has quit [Quit: Leaving.]
<bernardofpc>
I recompiled everything in my switch (besides the compiler itself....) and utop still makes ocamlrun segfault
thomasga has joined #ocaml
tianon has joined #ocaml
agarie_ has joined #ocaml
acieroid` has joined #ocaml
TheLemonMan has joined #ocaml
_2can has quit [Ping timeout: 264 seconds]
ohama has quit [Disconnected by services]
oscar_to1o has joined #ocaml
_andre_ has joined #ocaml
Wandering_Glitch has joined #ocaml
peterbb_ has joined #ocaml
tokik has joined #ocaml
lyxia_ has joined #ocaml
apache2_ has joined #ocaml
frawgie_ has joined #ocaml
ohama has joined #ocaml
cow-orke1 has joined #ocaml
Reventlo1 has joined #ocaml
Wandering_Glitch has quit [Changing host]
Wandering_Glitch has joined #ocaml
WanderingGlitch has quit [Disconnected by services]
Wandering_Glitch is now known as WanderingGlitch
Hetu has joined #ocaml
LnL_ has joined #ocaml
n_v has joined #ocaml
_andre has quit [*.net *.split]
cow-orker has quit [*.net *.split]
Reventlov has quit [*.net *.split]
peterbb has quit [*.net *.split]
apache2 has quit [*.net *.split]
tsumetai has quit [*.net *.split]
lyxia has quit [*.net *.split]
so has quit [*.net *.split]
thorsten` has quit [*.net *.split]
bjorkintosh has quit [*.net *.split]
jave has quit [*.net *.split]
n0v has quit [*.net *.split]
tokik_ has quit [*.net *.split]
ivan\ has quit [*.net *.split]
frawgie has quit [*.net *.split]
kdef has quit [*.net *.split]
agarie has quit [*.net *.split]
BitPuffin|osx has quit [*.net *.split]
idegen has quit [*.net *.split]
oscar_toro has quit [*.net *.split]
fraggle-boate_ has quit [*.net *.split]
cdidd has quit [*.net *.split]
CissWit has quit [*.net *.split]
dinosaure has quit [*.net *.split]
LnL has quit [*.net *.split]
masse has quit [*.net *.split]
acieroid has quit [*.net *.split]
Algebr has quit [*.net *.split]
Haudegen has quit [*.net *.split]
tg has quit [*.net *.split]
pdewacht has quit [*.net *.split]
johnelse has quit [*.net *.split]
k1000 has quit [*.net *.split]
companion_cube has quit [*.net *.split]
w1gz has quit [*.net *.split]
LnL_ is now known as LnL
n_v is now known as n0v
Hannibal_Smith has joined #ocaml
ivan\ has joined #ocaml
ivan\ has quit [Changing host]
ivan\ has joined #ocaml
pdewacht has joined #ocaml
w1gz has joined #ocaml
tg has joined #ocaml
Algebr has joined #ocaml
Haudegen has joined #ocaml
johnelse has joined #ocaml
companion_cube has joined #ocaml
k1000 has joined #ocaml
tg has quit [Max SendQ exceeded]
justgage has quit [Quit: Lost terminal]
jave has joined #ocaml
srcerer has quit [Ping timeout: 245 seconds]
ggole has quit []
tg has joined #ocaml
masse has joined #ocaml
fraggle-boate_ has joined #ocaml
cdidd has joined #ocaml
thorsten` has joined #ocaml
CissWit has joined #ocaml
kdef has joined #ocaml
bjorkintosh has joined #ocaml
robink has quit [Ping timeout: 244 seconds]
idegen has joined #ocaml
robink_ has joined #ocaml
<Drup>
bernardofpc: opam switch reinstall
seangrove has joined #ocaml
tsumetai has joined #ocaml
ontologiae_ has joined #ocaml
<bernardofpc>
thanks Drup
<bernardofpc>
but I found the reason (not the solution, though)
<bernardofpc>
the backtrace shows #6 0x00007ffff647d52c in ?? () from /usr/lib/ocaml/stublibs/dllthreads.so
<bernardofpc>
#7 0x00007ffff647d547 in ?? () from /usr/lib/ocaml/stublibs/dllthreads.so
thomasga has quit [Ping timeout: 256 seconds]
Submarine has joined #ocaml
Submarine has joined #ocaml
<bernardofpc>
but it should be using the *other* dllthreads.so, the one from my .opam/ installation
<bernardofpc>
(that exists in its correct place I guess ~/.opam/4.02.1/lib/ocaml/stublibs/dllthreads.so)
<bernardofpc>
but I have no idea how/why the other one is being used
<adrien_znc>
:)
mic_ has quit [Ping timeout: 246 seconds]
robink_ is now known as robink
<bernardofpc>
ocamldebug is not helping...
<bernardofpc>
Restart from time 610000 and try to get closer of the problem ? (y or n) y -> blocks
psy has joined #ocaml
<bernardofpc>
(using no cpu, so I'm not sure what's happening...)
<adrien_znc>
strace
<adrien_znc>
attach strace to it
<adrien_znc>
or gdb
<adrien_znc>
and bt
small-wolf has joined #ocaml
justgage has joined #ocaml
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nojb has joined #ocaml
osa1_ has quit [Ping timeout: 250 seconds]
matason has quit []
matason has joined #ocaml
<apache2_>
I'm getting crashes in ddlbigarray.so, but it was compiled without debug flags, so finding the symbol that causes it is ... tricky
<apache2_>
since there's no symbols in the file :(
<adrien>
chances are that it was compiled with but later got stripped and the debug data was put elsewhere
<apache2_>
yeah, usually there'd at least be a symbol table in the elf header
ljs has quit [Quit: Be back later ...]
troydm has joined #ocaml
ljs has joined #ocaml
<apache2_>
... and there is, but only some ocaml-c stuff and not anything related to the place that's failing. the segfault happens when rip is overwritten -- kind of bad as that could cause undesired behavior :(
<reynir>
bernardofpc: is the environment correct? eval `opam config env`
mlb has quit [Quit: Konversation terminated!]
nojb has quit [Quit: nojb]
osa1_ has joined #ocaml
Hannibal_Smith has quit [Quit: Leaving]
shinnya has joined #ocaml
troydm has quit [Ping timeout: 264 seconds]
troydm has joined #ocaml
osa1_ has quit [Read error: Connection reset by peer]
nullcat_ has joined #ocaml
Hetu has quit [Ping timeout: 264 seconds]
osa1_ has joined #ocaml
Hetu has joined #ocaml
Gama11_ has joined #ocaml
kushal has joined #ocaml
ljs has quit [Quit: Be back later ...]
Gama11 has quit [Ping timeout: 256 seconds]
nojb has joined #ocaml
ahabmd has joined #ocaml
psy has quit [Ping timeout: 272 seconds]
ahabmd has quit [Quit: Bye]
troydm has quit [Ping timeout: 264 seconds]
psy has joined #ocaml
troydm has joined #ocaml
n3ss3s has joined #ocaml
osa1_ has quit [Ping timeout: 240 seconds]
rand000 has joined #ocaml
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ontologiae_ has quit [Ping timeout: 240 seconds]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nullcat_ has joined #ocaml
ljs has joined #ocaml
osa1_ has joined #ocaml
kdef has quit [Quit: Leaving]
osa1_ has quit [Read error: Connection reset by peer]
darnuria has quit [Ping timeout: 256 seconds]
so has joined #ocaml
javamonn has joined #ocaml
Khady_ has joined #ocaml
AdmWiggin has joined #ocaml
sigjuice has quit [Ping timeout: 256 seconds]
Khady has quit [Ping timeout: 256 seconds]
tianon has quit [Ping timeout: 256 seconds]
sigjuice_ has joined #ocaml
AdmWiggin has quit [Changing host]
AdmWiggin has joined #ocaml
tobiasBora has quit [Ping timeout: 256 seconds]
darnuria has joined #ocaml
tobiasBora has joined #ocaml
ljs has quit [Quit: Be back later ...]
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kakadu_ has joined #ocaml
Anarchos has joined #ocaml
BitPuffin|osx has joined #ocaml
jonludlam has joined #ocaml
nullcat has joined #ocaml
nullcat has quit [Ping timeout: 244 seconds]
nullcat_ has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
mengu has joined #ocaml
javamonn has quit [Remote host closed the connection]
<bernardofpc>
[20:08:41] < adrien_zn> or gdb -> already done that, but will redo
javamonn has joined #ocaml
AdmWiggin is now known as tianon
kushal has quit [Quit: Leaving]
Gama11 has joined #ocaml
Gama11_ has quit [Ping timeout: 250 seconds]
osa1_ has joined #ocaml
ncthom91 has joined #ocaml
javamonn_ has joined #ocaml
javamonn has quit [Read error: Connection reset by peer]
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bjorkintosh has quit [Quit: Leaving]
small-wolf has quit [Ping timeout: 255 seconds]
redpoppies has joined #ocaml
<haesbaert>
what is the most sane approach to having something like a finally ?
<haesbaert>
using yminsky's protect function ?
<haesbaert>
I guess this is a common pattern, I just need to close a file descriptor in case some exception fires up.
bjorkintosh has joined #ocaml
<nojb>
with 4.02+: let finally f g = match f () with x -> g (); x | exception e -> g (); raise e
<haesbaert>
ahh awesome, I missed that
<haesbaert>
thanks a lot:D
javamonn_ has quit [Remote host closed the connection]
kdef has joined #ocaml
<haesbaert>
nojb: ah wait, you mean I have to define that ?
<haesbaert>
I thought it was included in ocaml 4.02.1
<nojb>
no you have to define it :)
<haesbaert>
*4.02+
<haesbaert>
ah ok, what is the feature that depends on 4.02+ on that code ?
<haesbaert>
ahhh the exception matching
<nojb>
yes
<haesbaert>
awesomo
<haesbaert>
btw, what is the normal approach to include this in a project, you having a "util" Module
<haesbaert>
?
<nojb>
If you use in more than one place, sure, why not ? :)
<haesbaert>
ack, that's the idea, ok
<Drup>
haesbaert: if you use Lwt; there is finally function
pyon has quit [Ping timeout: 272 seconds]
<pippijn>
Drup: function?
<Drup>
Lwt.finalize, yes
<pippijn>
ah
<pippijn>
yes
<haesbaert>
ah indeed, I can use that
<pippijn>
there is also a finally keyword
<pippijn>
and a finally ppx thing
<Drup>
yes, that's for try with
<Drup>
and yes :p
<Drup>
I was going to mention that next :D
<haesbaert>
ah but Lwt.finalize is for Lwt thingies
<Drup>
well, yes, that's what I said.
Gama11 has quit [Ping timeout: 272 seconds]
<haesbaert>
I mean, it could be the case Lwt included a generic finalize function :P
<Drup>
nojb: why do you need the exception matching for this ? It looks implementable with regular try with
<haesbaert>
would be awkward though
Gama11 has joined #ocaml
<nojb>
Drup: then you have to be careful not to catch exceptions raised by g () ...
small-wolf has joined #ocaml
<Drup>
yes
Anarchos has quit [Ping timeout: 256 seconds]
<nojb>
you can do without exception matching but you need to allocate a little : let finally f g = match try `Ok (f ()) with e -> `Fail e with `Ok x -> g (); x | `Fail e -> g (); raise e
Anarchos has joined #ocaml
javamonn_ has joined #ocaml
<haesbaert>
funny I can't define "finally" any other name is ok, the preprocessor screams: http://codepad.org/ySk8Qqrl
<nojb>
it is because lwt.syntax defines a "finally" syntax