<discocaml>
<masterbuilder> neiluj: create a bitmask with the bit you're interested set and then xor the original value with that bitmask
<discocaml>
<Marc> I'd like to convert projects using the raylib library to work in the browser. raylib is working perfectly fine with a C program compiled via emscripten, but for OCaml I have no clue on what I'd need to do to compile with js_of_ocaml and have a working application in the browser. Has someone any pointers or ideas to help me?
<neiluj>
oh nice thanks for the input! bitmask is great!
<neiluj>
thanks olle too :)
<olle>
neiluj: Feel free to add a new answer to the SO thread, it was top google result
mro_ has joined #ocaml
mro has quit [Ping timeout: 268 seconds]
azimut has joined #ocaml
hornhack has joined #ocaml
hornhack has quit [Remote host closed the connection]
szkl has quit [Quit: Connection closed for inactivity]
mbuf has quit [Quit: Leaving]
dhil has joined #ocaml
Serpent7776 has quit [Quit: WeeChat 1.9.1]
<discocaml>
<zbaylin> ```ocaml
<discocaml>
<zbaylin> Is there any way of specifying first class module arguments that implement multiple module types without defining a new one? i.e.
<discocaml>
<zbaylin> module type S0 = sig ... end
<discocaml>
<zbaylin> module type S1 = sig ... end
<discocaml>
<zbaylin>
<discocaml>
<zbaylin> let f (module M : sig include S0 include S1 end) = ...
<discocaml>
<zbaylin> ```
<discocaml>
<zbaylin> That example doesn't compile, but it would be nice to not have to create multiple new interfaces
<discocaml>
<KW78> how so ?
<discocaml>
<KW78> ```ocaml
<discocaml>
<KW78> # module type S0 = sig type t = int val tx : t end;;
<discocaml>
<KW78> module type S0 = sig type t = int val tx : t end
<discocaml>
<KW78> # module type S1 = sig type u = string val ux : u end;;
<discocaml>
<KW78> module type S1 = sig type u = string val ux : u end
<discocaml>
<KW78> # module type S01 = sig include S0 include S1 end;;
<discocaml>
<KW78> module type S01 = sig type t = int val tx : t type u = string val ux : u end
<discocaml>
<KW78> # let f (module M: S01) = M.tx, M.ux;;
<discocaml>
<KW78> val f : (module S01) -> int * string = <fun>
<discocaml>
<KW78> ```
<discocaml>
<KW78> I am not sure if you can build an anonymous module type though directly
<discocaml>
<octachron> You can't, packed module types must be named to avoid introducing the whole module expression language into the type expression ones.
<discocaml>
<KW78> make sense wrt the error message `Error: Invalid package type: only module type identifier and 'with type' constraints are supported`
Haudegen has quit [Quit: Bin weg.]
<discocaml>
<tautologico> I'm running a program and want to get its output, I wondered if I could get the contents in a buffer instead of writing to a file then reading the file. I think it's possible if I create a file, mmap it, then redirect stdout/err to it with sharing disabled, but it still creates the file
azimut has quit [Ping timeout: 255 seconds]
azimut has joined #ocaml
neiluj has quit [Quit: WeeChat 3.6]
<discocaml>
<lagarto> @tautologico I see Unix.open_process_in in the stdlib, is that what you want?
<discocaml>
<tautologico> almost. I don't want to run the program in parallel, I want to run it to completion and then look at the output
<discocaml>
<lagarto> can't you just block reading the channel till you get EOF?
<discocaml>
<tautologico> maybe
<discocaml>
<Cherry 🍒> largato 👆
<discocaml>
<Cherry 🍒> paraguaio 🦜
<discocaml>
<Et7f3 (@me on reply)> Mmap won't auto expand memory so it should not be part of the solution. Usually IPC is done through pipe (command substitution in bash use that). If pipe solution interest you then go with lagarto' solution or Unix.open_process_args_in (to get a little speed boost)
<discocaml>
<Et7f3 (@me on reply)> ?
<discocaml>
<Et7f3 (@me on reply)> Is it a program you own ?
<discocaml>
<tautologico> I think it's simpler to use files 🙂
<discocaml>
<Et7f3 (@me on reply)> They have the same API
<discocaml>
<tautologico> it's not anything critical
<discocaml>
<Cherry 🍒> ? what
<discocaml>
<tautologico> lagarto: 🦎 papagaio: 🦜
<discocaml>
<Et7f3 (@me on reply)> You typically choose file for persistence and pipe for IPC
Tuplanolla has joined #ocaml
<discocaml>
<tautologico> yeah it's probably the best solution. thanks @Et7f3 @lagarto
<discocaml>
<tautologico> (I also need to set the environment so I guess I need `open_process_full` even if I don't need to use stdin)
Haudegen has joined #ocaml
<discocaml>
<GodFather> hi I m trying to solve this twistTree problem but it seems to me that I m missing something. Can someone help me understand what I m doing wrong? Code and question below
<discocaml>
<GodFather>
<discocaml>
<GodFather> Define twistTree that twists the data around the tree without changing the branching structure. Here are some example inputs and outputs:
<discocaml>
<GodFather> hi I m trying to solve this twistTree problem but it seems to me that I m missing something. Can someone help me understand what I m doing wrong? My Code and question below
<discocaml>
<GodFather>
<discocaml>
<GodFather> Define twistTree that twists the data around the tree without changing the branching structure. Here are some example inputs and outputs:
<discocaml>
<hockletock> I can see that your code leaves a branch's 'a value alone but in the last example your branch values are 1 and 2 but becomes 3 and 1
<technomancy>
I guess the discord bridge doesn't understand how pastebins work huh
<technomancy>
yikes dot gif
<discocaml>
<hockletock> yeah if youwant to post code blocks do it in #beginners
<discocaml>
<GodFather> mb, didnt know you have to post it in
<discocaml>
<GodFather> mb, didnt know you have to post it in beginners
<technomancy>
why not bridge discord to matrix and then bridge that to libera? then you'd get nicks that actually work and stuff
<discocaml>
<GodFather> can you explain this more?
<technomancy>
well like ... matrix has bridging that actually works, right?
<technomancy>
matrix users are represented as distinct nicks
<technomancy>
and long code samples get automatically turned into pastebin links
<technomancy>
matrix bridges to libera but it also supposedly supports bridging to discord (never used this because I stay the hell away from discord, but so I'm told)
<technomancy>
I'm guessing their discord bridge would similarly represent distinct users as distinct, so it doesn't break all the features that rely on users having nicks
<discocaml>
<NULL> (That question was directed to hockletock)
<technomancy>
I've been in multiple channels that more or less disintegrated when the discord bridge got activated because it just doesn't work evry well
dhil has quit [Ping timeout: 255 seconds]
<discocaml>
<hockletock> @GodFather look at the lastexample. ([3] {1} ([4] {2} [5])) becomes ([4] {3} ([5] {1} [2]))
<discocaml>
<hockletock> apologies for the horrible brackets but {} are values in the "middle" of branches
<discocaml>
<hockletock> Your code leaves those intact, branch \_ x \_ becomes branch \_ x \_
<discocaml>
<hockletock> their example shows that that's not consistent with their definition of "twisting"
dhil has joined #ocaml
waleee has joined #ocaml
<technomancy>
ohhhhh lol ok yeah
oriba has joined #ocaml
kurfen has joined #ocaml
micro has quit [Ping timeout: 255 seconds]
micro has joined #ocaml
azimut_ has joined #ocaml
azimut has quit [Ping timeout: 255 seconds]
bartholin has joined #ocaml
<discocaml>
<GodFather> yea I'm not able to fix the code. Can you give me a hint to the right direction
<discocaml>
<GodFather> @hockletock yea I'm not able to fix the code. Can you give me a hint to the right direction
<discocaml>
<GodFather> @hockletock yea I'm not able to fix the code. Can you give me a hint to the right direction code wise
Stumpfenstiel has joined #ocaml
olle has quit [Ping timeout: 260 seconds]
trev has quit [Remote host closed the connection]
dhil has quit [Ping timeout: 268 seconds]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
masterbuilder has joined #ocaml
m5zs7k has quit [Ping timeout: 264 seconds]
m5zs7k has joined #ocaml
Stumpfenstiel has quit [Ping timeout: 268 seconds]