adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.07.1 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.07/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml | Due to ongoing spam, you must register your nickname to talk on the channel
mfp has quit [Ping timeout: 240 seconds]
loli has quit [Ping timeout: 250 seconds]
ziyourenxiang has joined #ocaml
loli has joined #ocaml
keep_learning_M has joined #ocaml
ocabot has quit [Ping timeout: 250 seconds]
companion_cube has quit [Ping timeout: 245 seconds]
dedgrant has joined #ocaml
loli has quit [Ping timeout: 246 seconds]
silver has quit [Read error: Connection reset by peer]
loli has joined #ocaml
jbrown has quit [Remote host closed the connection]
iovec has joined #ocaml
loli has quit [Ping timeout: 246 seconds]
loli has joined #ocaml
gravicappa has joined #ocaml
ggole has joined #ocaml
jao has quit [Ping timeout: 246 seconds]
tormen_ has joined #ocaml
amcorvi has quit [Ping timeout: 258 seconds]
tormen has quit [Ping timeout: 258 seconds]
marvin2 has quit [Ping timeout: 258 seconds]
loli has quit [Ping timeout: 245 seconds]
loli has joined #ocaml
govg has quit [Ping timeout: 246 seconds]
JimmyRcom has quit [Ping timeout: 250 seconds]
loli has quit [Ping timeout: 268 seconds]
Birdface has quit [Remote host closed the connection]
Birdface has joined #ocaml
loli has joined #ocaml
hsrt^ has quit []
ocabot has joined #ocaml
companion_cube has joined #ocaml
zmt01 has joined #ocaml
zmt00 has quit [Ping timeout: 250 seconds]
loli has quit [Ping timeout: 268 seconds]
loli has joined #ocaml
ziyourenxiang has quit [Ping timeout: 246 seconds]
dmiles has quit [Read error: Connection reset by peer]
sagotch has joined #ocaml
Jesin has quit [Ping timeout: 257 seconds]
Jesin has joined #ocaml
erwanou_ has quit [Ping timeout: 244 seconds]
err0ne has quit [Ping timeout: 244 seconds]
dmiles has joined #ocaml
erwanou has joined #ocaml
err0ne has joined #ocaml
Serpent7776 has joined #ocaml
loli has quit [Ping timeout: 246 seconds]
sagotch has quit [Quit: Leaving.]
mfp has joined #ocaml
loli has joined #ocaml
bartholin has joined #ocaml
flodin has quit [Remote host closed the connection]
ollehar_ has joined #ocaml
ollehar has joined #ocaml
freyr69 has joined #ocaml
dhil has joined #ocaml
ygrek has joined #ocaml
loli has quit [Ping timeout: 244 seconds]
Haudegen has joined #ocaml
kakadu has joined #ocaml
marvin2 has joined #ocaml
<freyr69> Is CAMLreturn0 returning unit?
<freyr69> I have - : unit = <unknown constructor> in utop
<freyr69> Should I explicitly return unit?
<def`> |
<def`> CAMLreturn0 is for void functions.
<freyr69> Yes
<freyr69> and what's the signature?
<def`> void functions cannot be bound to external
<freyr69> Ah
<def`> an external should return a value
<def`> and use CAMLreturn(Val_unit);
<freyr69> Thanks
<freyr69> it works
<def`> CAMLprim value my_function_returning_unit(value x) { CAMLparam1(x); ... CAMLreturn(Val_unit); };
<def`> np :)
loli has joined #ocaml
<freyr69> Should I add all input vals to CAMLparam1?
<freyr69> I see CAMLparam0 in the examples
<def`> that's the safe approach.
<def`> Unless you know too much about OCaml internals, always pass every values to CAMLparamn
<def`> (If you have more than five, you can do CAMLparam5(a,b,c,d,e); CAMLxparam1(f);)
<freyr69> Even Unit?
<freyr69> ok
<def`> Strictly speaking it is not necessary for unit, but because of some implementation details you should not rely on.
<freyr69> def`: what about CAMLlocal, I shouldn't pass them in CAMLparam to, right. Locally allocated in CAMLlocal, arguments in CAMLparam, is that right?
<def`> That's right.
<def`> CAMLparam: register a root
<def`> CAMLlocal: declare a local and register it as a root
<def`> so, CAMLlocal already does the job.
<freyr69> so I could skip CAMLparam?
<def`> No
<freyr69> I see, I need both
<def`> You cannot use CAMLlocal if there is no CAMLparam in scope.
<def`> If you have no params but need locals, use CAMLparam0; CAMLlocal(...);
<freyr69> yes, I need CAMLparam0
gareppa has joined #ocaml
<freyr69> I see, now it's more or less clear
<def`> freyr69: I have to update the paper but https://arxiv.org/abs/1812.04905 might help
<def`> You might be interested in section 2.3 "Memory management macros"
<freyr69> Thanks
<freyr69> Hope one day there will be a high level Ctypes-like ffi in ocaml
asymptotically has joined #ocaml
gareppa has quit [Remote host closed the connection]
<freyr69> Am I right that there is other way to return result or option type but to guess the value representation (so no polymorphic variants from ffi)?
<def`> You can do polymorphic variants in FFI but that's tricky
<adrien> I just did a typo in my code and stumbled upon something which use I'm not sure of
<adrien> # ignore .bunny;;
<adrien> Error: Unbound record field bunny
<adrien> any knows if that's supposed to do anything meaningful?
<ggole> adrien: that's parsed as ignore.bunny, which will complain about a missing field no matter what the identifier on the left is
<ggole> (Well, as long as the lhs type checks itself).
<adrien> ahhhhh, right
<adrien> I remember seeing that years ago now :)
<adrien> thanks :)
jbrown has joined #ocaml
loli has quit [Ping timeout: 245 seconds]
mariusmkk has joined #ocaml
loli has joined #ocaml
q9929t has joined #ocaml
flodin has joined #ocaml
ygrek has quit [Ping timeout: 268 seconds]
q9929t has quit [Quit: q9929t]
jao has joined #ocaml
dhil has quit [Ping timeout: 259 seconds]
loli has quit [Ping timeout: 258 seconds]
dhil has joined #ocaml
ansiwen has quit [Quit: ZNC 1.7.1 - https://znc.in]
ansiwen has joined #ocaml
tormen has joined #ocaml
loli has joined #ocaml
tormen_ has quit [Ping timeout: 258 seconds]
Haudegen has quit [Read error: Connection reset by peer]
tormen has quit [Ping timeout: 250 seconds]
tormen_ has joined #ocaml
silenc3r has joined #ocaml
jim7j1ajh has joined #ocaml
dhil has quit [Ping timeout: 258 seconds]
gravicappa has quit [Ping timeout: 245 seconds]
jimt has quit [Ping timeout: 268 seconds]
Birdface has quit [Ping timeout: 250 seconds]
jim7j1ajh has quit [Ping timeout: 250 seconds]
jimt has joined #ocaml
mariusmkk has quit [Read error: Connection reset by peer]
mariusmkk has joined #ocaml
ziyourenxiang has joined #ocaml
FreeBirdLjj has joined #ocaml
ygrek has joined #ocaml
silver has joined #ocaml
Haudegen has joined #ocaml
loli has quit [Ping timeout: 272 seconds]
Birdface has joined #ocaml
spew has joined #ocaml
loli has joined #ocaml
demonimin has quit [Ping timeout: 246 seconds]
dhil has joined #ocaml
demonimin has joined #ocaml
demonimin has quit [Changing host]
demonimin has joined #ocaml
mariusmkk has quit [Ping timeout: 244 seconds]
aciniglio has joined #ocaml
mariusmkk has joined #ocaml
freyr69 has quit [Remote host closed the connection]
demonimin has quit [Ping timeout: 246 seconds]
sgnb has joined #ocaml
<sgnb> the certificate on mirage.io expired... yesterday
philtor has quit [Remote host closed the connection]
JimmyRcom has joined #ocaml
status402 has joined #ocaml
loli has quit [Ping timeout: 272 seconds]
status402 has quit [Quit: status402]
mildtaste has quit [Remote host closed the connection]
loli has joined #ocaml
<Leonidas> sgnb: yes, the workflow is to notify @avsm on Twitter and he renews it
amcorvi has joined #ocaml
nikivi has quit [Quit: ZNC is awesome]
nikivi has joined #ocaml
<def`> :D
ziyourenxiang has quit [Ping timeout: 245 seconds]
<sgnb> I don't have Twitter
<spew> sgnb: if you don't have social media you don't exist
<silver> 😧
mariusmkk has quit [Quit: mariusmkk]
loli has quit [Ping timeout: 246 seconds]
<cemerick> hopefully Leonidas wasn't kidding :-P
loli has joined #ocaml
ygrek has quit [Ping timeout: 258 seconds]
Birdface has quit [Ping timeout: 250 seconds]
Haudegen has quit [Remote host closed the connection]
Birdface has joined #ocaml
bugabinga has joined #ocaml
SrPx has quit [Ping timeout: 252 seconds]
SrPx has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
loli has quit [Ping timeout: 250 seconds]
ollehar has quit [Ping timeout: 250 seconds]
ollehar_ has quit [Ping timeout: 246 seconds]
loli has joined #ocaml
dhil has quit [Ping timeout: 246 seconds]
Haudegen has joined #ocaml
q9929t has joined #ocaml
Jesin has quit [Quit: Leaving]
q9929t has quit [Quit: q9929t]
ggole has quit [Quit: Leaving]
zmt01 is now known as zmt00
loli has quit [Ping timeout: 250 seconds]
dhil has joined #ocaml
Birdface has quit [Remote host closed the connection]
Birdface has joined #ocaml
loli has joined #ocaml
jnavila has joined #ocaml
Jesin has joined #ocaml
ravenousmoose has joined #ocaml
kakadu_ has joined #ocaml
<_y> just wondering: has anyone got actual real-life use for polymorphic variants, at the expression level?
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
jnavila has quit [Ping timeout: 246 seconds]
<octachron> _y, I have bindings that convert C return codes to polymorphic variants. Does this count?
kjak has quit [Ping timeout: 245 seconds]
richi238 is now known as richi235
dedgrant has quit [Read error: Connection reset by peer]
<Armael> They're convenient for interoperability between libraries
<Armael> See eg yojson
lobo has quit [Quit: WeeChat 1.6]
lobo has joined #ocaml
GreyFaceNoSpace has joined #ocaml
jbrown has quit [Ping timeout: 258 seconds]
dhil has quit [Ping timeout: 272 seconds]
loli has quit [Ping timeout: 244 seconds]
johnelse has quit [Read error: Connection reset by peer]
johnelse has joined #ocaml
loli has joined #ocaml
dhil has joined #ocaml
jbrown has joined #ocaml
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
ravenousmoose has quit [Quit: Taking a quick nap...ZZzzz]
johnelse has quit [Read error: No route to host]
johnelse has joined #ocaml
kjak has joined #ocaml
kjak_ has joined #ocaml
jnavila has joined #ocaml
dhil has quit [Ping timeout: 250 seconds]
loli has quit [Ping timeout: 244 seconds]
silenc3r has quit [Remote host closed the connection]
loli has joined #ocaml
spew has quit [Quit: going home]
<companion_cube> pff, why am I listening to Drup
<companion_cube> renaming Sequence to Iter triggers ∞-many deprecation warnings -_-
Birdface has quit [Ping timeout: 250 seconds]
kjak_ has left #ocaml [#ocaml]
FreeBirdLjj has quit [Remote host closed the connection]
<_y> (this dates back to 2003)
<_y> (with ocaml 3.06)
MK__ has joined #ocaml
<MK__> utop doesn't show me the function List.map2_exn (only shows map2). My OCaml version is 4.07. Do i need to open a specific library?
Serpent7776 has quit [Quit: leaving]
<companion_cube> if you're reading `real world ocaml`, you need to install and `open Core` (or Core.Std, I'm not sure)
jnavila has quit [Remote host closed the connection]
<MK__> What is the default List library that utop reads from if Core is not opened?
<companion_cube> the standard one
<companion_cube> !stdlib_manual
loli has quit [Ping timeout: 250 seconds]
<companion_cube> ah, damn
Haudegen has quit [Remote host closed the connection]
<MK__> So, we have some standard libraries, and then we can use some extended ones in the Core (open Core changes the scope if I'm not wrong). Is that correct?
averell has quit [Quit: .]
<MK__> scope -> namespace
<companion_cube> something like that
<companion_cube> JaneStreet reimplemented their own standard library (named Core) and it's their habit to `open Core` to shadow existing stuff with their alternatives
kakadu_ has quit [Remote host closed the connection]
<MK__> I can see List.map2_exn in both Basic and Core libraries. Are they different implementations?
<MK__> Base
<companion_cube> Base is the trimmed down version of Core
<MK__> What is the main difference?
averell has joined #ocaml
loli has joined #ocaml
<companion_cube> it's less big :D
<companion_cube> (core is r eally big)
Guest20349 has joined #ocaml
Guest20349 has quit [Remote host closed the connection]
Haudegen has joined #ocaml
bartholin has quit [Remote host closed the connection]
<MK__> :D
asymptotically has quit [Quit: Leaving]
MK__ has quit [Ping timeout: 256 seconds]
Haudegen has quit [Read error: Connection reset by peer]