<discocaml>
<froyo> Terence: the channel is likely closed from undrenath your feet
<discocaml>
<froyo> oh already mentioned
<discocaml>
<_terence_> Yup , but I still appreciate your help !
<companion_cube>
Another little rant: the channels are full of global state, iirc there's a list or hashmap of all of them so that the program can close them at exit 😨
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
mima has quit [Ping timeout: 240 seconds]
dnh has joined #ocaml
mima has joined #ocaml
<discocaml>
<fham_> If I want to print something in the happy and the error case, do I need to use both `Printf.printf` and `Printf.eprintf` with the same format string?
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mima has quit [Ping timeout: 260 seconds]
dnh has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<discocaml>
<octachron> If you want to print the same contents in both branch, you can use `fprintf (if happy the stdout else stderr) ...` but printing the same contents on either `stdout` or `stderr` sounds like a strange occurence.
infinity0 has quit [Remote host closed the connection]
<discocaml>
<froyo> you can write the format string once (prepended with format_of_string identity to let the compiler know) and supply it to either function too
infinity0 has joined #ocaml
szkl has quit [Quit: Connection closed for inactivity]
dnh has joined #ocaml
Anarchos has joined #ocaml
amk has quit [Ping timeout: 250 seconds]
amk has joined #ocaml
<discocaml>
<fham_> Maybe my program is structured the wrong way, but I have a verbose mode that prints out every file that is currently processed, which should also work if there is an error.
<discocaml>
<octachron> Why change your logging to stderr if there was an unrelated error ?
<discocaml>
<fham_> Because otherwise I only see the error, and not the files that were processed before.
<discocaml>
<octachron> Why would you not see what you are logging on stdout in case of an error?
<discocaml>
<octachron> ?
Anarchos has quit [Quit: Vision[]: i've been blurred!]
<discocaml>
<fham_> Maybe there is also something misconfigured and I should see an output with this line
<discocaml>
<fham_>
<discocaml>
<fham_> ```ocaml
<discocaml>
<fham_> if verbose then Printf.printf "Processing file: %s\n" path;
<discocaml>
<fham_> ```
<discocaml>
<fham_> but I only see something with `eprintf` and afterwards the unrelated error comes.
<discocaml>
<octachron> You should flush the channel with `%!`
<discocaml>
<fham_> I figured, but it doesn't change the log output
<discocaml>
<fham_> Oh.
<discocaml>
<fham_> I should have not called it with a node script.
<discocaml>
<fham_> it piped stdout directly into my files, oops
<discocaml>
<fham_> Yes, I will gladly only use eprintf then, thank you anyway.
Tuplanolla has joined #ocaml
dhil has joined #ocaml
gareppa has joined #ocaml
dhil has quit [Ping timeout: 248 seconds]
mima has joined #ocaml
gareppa has quit [Quit: WeeChat 3.8]
John_Ivan has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
ursa-major has quit [Quit: WeeChat 4.0.4]
bartholin has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
landonf has quit [Server closed connection]
landonf has joined #ocaml
dhil has quit [Ping timeout: 255 seconds]
<discocaml>
<geoff> Oh the Oxidizing OCaml series finally got it's third part and was posted to discuss
Serpent7776 has joined #ocaml
<companion_cube>
is there no way to take a virtual class C, and say (in a .mli) "this class inherits C but is entirely concrete"?
<octachron>
For methods, you can go in the reverse direction with a constraint on 'self: `class virtual v: object('self) constraint 'self = #concrete end`
<companion_cube>
hmm what I want is to succintly say "this concrete class inherits this virtual class"
<companion_cube>
seems like the constraint doesn't work :/
<companion_cube>
("this non-virtual class type has undeclared virtual methods […]"
<companion_cube>
)
<octachron>
Indeed, the more natural direction doesn't work without someone explicitly defining a concrete method as far as can see.
<companion_cube>
yeah I have to copy the signature of every method :(
waleee has joined #ocaml
azimut has quit [Ping timeout: 246 seconds]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
Serpent7776 has quit [Ping timeout: 246 seconds]
mima has quit [Ping timeout: 246 seconds]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bartholin has quit [Quit: Leaving]
<discocaml>
<aramya> Hey everyone :)
<discocaml>
<aramya> Is there an easy way to use the ``mmap`` UNIX function, and then to jump on the allocated chunk (which would have been declared as executable)?
<companion_cube>
I really doubt it, for the second part
conjunctive has quit [Server closed connection]
conjunctive has joined #ocaml
<discocaml>
<Et7f3 (@me on reply)> This probably better handled in C so just write a small stub