<Armael>
your '–' is probably interpreted as the set of (several) bytes that compose its codepoint
<Armael>
so from the perspective of re you should consider it being several characters
<ggole>
Might wanna test that: I don't have re installed, but I imagine it's something like let re = Pcre.regexp "[a–]" in String.iter (fun char -> Printf.printf "%c matched by regexp : %b\n" char (Pcre.pmatch ~rex:re (String.make 1 char))) "a–"
<rzmt>
it prints "a matched by regexp : true" and then three times " matched by regexp : true"
<ggole>
Right. That indicates that the alternative is being interpreted as four unrelated characters (a, and the three bytes of the utf-8 representation of –).
<ggole>
Which is what dmbaturin and Armael suspected was happening.
madroach has quit [Read error: Connection reset by peer]
<rzmt>
My goal is to extract the integers from strings like in my example. Maybe i should try another lib? This library supports unicode, but im not sure if its meant for this kind of stuff https://github.com/ocaml-community/sedlex
<ggole>
You could do that. It might be a bit heavyweight, but it should work.
madroach has joined #ocaml
<Armael>
rzmt: what about matching with "\\d+(a|–)\\d+" ?
<rzmt>
Armael: that seems to work thanks. i think ill just use this even though its a bit hacky
amiloradovsky has quit [Ping timeout: 245 seconds]
jnavila_ has quit [Ping timeout: 246 seconds]
Serpent7776 has joined #ocaml
klntsky has quit [Read error: Connection reset by peer]
nicooo has quit [Read error: Connection reset by peer]
andreas303 has quit [Write error: Broken pipe]
oxford has quit [Read error: Connection reset by peer]
oxford has joined #ocaml
klntsky has joined #ocaml
andreas303 has joined #ocaml
nicooo has joined #ocaml
nicooo has quit [Excess Flood]
nicooo has joined #ocaml
theglass has left #ocaml [#ocaml]
FreeBirdLjj has joined #ocaml
gareppa has quit [Quit: Leaving]
<rzmt>
csv package in opam serializes into csv from type "string list list". Can i somehow write a function which converts a record into "string list", so that i dont have to modify the function when new fields are added to the record?
<rzmt>
in python i could use something like dict.values(), maybe there is something similar in OCaml?
iovec has joined #ocaml
<def`>
rzmt: no there is no such thing. At least with pattern matching the compiler will tell you which field you forgot to add
<thizanne>
rzmt: you seem to be comparing things living on different levels
<thizanne>
a record is not comparable to a python dict, it would be something like a python object, where fields of the record become attributes of the object
<thizanne>
to write such a to_string, you would need to do introspection, and no ocaml won't let you do that
<thizanne>
if you want something that works like a python dict, that would be a hash table (module Hashtbl), or a Map if you want persistence (~ immutability), and then you'll get the function you want
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
UndefinedIsNotAF has joined #ocaml
ziyourenxiang__ has quit [Ping timeout: 246 seconds]
<ggole>
There's a ppx for generating csv output
zmt00 has quit [Quit: Leaving]
kakadu has joined #ocaml
FreeBird_ has quit [Remote host closed the connection]
gareppa has joined #ocaml
rotucer has quit [Ping timeout: 265 seconds]
dborisog has quit [Ping timeout: 240 seconds]
kakadu_ has joined #ocaml
kakadu has quit [Ping timeout: 276 seconds]
unyu has quit [Quit: unyu~]
parcs has quit [Remote host closed the connection]
jnavila_ has joined #ocaml
parcs has joined #ocaml
kakadu_ has quit [Ping timeout: 265 seconds]
kakadu has joined #ocaml
rotucer has joined #ocaml
sagax has quit [Quit: Konversation terminated!]
gareppa has quit [Quit: Leaving]
gareppa has joined #ocaml
unyu has joined #ocaml
<rzmt>
didn't know that the compiler warns about unused labels with pattern matching, very useful
<rzmt>
thanks all
<rzmt>
"Either bind these labels explicitly or add '; _' to the pattern."
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #ocaml
vicfred has quit [Quit: Leaving]
gareppa has quit [Quit: Leaving]
_whitelogger has joined #ocaml
Hrundi_V_Bakshi has joined #ocaml
oni-on-ion has quit [Ping timeout: 245 seconds]
oni-on-ion has joined #ocaml
kakadu_ has joined #ocaml
kakadu has quit [Ping timeout: 276 seconds]
ggole has quit [Quit: Leaving]
jnavila_ has quit [Remote host closed the connection]
jnavila_ has joined #ocaml
kakadu has joined #ocaml
kakadu_ has quit [Ping timeout: 276 seconds]
Serpent7776 has quit [Quit: leaving]
unyu has quit [Quit: brb]
unyu has joined #ocaml
sagax has joined #ocaml
gravicappa has quit [Ping timeout: 240 seconds]
webshinra has quit [Remote host closed the connection]
averell has quit [Remote host closed the connection]
gareppa has quit [Remote host closed the connection]
jnavila_ has quit [Remote host closed the connection]
Madars has quit [Ping timeout: 276 seconds]
Madars has joined #ocaml
bronsen has quit [Ping timeout: 265 seconds]
iovec has quit [Quit: Connection closed for inactivity]
jao has quit [Remote host closed the connection]
kakadu_ has joined #ocaml
kakadu has quit [Ping timeout: 265 seconds]
jao has joined #ocaml
<hannes>
in a dune project (with 1.11), is there a way to use C stubs directly from an (executable ..) stanza? it complains about (c_names ..) and also (foreign_stubs ..) in the (executable ..)?
kakadu has joined #ocaml
kakadu_ has quit [Ping timeout: 268 seconds]
kakadu has quit [Remote host closed the connection]