companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.12 released: https://ocaml.org/releases/4.12.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
waleee has quit [Ping timeout: 250 seconds]
zebrag has quit [Quit: Konversation terminated!]
Enjolras_ has joined #ocaml
Cypi_ has joined #ocaml
vsiles_ has joined #ocaml
adrien_ has joined #ocaml
rks`_ has joined #ocaml
sadiq_ has joined #ocaml
notnotdan has quit [*.net *.split]
nerdypepper has quit [*.net *.split]
damien3 has joined #ocaml
notnotdan has joined #ocaml
nfc_ has joined #ocaml
nerdypepper has joined #ocaml
Techcable_ has quit [*.net *.split]
Fardale has quit [*.net *.split]
drewolson1 has joined #ocaml
Fardale has joined #ocaml
ebb_ has joined #ocaml
d_bot has joined #ocaml
Techcable has joined #ocaml
ebb_ is now known as ebb
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
PinealGlandOptic has joined #ocaml
sagax has quit [Remote host closed the connection]
favonia has quit [Ping timeout: 258 seconds]
olle has joined #ocaml
mro has joined #ocaml
rks`_ is now known as rks`
mro has quit [Remote host closed the connection]
mro has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
Haudegen has joined #ocaml
mro has joined #ocaml
bartholin has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
sagax has joined #ocaml
mro has joined #ocaml
hendursa1 has joined #ocaml
hendursaga has quit [Ping timeout: 244 seconds]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
olle has quit [Ping timeout: 252 seconds]
average has quit [Quit: Connection closed for inactivity]
mbuf has joined #ocaml
spip has quit [Quit: Konversation terminated!]
spip has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
PinealGlandOptic has quit [Quit: leaving]
olle has joined #ocaml
Manis has joined #ocaml
mro has quit [Remote host closed the connection]
<Manis> Hi. Is it possible to to method chaining in OCaml without having to wrap each part in parens?
<d_bot> <carmysilna> There’s |> the pipeline operator
Haudegen has joined #ocaml
<Manis> I know the |> operator but it doesn't work for objects, or does it?
<d_bot> <carmysilna> Oh, I don’t know about that. I haven’t done any OOP in OCaml, so I assumed you meant functions by methods
<Manis> I haven't done any OOP in OCaml either (until now) but wanted to give it a try.
<Manis> The # operator works but it doesn't work (or I couldn't figure out how) really well if you want to build methods that return self.
<Manis> I built a small class that does add, sub, to_string.
<Manis> I can use it like this:
<Manis> print_endline ((new calc # add 44) # sub 2) # to_string
<Manis> But I'd much rather have something that looks roughly like this:
<octachron> You could define an application operator with `#`-level of precedence as `let (#%) f x = f x`
<Manis> print_endline (new calc # add 44 # sub 2 # to_string)
<olle> Is customer operator feature part of the Menhir grammar?
<olle> custom*
<octachron> and end up with "new calc # add#%44 # sub#%2 # to_string"
<octachron> olle: Not really? It is the lexer itself which classify operators into operator classes.
<Manis> octachron: That looks a bit strange. But following this idea, would it be possible to define some sort of paranthesis operator or something that allows something like C-style function calls `x#add(2)` or similar?
<octachron> No, this is not possible as far as I can see.
<olle> octachron: hm
Anarchos has joined #ocaml
<Anarchos> hi
mro has joined #ocaml
favonia has joined #ocaml
glassofethanol has joined #ocaml
mro has quit [Ping timeout: 250 seconds]
<olle> octachron: so the lexer has already all possible operators defined?
<olle> Manis: |> pipe operator?
<olle> Oh you already knew
<octachron> Operator classes are defined by the first starting character in OCaml. And yes, the lexer contains the definition of all operator classes: https://github.com/ocaml/ocaml/blob/trunk/parsing/lexer.mll#L563
<Manis> I guess I'll need to do a lot more digging into operators.
<Manis> It looks like a huge question mark to me atm.
<olle> octachron: thanks
<olle> octachron: can a custom operator have any length?
<olle> Like #####
<olle> |>>>>>
<olle> SUPER PIPE
<d_bot> <ggole> Yep
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #ocaml
<d_bot> <froyo> super pipe lol
waleee has joined #ocaml
hackinghorn has joined #ocaml
Manis has quit [Quit: Manis]
Manis has joined #ocaml
Manis has quit [Client Quit]
hornhack has joined #ocaml
hackinghorn has quit [Ping timeout: 248 seconds]
mbuf has quit [Quit: Leaving]
Haudegen has quit [Quit: Bin weg.]
olle has quit [Ping timeout: 252 seconds]
glassofethanol has quit [Quit: leaving]
waleee has quit [Quit: WeeChat 3.2]
<d_bot> <mimoo> hello, anyone knows how to run a single test with dune and inline tests?
waleee has joined #ocaml
<fluxm> libvirt depends: "ocaml" {< "4.03.0"} :(. I wonder why such a hard limit.
<fluxm> it seems it has fallen out of maintenance and the easy solution is to just use the command line tools where applicable
<fluxm> well, at least it doesn't compile :)
<fluxm> what a suberb combination, -Wall and -Werror -> new warnings result in code not compiling (well, also old errors)
<fluxm> such as: libvirt_c_epilogue.c:89:1: error: ‘not_supported’ defined but not used [-Werror=unused-function]
<fluxm> now I'm pondering if it would be worthwhile to actually convert this project to use Dune, so it would be easy to use as a directory as-is.. probably not :)
<companion_cube> -Werror sucks, but well :p
<fluxm> lol, https://gitlab.com/libvirt/libvirt-ocaml has the exact same changes I made. however I'm unable to compile that one because autoconf/automake is not happy.
<fluxm> but, it has ci, so I can see how it should be compiled :)
<fluxm> they must have fixed the actual C issues as well, because they have Werror :) (got it compiling)
zebrag has joined #ocaml
Tuplanolla has joined #ocaml
Haudegen has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
olle has joined #ocaml
rgrinberg has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
<d_bot> <EduardoRFS> If changing behavior of (==) is allowed, why not deprecate it and move to Obj module?
hornhack has quit [Ping timeout: 250 seconds]
<companion_cube> wdym, you can't change `==`, only shadow it
gravicappa has quit [Ping timeout: 250 seconds]
ansiwen has quit [Quit: ZNC 1.7.1 - https://znc.in]
ansiwen has joined #ocaml
notnotdan has quit [Ping timeout: 268 seconds]
lisq has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Quit: Leaving]
notnotdan has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oriba has joined #ocaml
<oriba> when I have partial application by accident in my code, I get the warning, that that expression should be of unit type! I remember, there was a warning about partial application (which I prefer) in older compilers
<oriba> looks bad to me
<oriba> is this a known issue?
<oriba> or are there reasons to get such a warning about unit type?
<d_bot> <NULL> You mean this warning message : `Warning 10 [non-unit-statement]: this expression should have type unit.` ? What's wrong with it ?
<d_bot> <NULL> After re-reading, I infer that you're not getting this warning when you thought you should get it : `Warning 5 [ignored-partial-application]: this function application is partial, maybe some arguments are missing.`. What's the expression ?
<oriba> yes
<oriba> I thought toget the one and not the other warning
<d_bot> <NULL> The unusual `(:=) (ref 0); 0;;` triggers Warning 5, what's your expression that should also trigger it ?
<oriba> don't have that stuff at hand now (it's on my working laptop), try to find it out.
rgrinberg has joined #ocaml
<d_bot> <NULL> The less unusual `let add = (+) in add 0; 0;;` also triggers it
<d_bot> <NULL> Also, "try to find it out" is an order; as you also skipped the subject in the first clause I imagine you meant "I *am trying* to find it out"
<oriba> I have a yojson object and use Yojson.Basic.show on that object. Just seeing, it is not partial application. it just jields string type.
<oriba> so my assumption was wrong, I did not partial application
<oriba> ah, the name mislead me
<oriba> show does not show (print) the value
<oriba> it converts to string
<oriba> hmhhh
<oriba> so it is a string value standing alone
<oriba> using print_endline (YB.show myson) and the warning goes away
mro has joined #ocaml
gravicappa has joined #ocaml
<d_bot> <NULL> Then next time, make sure your problem truly is an issue of the software you're using (here, OCaml) before claiming it as one
<oriba> sorry for the false alarm :-(
olle has quit [Ping timeout: 248 seconds]
gravicappa has quit [Ping timeout: 252 seconds]
mro has quit [Ping timeout: 240 seconds]
mro has joined #ocaml
elf_fortrez has joined #ocaml
olle has joined #ocaml
farn has quit [Ping timeout: 240 seconds]
farn has joined #ocaml
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
oriba has joined #ocaml
elf_fortrez has quit [Quit: Client closed]
olle has quit [Ping timeout: 240 seconds]
elf_fortrez has joined #ocaml
bartholin has quit [Quit: Leaving]
mro has quit [Quit: Leaving...]
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
Tuplanolla has quit [Quit: Leaving.]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest86 has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
elf_fortrez has quit [Quit: Client closed]
elf_fortrezz has joined #ocaml
elf_fortrezz has quit [Client Quit]
elf_fortrez has joined #ocaml
elf_fortrez has quit [Quit: Client closed]
rgrinberg has joined #ocaml
hackinghorn has joined #ocaml
hornhack has joined #ocaml
hackinghorn has quit [Ping timeout: 250 seconds]