birdgoose has quit [Read error: Connection reset by peer]
shawnw has joined #ocaml
lobo has quit [*.net *.split]
Fardale has quit [*.net *.split]
amosbird has quit [*.net *.split]
energizer has quit [*.net *.split]
nore has quit [*.net *.split]
copy has quit [*.net *.split]
copy has joined #ocaml
Fardale has joined #ocaml
lobo has joined #ocaml
amosbird has joined #ocaml
nore has joined #ocaml
mbuf has joined #ocaml
energizer has joined #ocaml
dinosaure has quit [*.net *.split]
gjvc has quit [*.net *.split]
gjvc has joined #ocaml
dinosaure has joined #ocaml
mro has joined #ocaml
gravicappa has joined #ocaml
Serpent7776 has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
wingsorc has quit [Ping timeout: 260 seconds]
olle has joined #ocaml
azimut has quit [Ping timeout: 240 seconds]
Anarchos has joined #ocaml
mro has quit [Remote host closed the connection]
bartholin has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
<d_bot>
<Bluddy> Just upgraded (on Windows 11) to wslg! It's awesome!
<d_bot>
<Bluddy> linux with built-in gui
<d_bot>
<Bluddy> highly recommended
dhil has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
mro has joined #ocaml
zebrag has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Ping timeout: 276 seconds]
Haudegen has joined #ocaml
tiferrei2000 has quit [Remote host closed the connection]
tiferrei has joined #ocaml
gravicappa has quit [Ping timeout: 260 seconds]
waleee has joined #ocaml
mro has joined #ocaml
<d_bot>
<xextixnx> lool
<d_bot>
<xextixnx> windows 11 rly
spip has joined #ocaml
bobo has quit [Ping timeout: 276 seconds]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Ping timeout: 252 seconds]
gravicappa has joined #ocaml
motherfsck has joined #ocaml
shawnw has quit [Ping timeout: 240 seconds]
mro has joined #ocaml
waleee has quit [Ping timeout: 248 seconds]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
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
azimut has joined #ocaml
xgqt has quit [Ping timeout: 248 seconds]
xgqt has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
mro has quit [Quit: Leaving...]
vicfred has joined #ocaml
bartholin has quit [Quit: Leaving]
waleee has joined #ocaml
rgrinberg has joined #ocaml
<d_bot>
<Patate> having trouble finding a naming rule for C constants bindings for ocaml.
<d_bot>
<Patate> I usually do the folowing. Convert the enum name to a prefix (`myEnumName` becomes `MY\_ENUM\_NAME\_`)
<d_bot>
<Patate> Then I take this prefix off the values names (`MY_ENUM_NAME_VALUE1` becomes `VALUE1`)
<d_bot>
<Patate> Problem is somtimes I have something like `MY_ENUM_NAME_64`... And as one might guess, `64` is not a valid constructor name...
Haudegen has joined #ocaml
<d_bot>
<Patate> I would like to find a nice way to handle these cases, other that writing the full name, as it is cool to write MyEnumName.VALUE1 rather than MyEnumName.MY_ENUM_NAME_VALUE1
<d_bot>
<Patate> How would you do it?
<d_bot>
<sirverik> any idea what happened to my utop?
<d_bot>
<NULL> When will we be able to locally override the behaviour of ints ? (Probably unreasonable)
<d_bot>
<Patate> probably
<d_bot>
<octachron> For FlagsBits the issue is that there are indices for bit sets. So you will have to handle them specially anyway.
<d_bot>
<Patate> Sure, but I thought of using sum types for them too... no?
<d_bot>
<NULL> Imagine opening `Float` and everything numerical is float
<d_bot>
<Patate> oof
<d_bot>
<octachron> No, there is too much impedance mismatch. You want to have an efficient `mem` function.
<d_bot>
<octachron> @NULL you can already redefine the algebraic operators, then you only have to add `.` to literals.
<d_bot>
<Patate> or have a regexp do it for you 😛
<d_bot>
<Patate> Not sure to know what you mean...
<d_bot>
<Patate> Ctypes' enums convert sum type constructor to int64 constants, so in the end you just + them and put them in the function call/data structure... right?
<companion_cube>
that'd be kind of useful for zarith, I must say :p
mbuf has quit [Quit: Leaving]
<d_bot>
<NULL> Won't your `C1 C2 C4 C8` be translated into `0 1 2 3` ?
<d_bot>
<Patate> yes
<d_bot>
<Patate> Would have somthing like
<d_bot>
<Patate> ```ocaml
<d_bot>
<Patate> use [ Option_toto; Option_tata ]
<d_bot>
<Patate> ```
<d_bot>
<Patate> under the hood, it knows Option_toto = 5, Option_tata = 78, and + them
<d_bot>
<Patate> Would have somthing like
<d_bot>
<Patate> ```ocaml
<d_bot>
<Patate> use [ Option_toto; Option_tata ]
<d_bot>
<Patate> ```
<d_bot>
<Patate> under the hood, it knows Option_toto = 8, Option_tata = 64, and + them
<d_bot>
<Patate> so the C implementation of use receives (8 | 64)
<d_bot>
<octachron> Why not use directly `a <+> b` on the OCaml side? Since you can't pattern match on sets of flags, having constructors rather than private ints doesn't bring much to the table.
<d_bot>
<Patate> ...
<d_bot>
<Patate> yes
<d_bot>
<Patate> And I can do it without much of a hassle, as they all end with -FlagBits.
<d_bot>
<Patate> The problem is that I would have liked it to work, potentially on other headers than vulkan's... So using consistent rules not depending on the API conventions would have been nice...
<d_bot>
<octachron> It is not really possible, semantics is always coded using side-channel in C.
<d_bot>
<octachron> You could define a system of plugins/extensions that could be enabled or disabled depending on the C source conventions.
<d_bot>
<Patate> Yes, thought about that
<d_bot>
<Giorgi> yo guys , how can i filter out list of tuples [(1,1.5,3);(3,3.3,4)] to remove non integer values and turn everything into a single list like this? [1,3,3,4]
<d_bot>
<Giorgi> do i use List.filter for that?
<d_bot>
<Patate> what have you got so far?
<d_bot>
<NULL> Since you have to know the types at compile time, you can't be smarter than just putting the ints manually
<d_bot>
<Patate> he seems to have (int * float * int) list
<d_bot>
<Giorgi> min
<d_bot>
<Patate> that means for exemple the information that this particular enum corresponds to bits is not explicit?
<d_bot>
<Patate> no
<d_bot>
<Patate> filter removes elements from your list, it would remove whole tuples.
<d_bot>
<Patate> you can remove one element in the tuple, for every tuple in your list
<d_bot>
<Patate> you give it (int * float * int), but your pattern matches (int * float) values
<sleepydog>
you're not building a list here, you're just searching for the first round number
<sleepydog>
also what Patate said
<d_bot>
<Giorgi> okay i give up
<d_bot>
<Giorgi> ty all
<d_bot>
<NULL> How unsatisfying
<d_bot>
<Patate> Thanks @undu @octachron @NULL (hope I did not miss someone), I will continue to search for a way that doen't seem too "meh" to me
<d_bot>
<Patate> @Giorgi try your function with [(1.5, 3); (3.3, 4)] instead
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<d_bot>
<octachron> Oh, my code generator worked with the last version of Vulkan specification without code change. I don't remember the last time that this has happened.
vshender has joined #ocaml
vshender has quit [Client Quit]
wingsorc has joined #ocaml
<d_bot>
<ec> Can I capture the *rest* of the polyvars in a signature like this?
<d_bot>
<ec>
<d_bot>
<ec> ```ocaml
<d_bot>
<ec> val f : ('v, [> `A of 'x]) result
<d_bot>
<ec> -> ('v, 'x, [> _THE_REST_HERE]) result
<d_bot>
<ec> ```
<d_bot>
<ec> By which I mean … if the input argument has ``[`A, `B, `C]``, I want to capture `` `A`` in one way, and the rest in another way.
rgrinberg has joined #ocaml
wingsorc has quit [Remote host closed the connection]
wingsorc has joined #ocaml
wingsorc has quit [Client Quit]
wingsorc has joined #ocaml
gravicappa has quit [Ping timeout: 252 seconds]
<d_bot>
<octachron> No, this is not possible with OCaml polymorphic variants.
vshender has joined #ocaml
vshender has quit [Quit: rcirc on GNU Emacs 28.1]
<d_bot>
<ec> hm. okay. that's unfortunate. the closest I could get was "lifting" my problem into a location with total knowledge of the variants — so they aren't actually polymorphic anymore — and using something like:
<d_bot>
<ec> ```ocaml
<d_bot>
<ec> val f : ('v, [`A of 'x | Module.all_the_others]) result
<d_bot>
<ec> -> ('v, 'x, [> Module.all_the_others]) result
<d_bot>
<ec> ```
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
birdgoose has joined #ocaml
olle has quit [Ping timeout: 256 seconds]
olle has joined #ocaml
Tuplanolla has joined #ocaml
olle has quit [Ping timeout: 246 seconds]
jpds has quit [Remote host closed the connection]
Haudegen has quit [Ping timeout: 276 seconds]
jpds has joined #ocaml
motherfsck has quit [Quit: quit]
motherfsck has joined #ocaml
tiferrei has quit [Ping timeout: 240 seconds]
tiferrei has joined #ocaml
rgrinberg has joined #ocaml
tiferrei has quit [Ping timeout: 240 seconds]
tiferrei has joined #ocaml
tiferrei has quit [Ping timeout: 240 seconds]
perrierjouet has quit [Quit: WeeChat 3.5]
tiferrei has joined #ocaml
perrierjouet has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]