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
metreo has left #ocaml [#ocaml]
metreo has joined #ocaml
lyxia has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
<Leonidas> is fedora using some strange sed?
Haudegen has quit [Remote host closed the connection]
<try-again> I have no idea. I don't know how sed is supposed to work really... However, I did manage to fix the compilation error: I changed the sed pattern to "s/CAMLprim value \([a-z0-9_][a-z0-9_]*\)(.*/\1/p" to force a maximal match. Then it worked.
_whitelogger has joined #ocaml
try-again has quit [Ping timeout: 240 seconds]
try-again has joined #ocaml
prence has joined #ocaml
prence has quit [Remote host closed the connection]
try-again has quit [Ping timeout: 272 seconds]
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 244 seconds]
metreo has left #ocaml [#ocaml]
CMGauger9 has joined #ocaml
CMGauger9 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
caente has quit [Ping timeout: 250 seconds]
caente has joined #ocaml
nicoo has quit [Read error: Connection reset by peer]
nicoo has joined #ocaml
ggole has joined #ocaml
caente has quit [Ping timeout: 268 seconds]
jao has joined #ocaml
KXM has joined #ocaml
metreo has joined #ocaml
MadcapJake has quit [Quit: MadcapJake]
Armael has quit [Ping timeout: 260 seconds]
cods has quit [Ping timeout: 260 seconds]
Armael has joined #ocaml
cods has joined #ocaml
kakadu has joined #ocaml
pierpal has joined #ocaml
fraxamo has joined #ocaml
KXM has quit [Ping timeout: 256 seconds]
ShalokShalom has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
ShalokShalom has joined #ocaml
ShalokShalom has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
JimmyRcom has quit [Ping timeout: 252 seconds]
metreo has left #ocaml [#ocaml]
_whitelogger has joined #ocaml
jao has quit [Ping timeout: 252 seconds]
bartholin has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
orbifx has joined #ocaml
try-again has joined #ocaml
Ocaml_noob has joined #ocaml
jnavila has joined #ocaml
<Ocaml_noob> hi
<Ocaml_noob> is there an equivalent of module rec for module signatures?
<Ocaml_noob> I tried "module rec type", "module type rec" and google
<octachron> Ocaml_noob, no, but you can always wrap your module type inside a recursive module definition
<Ocaml_noob> octachron: i don't understand what you mean
<Ocaml_noob> Basically, I'm defining recursive modules, and I want to separate the types from the definitions
<octachron> If your primary intend is to split the module type definition from the rest of the recursive module definition, you can define more general module type and then use destructive substitution to specialize them during the recursive definition
<octachron> "module type a = sig type b type t = A of b end .... module A: a with type b := B.t = ... and module B: b with type a := A.t"
pyx has joined #ocaml
pyx has quit [Client Quit]
orbifx has quit [Read error: Connection reset by peer]
orbifx has joined #ocaml
jbrown has quit [Ping timeout: 252 seconds]
<try-again> I figured out what was the root of my build problems yesterday. I have this very weird behavior:
<try-again> $ echo "abcdefghijklmnopqrstuvwxyz" | sed -e "s/\([a-z][a-z]*\).*/\1/"
<try-again> abcdefghijklmnopqrstuv
<try-again> $ echo "abcdefghijklmnopqrstuvwxyz" | LC_ALL=C sed -e "s/\([a-z][a-z]*\).*/\1/"
<try-again> abcdefghijklmnopqrstuvwxyz
<try-again> $ echo "abcdefghijklmnopqrstuvwxyz" | sed -e "s/\([a-z][a-z]*\)/\1/"
<try-again> abcdefghijklmnopqrstuvwxyz
<try-again> Is the ocaml build relying on unspecified behavior of sed, or is this a bug in sed, or, what is wrong?
<flux[m]> with dune, am I supposed to directly use Foo__Bar modules names?
<octachron> flux[m], no
<flux[m]> so how do I get access to Bar properly?
<flux[m]> I just have a directory foo with foo.ml and bar.ml, and dune with (library (name foo) (public_name foo)
<try-again> I pasted more details here https://pastebin.com/H4wEeB9H . Maybe someone with the knowhow could post an issue somewhere!
<octachron> flux[m], if you have a foo.ml file in a foo library, dune assumes that you want to control the visible modules inside the library so you have to expose those modules by hand
<flux[m]> ok, so basically I use module Bar = Bar inside that module, or rename that module to something else. Thanks.
<octachron> try-again, it looks like "w" is not considered to be between a-z in the swedish locale.
<try-again> yes, but
<try-again> $ echo -e "a\nd\nc\nw\nz" | sort
<try-again> a
<try-again> c
<try-again> d
<try-again> w
<try-again> z
<try-again> Also, check my third example. If w was not in [a-z], then this example would not produce the full match (which it does)
<octachron> indeed
<try-again> Looks like it have something to do with the two competing stars.
<octachron> Note that I cannot reproduce the issue, even with LC_ALL=se_SV.UTF-8 sed ...
<try-again> Try
<try-again> echo "abcdefghijklmnopqrstuvwxyz" | LC_ALL=sv_SE.UTF-8 sed -e "s/\([a-z][a-z]*\).*/\1/"
<try-again> That is, swap se and sv
<octachron> try-again, ah right, it does stop at u
<try-again> Good to hear it not only me :)
<octachron> it sounds like a strange bug in sed
<Leonidas> odd, I tried to reproduce on macos with GNU sed, and it works just fine
<Leonidas> also with BSD sed
<Leonidas> though I am not sure setting the locale worked, because I assume it needs the locale data which I might not have
<try-again> Try setting the locale before the pipe, then maybe you get a error message. Like: LC_ALL=sv_SE.UTF-8 echo "abcdefghijklmnopqrstuvwxyz"
<try-again> $ sed --version
<try-again> sed (GNU sed) 4.5
<try-again> ...
<ggole> I generated the sv_SE.UTF-8 locale, but don't see the strange behaviour (eg, when using LC_ALL=sv_SE.UTF-8)
<ggole> sed (GNU sed) 4.2.2 here
<ggole> A sed bug does seem possible.
<octachron> version 4.5 here
<Leonidas> version 4.5 here too
tane has joined #ocaml
jao has joined #ocaml
<try-again> I tried a couple of other locales, and only the swedish one misbehaves
<Leonidas> https://travis-ci.org/Leonidas-from-XIV/orewa/jobs/450455885 anyone has an idea why I get connection refused here, although there is a redis server on that port (that I even check right before)
<ggole> Out of curiosity, what does echo "abcdefghijklmnopqrstuvwxyz" | sed -e "s/[a-z]/X/g" show?
<Leonidas> oh, it is probably due to sandboxing!
<octachron> Leonidas, to test if the locale works as expected , you can try 'echo -e "a\nå\nz" | LC_ALL=sv_SE.UTF-8 sort', in swedish locale å should be last
<Leonidas> octachron: yes, it is last
<ggole> Or you can run date, which prints differently.
<try-again> $ echo "abcdefghijklmnopqrstuvwxyz" | sed -e "s/[a-z]/X/g"
<try-again> XXXXXXXXXXXXXXXXXXXXXXwXXX
<Leonidas> maybe it is some libc dependent locale issue? I assume gnu sed on macos does not use glibc
<ggole> O_o
ewanas has joined #ocaml
ewanas has joined #ocaml
ewanas has quit [Changing host]
<Leonidas> try-again: that also works for me just fine, als in swedish locale
<octachron> even funnier, 'LC_ALL=sv_SE.UTF-8 sed -e "s/[a-w]/X/g"' fails with an error
<Leonidas> any idea how to run integration tests with opam? the sandbox prevents me from connecting to the service I want to integrate with
<ggole> Presumably because the w isn't considered the ascii w
<Leonidas> is it 'vv'? Danish had, AFAIR, until some time ago not considered 'w' its own letter
<Leonidas> 1980 turns out
<try-again> If w is not ascii w, why does echo "abcdefghijklmnopqrstuvwxyz" | sed -e "s/\([a-z][a-z]*\)/\1/" work? (it does work, it matches the whole string)
<Leonidas> which versions of glibc do you use?
<Leonidas> > This update introduces significant improvements to the
<Leonidas> > collation of Unicode characters
<Leonidas> > many locales have been updated
<ggole> try-again: that's a good question. If it is a bug, then there may be no consistent behaviour.
<try-again> How do I check glibc version?
<ggole> ldd --version, I think
<octachron> Im my case, it is indeed 2.28
<try-again> ldd (GNU libc) 2.28
<Leonidas> try-again: you can also ask dnf what version you have
<Leonidas> old and busted: ocaml community finds intel bugs. new hotness: ocaml community finds glibc bugs :D
<Leonidas> https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=159738548130d5ac4fe6178977e940ed5f8cfdc4 this commit changed quite a lot of stuff and there is some 'w' and 'W' mentioned
<Leonidas> (localedata/locales/sv_SE)
<try-again> $ dnf list glibc
<ggole> I wonder how much software that's gonna break.
<try-again> Installerade paket
<try-again> glibc.x86_64 2.28-9.fc29 @anaconda
<Leonidas> yeah, Fedora is like Arch bleeding edge, so very likely for things to break there first
<Leonidas> <U0077> <S0076>;"<BASE><VRNT1>";"<MIN><MIN>";IGNORE % w
Haudegen has joined #ocaml
<try-again> Leonidas: What does that mean?
<Leonidas> try-again: The comment above says it is supposed to reorder w to be after W. I don't understand what it is doung exactly but that was one of the changes in the swedish locale in 2.28
<try-again> aha
<Leonidas> I wonder if that line is necessary at all, since V before W also C collation, so maybe removing that line and recreating locales might fix it?
jnavila has quit [Ping timeout: 246 seconds]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
ewanas has quit [Remote host closed the connection]
try-again has quit [Remote host closed the connection]
mfp has joined #ocaml
pierpal has joined #ocaml
jbrown has joined #ocaml
<Leonidas> any idea why opan refuses to install test dependencies although I specifically ask for it? https://travis-ci.com/Leonidas-from-XIV/orewa/jobs/156204352
<Leonidas> I added alcotest in the opam file and if I remove it locally and call the same command it detects that alcotest is missing and installs it
<Leonidas> OPAMYES=1 is set
jnavila has joined #ocaml
MadcapJake has joined #ocaml
MadcapJake has quit [Read error: Connection reset by peer]
MadcapJake has joined #ocaml
MadcapJake has quit [Quit: MadcapJake]
MadcapJake has joined #ocaml
steenuil has quit [Remote host closed the connection]
notnotdan has joined #ocaml
jao has quit [Ping timeout: 268 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
orbifx has quit [Ping timeout: 245 seconds]
marble_visions has left #ocaml [#ocaml]
steenuil has joined #ocaml
Haudegen has quit [Remote host closed the connection]
metreo has joined #ocaml
orbifx has joined #ocaml
poots25 has joined #ocaml
poots25 has quit [Remote host closed the connection]
Ocaml_noob has quit [Ping timeout: 256 seconds]
maufred has joined #ocaml
maufred has quit [Client Quit]
maufred has joined #ocaml
orbifx has quit [Ping timeout: 240 seconds]
maufred has quit [Quit: WeeChat 1.6]
maufred has joined #ocaml
fraxamo has quit [Quit: Leaving]
Haudegen has joined #ocaml
r3s1stanc3 has quit [Quit: ZNC 1.7.1 - https://znc.in]
r3s1stanc3 has joined #ocaml
JimmyRcom has joined #ocaml
jao has joined #ocaml
jao has quit [Disconnected by services]
jao has joined #ocaml
bumpkin has joined #ocaml
<bumpkin> can anyone give me an example of how to use bracket_tmpfile in Ounit, and get the path to the temporary file that was created?
<companion_cube> OUnit.bracket_tmpfile (fun (filename,chan) -> …)
<companion_cube> your function is given the filename and an open channel to write into it
<bumpkin> I think i've been able to get that part to work, but I'd like to read that file from inside the test itself, so i need the filepath that was written to
<companion_cube> the string should be this filepath
<companion_cube> but your whole test must live inside the `fun (filename,chan) -> …`
ggole has quit [Quit: ggole]
<bumpkin> ooooh....
<bumpkin> i think i understand now
<companion_cube> inside this function, the file exists and you can use it; once the function returns OUnit should take care to destroy the file
<bumpkin> that makes sense, it didn't occur to me to put the assertion inside that function itself. i was trying to use it as just a function that writes the file, then have the assertion outside of it
<bumpkin> thanks very much companion_cube
<companion_cube> no pn
<companion_cube> pb
<companion_cube> it's a relatively common pattern, to ensure proper release of resources
<bumpkin> makes sense. i had a mental block about it for some reason
bumpkin has left #ocaml [#ocaml]
jbrown has quit [Ping timeout: 272 seconds]
nopf has quit [Read error: Connection reset by peer]
jbrown has joined #ocaml
bartholin has quit [Remote host closed the connection]
tane has quit [Quit: Leaving]
caente has joined #ocaml
jnavila has quit [Ping timeout: 252 seconds]
nullifidian has quit [Ping timeout: 252 seconds]
MadcapJake has quit [Read error: Connection reset by peer]
<Leonidas> In Python there is even special syntax (`with`) for this pattern :-)
carlosdagos has joined #ocaml
jao has quit [Ping timeout: 272 seconds]
kakadu has quit [Remote host closed the connection]
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
MadcapJake has joined #ocaml
Haudegen has quit [Read error: Connection reset by peer]