<an-tuan>
could you please explain why the code containing the modification of the array is not executed
<an-tuan>
does this mean it is not safe to use mutables things
<pierpa>
please specify what do you expect to happen with that code.
<an-tuan>
i expect the list to be different
<an-tuan>
but the list is not different, as the assertion fails
<an-tuan>
whereas the code "operationOnArray" is supposed to switch the two first values
<an-tuan>
(obviously this is a shorten version of some code)
<pierpa>
hmmm
<an-tuan>
as a shorter code : === keepSecondOne (print_string "yo") true === does not print anything (which is ~~okay~~ for printing but not really for arrays)
FreeBirdLjj has quit [Remote host closed the connection]
Algebr has quit [Ping timeout: 276 seconds]
<an-tuan>
um no
<an-tuan>
it does print
<pierpa>
spotted the bug
FreeBirdLjj has joined #ocaml
<pierpa>
you are depending on the order of evaluation being right to left
<pierpa>
when in fact it is unspecified
<pierpa>
and in practice, it is (almost?) always eft to right
<pierpa>
*right to left
<an-tuan>
mmm
<pierpa>
uff. *You depend on the order being left to right
<an-tuan>
thanks you
<an-tuan>
funny situation
<pierpa>
so the operation on the array is performed AFTER it is converted back to list
<pierpa>
that's what you get when you mix mutation in random places :)
<an-tuan>
so i guess as a good practice, always return the mutable things, and always act on this resulted thing
<pierpa>
hmmm
<an-tuan>
something like === toList (operationOnarr myList) ===
<an-tuan>
something like === toList (operationOnarr myArr) ===
<pierpa>
I prefer to not compose side effecting operations
<an-tuan>
and not === someFunction (operationOnArr myArr) (toList myArr) ===
orbifx1 has quit [Ping timeout: 255 seconds]
bartholin has quit [Ping timeout: 256 seconds]
<an-tuan>
yes of course it would be even easier x)
<pierpa>
and, of course use them sparingly, only when absolutely necessary, etc etc... :)
<an-tuan>
after this, i would indeed be very careful
<an-tuan>
thanks you for finding it
<pierpa>
you're welcome. I know how frustrating these kind of things are. I've been there more than once :)
silver has quit [Read error: Connection reset by peer]
<an-tuan>
this code shows what you said === (fun a b -> true) (print_string "hey") (print_string "yo") ===
<pierpa>
yes
* reynir
is having javascript flashbacks
<an-tuan>
but you cannot guarantee it will be like this, it is compiler dependant ?
<pierpa>
yes, exact
<reynir>
an-tuan: Yes, IIRC the native compiler and the bytecode compiler differ
<pierpa>
perhaps the new optimizing compiler will rearrange the order sometimes? I don't know.
<Drup>
the evaluation order for function argument is explicitely left undefined,
<pierpa>
Hey Drup! we had already mentioned this
<an-tuan>
nice lesson
Orbifx has left #ocaml [#ocaml]
Orbifx has joined #ocaml
Orbifx has left #ocaml [#ocaml]
Orbifx has joined #ocaml
bartholin has joined #ocaml
Haudegen has joined #ocaml
Orbifx has left #ocaml [#ocaml]
FreeBirdLjj has quit [Remote host closed the connection]
bartholin has quit [Ping timeout: 256 seconds]
bartholin has joined #ocaml
zarul has quit [Ping timeout: 256 seconds]
spew has joined #ocaml
wxyzzyrd has joined #ocaml
zarul has joined #ocaml
wxyzzyrd has quit [Ping timeout: 265 seconds]
ahf has quit [Quit: Bye.]
jlouis has quit [Remote host closed the connection]
jao has quit [Ping timeout: 268 seconds]
zarul has quit [Ping timeout: 256 seconds]
ahf has joined #ocaml
gpietro has quit [Read error: Connection reset by peer]
sh0t has joined #ocaml
mosfetter has quit [Quit: Connection closed for inactivity]
maattdd_ has joined #ocaml
maattdd_ has quit [Ping timeout: 256 seconds]
zarul has joined #ocaml
zarul has quit [Ping timeout: 256 seconds]
pierpa has quit [Quit: Page closed]
jimmyrcom has quit [Ping timeout: 255 seconds]
ygrek has quit [Ping timeout: 256 seconds]
zarul has joined #ocaml
<simpson>
Hi! Is js of ocaml still the way to do Web browser things?
zarul has quit [Ping timeout: 260 seconds]
an-tuan has quit [Quit: WeeChat 2.0.1]
mbuf has joined #ocaml
spew has quit [Read error: Connection reset by peer]
spew has joined #ocaml
nicoo has quit [Ping timeout: 255 seconds]
nicoo has joined #ocaml
jimmyrcom has joined #ocaml
zarul has joined #ocaml
zarul has quit [Ping timeout: 256 seconds]
kerrhau has quit [Ping timeout: 256 seconds]
MercurialAlchemi has joined #ocaml
zarul has joined #ocaml
spew has quit [Quit: Leaving]
mk9 has joined #ocaml
jbrown has quit [Ping timeout: 276 seconds]
KeyJoo has joined #ocaml
mk9 has quit [Ping timeout: 248 seconds]
zarul has quit [Ping timeout: 256 seconds]
Orbifx has joined #ocaml
whoman has quit [Quit: Leaving]
Orbifx has left #ocaml [#ocaml]
Orbifx has joined #ocaml
orbifx1 has joined #ocaml
mengu has joined #ocaml
mengu has quit [Remote host closed the connection]
cbot_ has quit [Quit: Leaving]
zarul has joined #ocaml
zarul has quit [Ping timeout: 264 seconds]
orbifx1 has quit [Ping timeout: 260 seconds]
Orbifx has left #ocaml [#ocaml]
Orbifx has joined #ocaml
Orbifx has left #ocaml [#ocaml]
Orbifx has joined #ocaml
Orbifx has left #ocaml [#ocaml]
Orbifx has joined #ocaml
cuicui has joined #ocaml
cuicui has quit [Client Quit]
cuicui has joined #ocaml
_whitelogger_ has joined #ocaml
_whitelogger has quit [Ping timeout: 276 seconds]
zolk3ri has joined #ocaml
argent_smith has joined #ocaml
srenatus has joined #ocaml
yetanotherion[m] has joined #ocaml
Bluddy[m] has joined #ocaml
mfp has joined #ocaml
zpe has joined #ocaml
mk9 has joined #ocaml
mk9 has quit [Client Quit]
simpson has quit [Ping timeout: 246 seconds]
simpson has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
zarul has joined #ocaml
zarul has quit [Ping timeout: 264 seconds]
andreas_ has joined #ocaml
<jpdeplaix>
simpson: yes but it depends what you want to do, I would say. Bucklescript/ReasonML is active as well
Orbifx has left #ocaml [#ocaml]
Orbifx has joined #ocaml
mbuf has quit [Remote host closed the connection]
mbuf has joined #ocaml
Serpent7776 has joined #ocaml
zarul has joined #ocaml
zarul has quit [Ping timeout: 276 seconds]
johnelse_ is now known as johnel_away
johnel_away is now known as johnelse_
johnelse_ has quit [Quit: leaving]
cuicui has quit [Read error: Connection reset by peer]
mk9 has joined #ocaml
cuicui has joined #ocaml
baboum has joined #ocaml
<simpson>
Oh, interesting, thanks.
mk9 has quit [Client Quit]
johnelse has joined #ocaml
dhil has joined #ocaml
mk9 has joined #ocaml
kakadu has joined #ocaml
baboum has quit [Quit: WeeChat 2.0.1]
johnelse is now known as johnel_away
johnel_away is now known as johnelse
zarul has joined #ocaml
zarul has quit [Ping timeout: 264 seconds]
silver has joined #ocaml
KeyJoo has quit [Ping timeout: 256 seconds]
Orbifx has left #ocaml [#ocaml]
Orbifx has joined #ocaml
kerrhau has joined #ocaml
kerrhau has quit [Ping timeout: 240 seconds]
nylar has joined #ocaml
mk9 has quit [Quit: mk9]
zarul has joined #ocaml
jimmyrcom has quit [Ping timeout: 240 seconds]
cuicui has quit [Read error: Connection reset by peer]
<infinity0>
anyone know of a library to do operations on polynomials
cuicui has joined #ocaml
zarul has quit [Ping timeout: 260 seconds]
maattdd has quit [Quit: WeeChat 2.0.1]
dhil has quit [Ping timeout: 264 seconds]
maattdd has joined #ocaml
dhil has joined #ocaml
maattdd has quit [Client Quit]
maattdd has joined #ocaml
maattdd has quit [Client Quit]
mk9 has joined #ocaml
maattdd has joined #ocaml
maattdd has quit [Client Quit]
maattdd has joined #ocaml
zarul has joined #ocaml
Serpent has joined #ocaml
nylar_ has joined #ocaml
maattdd has quit [Client Quit]
maattdd has joined #ocaml
maattdd has quit [Client Quit]
KeyJoo has joined #ocaml
maattdd has joined #ocaml
okeuday_bak has quit [Ping timeout: 248 seconds]
maattdd has quit [Client Quit]
MercurialAlchemi has quit [Ping timeout: 248 seconds]
xaimus has quit [Ping timeout: 248 seconds]
sigjuice has quit [Ping timeout: 248 seconds]
MercurialAlchemi has joined #ocaml
mk9 has quit [Ping timeout: 264 seconds]
xaimus has joined #ocaml
Serpent7776 has quit [Ping timeout: 248 seconds]
nylar has quit [Ping timeout: 248 seconds]
maattdd has joined #ocaml
okeuday_bak has joined #ocaml
sigjuice has joined #ocaml
maattdd has quit [Quit: WeeChat 2.0.1]
maattdd has joined #ocaml
Serpent is now known as Serpent7776
mbuf has quit [Quit: Leaving]
maattdd has quit [Quit: WeeChat 2.0.1]
dhil has quit [Ping timeout: 268 seconds]
Haudegen has quit [Remote host closed the connection]
nylar_ has quit [Quit: leaving]
sepp2k has joined #ocaml
shinnya has joined #ocaml
zv has quit [Ping timeout: 248 seconds]
zpe_ has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
sonologico has quit [Quit: WeeChat 1.9.1]
Orbifx has left #ocaml [#ocaml]
Orbifx has joined #ocaml
jbrown has joined #ocaml
Haudegen has joined #ocaml
Orbifx has left #ocaml [#ocaml]
Orbifx has joined #ocaml
Orbifx has left #ocaml [#ocaml]
Orbifx has joined #ocaml
Orbifx has joined #ocaml
Orbifx has left #ocaml [#ocaml]
Jesin has quit [Quit: Leaving]
zarul has quit [Ping timeout: 240 seconds]
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
troydm has joined #ocaml
<companion_cube>
not particularly
<companion_cube>
but if you write one, I'm interested
dhil has joined #ocaml
baboum has joined #ocaml
<orbifx[m]>
infinity0: not sure if it has the operations you are after, but it's the closest I've heard: https://github.com/ryanrhymes/owl
<companion_cube>
probably not at all the same thing