<hannes>
I have a strange racy behaviour, and changing "let xs = ref [] .. xs := <expr> :: !xs" to "let e' = expr in xs := e' :: !xs" changes the behaviour, can this be the case?
<dckc>
daharon, I think I've seen ppx thingies analagous to dervive(Debug). sexpr or something.
<hannes>
well, actually my next step would be to try to get the intermediate language of the module and spot the differences.. any advice I can tell "dune" somehow to output lambda in addition to cmti/.. and object files?
serge_ has joined #ocaml
gendarme has quit [Quit: Leaving]
serge_ has quit [Ping timeout: 240 seconds]
landonf has quit [Excess Flood]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
landonf has joined #ocaml
NSA_Spy has joined #ocaml
jao has quit [Remote host closed the connection]
NSA_Spy has quit [Ping timeout: 240 seconds]
NSA_Spy has joined #ocaml
abc_ has quit [Quit: reboot or OOMed]
abc_ has joined #ocaml
NSA_Spy has quit [Remote host closed the connection]
NSA_Spy has joined #ocaml
olle has quit [Ping timeout: 268 seconds]
olle has joined #ocaml
serge_ has joined #ocaml
serge_ has quit [Ping timeout: 260 seconds]
chindy_ has quit [Ping timeout: 265 seconds]
chindy has joined #ocaml
NSA_Spy has quit [Read error: Connection reset by peer]
NSA_Spy has joined #ocaml
NSA_Spy has quit [Remote host closed the connection]
NSA_Spy has joined #ocaml
nullifidian_ has joined #ocaml
nullifidian has quit [Read error: Connection reset by peer]
zekt8337 has quit [Quit: Ping timeout (120 seconds)]
zekt8337 has joined #ocaml
NSA_Spy has quit [Remote host closed the connection]
NSA_Spy has joined #ocaml
mbuf has joined #ocaml
NSA_Spy has quit [Ping timeout: 268 seconds]
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 268 seconds]
mfp has quit [Ping timeout: 240 seconds]
serge has joined #ocaml
serge has quit [Ping timeout: 272 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 272 seconds]
malina has quit [Remote host closed the connection]
wingsorc has quit [Ping timeout: 240 seconds]
gravicappa has joined #ocaml
nullifidian_ has quit [Read error: Connection reset by peer]
nullifidian_ has joined #ocaml
mahmudov has quit [Ping timeout: 268 seconds]
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #ocaml
zekt8337 has quit [Quit: Ping timeout (120 seconds)]
serge has joined #ocaml
serge has quit [Ping timeout: 240 seconds]
kleisli has quit [Ping timeout: 265 seconds]
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
vicfred has quit [Remote host closed the connection]
vicfred has joined #ocaml
Serpent7776 has joined #ocaml
pierpal has quit [Ping timeout: 265 seconds]
pierpal has joined #ocaml
serge has joined #ocaml
serge has quit [Ping timeout: 272 seconds]
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
Haudegen has joined #ocaml
rwmjones|hols is now known as rwmjones
pierpal has quit [Ping timeout: 268 seconds]
ggole has joined #ocaml
dborisog has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
ollehar_ has joined #ocaml
malina has joined #ocaml
serge has joined #ocaml
serge has quit [Ping timeout: 272 seconds]
mbuf has quit [Quit: Leaving]
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
<nicolaus>
Hi, I want to ask user for input until they give a valid response
<nicolaus>
I want to do it as a loop but there are no breaks in ocaml
<Armael>
you can write a recursive function instead
<hannes>
..or you can use a while loop which tests for the value of a mutable cell..
pierpal has joined #ocaml
mfp has joined #ocaml
<hannes>
(i.e. let achieved = ref false in while not !achieved do read_line () ; process_input (achieved := true) ; done
<Armael>
meh :)
<hannes>
number of times I wrote a while loop in OCaml now increased to twice ;)
nullifidian__ has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
nullifidian_ has quit [Read error: Connection reset by peer]
<nicolaus>
thanks Armael and hannes
pierpal has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 272 seconds]
kakadu has joined #ocaml
pierpal has joined #ocaml
pierpal has quit [Remote host closed the connection]
kakadu_ has joined #ocaml
kakadu has quit [Read error: Connection reset by peer]
<Leonidas>
how can anyone remember the syntax of while loops in ocaml anyway
* Leonidas
just had to look up whether ocaml has for loops
jao has quit [Ping timeout: 265 seconds]
<kakadu_>
AFAIR OCaml has for loop but not while loops
kakadu_ is now known as kakadu
serge has joined #ocaml
nullcone has quit [Quit: Connection closed for inactivity]
serge has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
malina has quit [Ping timeout: 240 seconds]
malina has joined #ocaml
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
<leah2>
Leonidas: why, they just work like in bash :P
malina has quit [Ping timeout: 260 seconds]
<Leonidas>
I like how people here don't really know the imparative constructs at all :D
<leah2>
i find two uses of while in my (admittedly small) ocaml code base
FreeBirdLjj has quit [Remote host closed the connection]
<leah2>
one is a repl with "while true", and the other one is an imperative algorithm
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
<Leonidas>
solid, I was debugging a segfault and the reason was because I was writing in the second slot of a block of size one. Someone take the C compiler away from me
nullifidian__ has quit [Read error: Connection reset by peer]
nullifidian has joined #ocaml
prsafont[m] has quit [Quit: authenticating]
prsafont[m] has joined #ocaml
sarna has quit [Quit: bye]
sarna has joined #ocaml
kleisli has joined #ocaml
<Leonidas>
octachron: I was reading the ocaml manual and it doesn't state how optional arguments are represented in the C API, should I create a ticket?
<octachron>
You can :) . The answer is that labels are erased after typechecking
<Armael>
in what order do they appear, then?
<Leonidas>
octachron: ah, right and since default arguments are of option type then you just handle it as a block
<Leonidas>
Armael: yes, in the order of the signature. That's what I found out the hard way last week :)
<Armael>
ah, that makes sense
FreeBirdLjj has joined #ocaml
serge has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
serge has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
olle has quit [Ping timeout: 268 seconds]
olle has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
Serpent7776 has quit [Quit: Leaving]
olle has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
olle has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
cousteau has joined #ocaml
<cousteau>
Hi! I have a rather ancient Ubuntu and OCaml from repos is 4.02. What is the recommended way to install a newer one? Is there a PPA?
<cousteau>
I just followed instructions and used opam init --comp 4.05.0, but that seems like a complicated and hard to repeat solution; I'd prefer a PPA or similar if possible. Or a system-wide install.
<cousteau>
also, how do I undo everything ˋopam initˋ did? Just delete my .opam/?
<octachron>
Deleting the .opam should do the trick indeed
<cousteau>
thanks!
<octachron>
If you intend to develop with OCaml, using opam is the best path (I am not sure why the ubuntu PPA only support 18.04 and later)
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
kleisli has quit [Ping timeout: 272 seconds]
<vsiles>
cousteau: you might want to have a look at your .bashrc/.bash_profile/.vimrc/.emacs in case opam init added some stuff there
sarna has left #ocaml [#ocaml]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
ygrek__ has joined #ocaml
<cousteau>
vsiles: opam init asked me if it should modify .profile and something else (default:N) and I answered that N, so it probably did N modify them
<vsiles>
good
<cousteau>
but thanks for the heads up :D
jao has quit [Ping timeout: 272 seconds]
<cousteau>
ok I just found that the program I wanted to compile was already in Ubuntu repositories so I'll install that version instead (even if it's a bit old)
decentpenguin has joined #ocaml
kleisli has joined #ocaml
serge has joined #ocaml
serge has quit [Ping timeout: 265 seconds]
ygrek__ has quit [Ping timeout: 240 seconds]
nullifidian_ has joined #ocaml
nullifidian has quit [Ping timeout: 272 seconds]
ggole has quit [Quit: Leaving]
cousteau has quit [Read error: Connection reset by peer]
cousteau has joined #ocaml
cousteau has quit [Changing host]
cousteau has joined #ocaml
Haudegen has joined #ocaml
TheLemonMan has joined #ocaml
ocaml459 has joined #ocaml
ocaml459 has quit [Client Quit]
Serpent7776 has joined #ocaml
smazga has joined #ocaml
madroach has joined #ocaml
serge has joined #ocaml
serge has quit [Ping timeout: 260 seconds]
zolk3ri has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
ollehar_ has quit [Ping timeout: 265 seconds]
serge has joined #ocaml
serge_ has joined #ocaml
cousteau has quit [Ping timeout: 268 seconds]
serge has quit [Ping timeout: 268 seconds]
Haudegen has quit [Quit: Bin weg.]
cousteau has joined #ocaml
cousteau has quit [Changing host]
cousteau has joined #ocaml
serge has joined #ocaml
serge_ has quit [Ping timeout: 272 seconds]
oni-on-ion has quit [Read error: Connection reset by peer]
serge has quit [Ping timeout: 265 seconds]
serge has joined #ocaml
serge has quit [Read error: Connection reset by peer]
serge_ has joined #ocaml
amiloradovsky has joined #ocaml
serge_ has quit [Ping timeout: 265 seconds]
serge has joined #ocaml
serge has quit [Ping timeout: 240 seconds]
serge_ has joined #ocaml
serge has joined #ocaml
serge_ has quit [Read error: Connection reset by peer]
kleisli has quit [Ping timeout: 260 seconds]
serge has quit [Ping timeout: 272 seconds]
tmhoang has quit [Quit: Ping timeout (120 seconds)]
rwmjones_ has joined #ocaml
<hannes>
is there a way to run some code for initialization of a library at load time? I thought a 'Printf.printf "hello\n%!"' would be evaluated if a program depends on a library with such code, but I never see the printf..
aspiwack[m] has quit [Ping timeout: 246 seconds]
jimt[m] has quit [Ping timeout: 246 seconds]
serge has joined #ocaml
rwmjones has quit [Ping timeout: 265 seconds]
pablo[m] has quit [Ping timeout: 246 seconds]
bglm[m] has quit [Ping timeout: 246 seconds]
prsafont[m] has quit [Ping timeout: 252 seconds]
kleisli has joined #ocaml
<companion_cube>
it is, if you do link the module in
zapashcanon[m] has quit [Ping timeout: 240 seconds]
aecepoglu[m] has quit [Ping timeout: 248 seconds]
sepp2k has quit [Ping timeout: 256 seconds]
johnel has quit [Ping timeout: 265 seconds]
<hannes>
i define the printf in a module Foo, ocamlfind package my_lib.foo, and an executable my_program.exe, which depends on my_lib.foo doesn't see that code... hmmmm)
cgenie[m] has quit [Ping timeout: 240 seconds]
karan has quit [Ping timeout: 245 seconds]
flux has quit [Ping timeout: 245 seconds]
lnxw37d4 has quit [Ping timeout: 240 seconds]
zwindl[m] has quit [Ping timeout: 240 seconds]
dash has quit [Ping timeout: 240 seconds]
dl3br[m] has quit [Ping timeout: 260 seconds]
tiksin[m] has quit [Ping timeout: 248 seconds]
peddie has quit [Ping timeout: 260 seconds]
johnel has joined #ocaml
keep-learning[m] has quit [Ping timeout: 256 seconds]
bronsen has quit [Ping timeout: 240 seconds]
ocaml459 has joined #ocaml
<companion_cube>
`-linkall`?
tmhoang has joined #ocaml
ocaml459 has quit [Client Quit]
serge_ has joined #ocaml
serge has quit [Ping timeout: 272 seconds]
<hannes>
companion_cube: thanks
serge_ has quit [Read error: Connection reset by peer]
<companion_cube>
(I'd probably favor a more explicit approach though)
serge has joined #ocaml
<companion_cube>
or if it's initialization code, you can have `let init = let doit= lazy ( … ) in fun() -> Lazy.force doit`
<hannes>
yes, this looks like a recipe for disaster
<companion_cube>
and then call `init()` wherever
<companion_cube>
the lazy is there to ensure it's only once
serge_ has joined #ocaml
serge has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
jmiven has quit [Quit: riboute]
mahmudov has joined #ocaml
rwmjones_ is now known as rwmjones
serge_ has quit [Ping timeout: 265 seconds]
jmiven has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
serge has joined #ocaml
jimt[m] has joined #ocaml
aspiwack[m] has joined #ocaml
FreeBirdLjj has joined #ocaml
zwindl[m] has joined #ocaml
aecepoglu[m] has joined #ocaml
serge_ has joined #ocaml
bglm[m] has joined #ocaml
serge has quit [Ping timeout: 260 seconds]
sepp2k has joined #ocaml
serge_ has quit [Ping timeout: 265 seconds]
pablo[m] has joined #ocaml
lnxw37d4 has joined #ocaml
prsafont[m] has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 268 seconds]
zapashcanon[m] has joined #ocaml
<hannes>
thanks companion_cube again, I was really not aware of "-linkall" (and yes, in spite of this I agree an 'init ()' to-be-called by consumers is a better choice)
<companion_cube>
consumers, or parts of the lib that need to ensure initialization code has been called
dash has joined #ocaml
<hannes>
..the lazy makes sense if initialization is not idempotent (which in my case it is ;)
FreeBirdLjj has joined #ocaml
<companion_cube>
well still, perf-wise?
tiksin[m] has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 272 seconds]
cgenie[m] has joined #ocaml
keep-learning[m] has joined #ocaml
FreeBirdLjj has joined #ocaml
flux has joined #ocaml
karan has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
dl3br[m] has joined #ocaml
serge has joined #ocaml
serge has quit [Ping timeout: 272 seconds]
FreeBirdLjj has joined #ocaml
ocaml459 has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
kleisli has quit [Ping timeout: 268 seconds]
ocaml459 has quit [Client Quit]
kleisli has joined #ocaml
FreeBirdLjj has joined #ocaml
ocaml459 has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 268 seconds]
nullcone has joined #ocaml
nullifidian has joined #ocaml
cousteau has quit [Quit: Bye]
nullifidian_ has quit [Read error: Connection reset by peer]