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/
Stumpfenstiel has quit [Ping timeout: 260 seconds]
Haudegen has quit [Ping timeout: 245 seconds]
waleee has quit [Ping timeout: 265 seconds]
zebrag has quit [Quit: Konversation terminated!]
brettgilio has quit [Quit: The Lounge - https://thelounge.chat]
brettgilio has joined #ocaml
[itchyjunk] has quit [Quit: Leaving]
mbuf has joined #ocaml
Skyfire has quit [Quit: brb]
Skyfire has joined #ocaml
gravicappa has joined #ocaml
adanwan has joined #ocaml
Nahra has quit [Ping timeout: 252 seconds]
mbuf has quit [Quit: Leaving]
pieguy128 has quit [Quit: ZNC 1.8.2 - https://znc.in]
pieguy128 has joined #ocaml
Tuplanolla has joined #ocaml
adanwan has quit [Ping timeout: 276 seconds]
hendursa1 has joined #ocaml
hendursaga has quit [Ping timeout: 276 seconds]
adanwan has joined #ocaml
olle has joined #ocaml
Nahra has joined #ocaml
bartholin has joined #ocaml
Haudegen has joined #ocaml
Serpent7776 has joined #ocaml
olle has quit [Ping timeout: 252 seconds]
Geekingfrog has joined #ocaml
favonia has quit [Ping timeout: 265 seconds]
bartholin has quit [Ping timeout: 260 seconds]
rond_ has joined #ocaml
bartholin has joined #ocaml
[itchyjunk] has joined #ocaml
average has joined #ocaml
Everything has joined #ocaml
olle has joined #ocaml
xd1le has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
Haudegen has joined #ocaml
bartholin has quit [Ping timeout: 252 seconds]
bartholin has joined #ocaml
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
waleee has joined #ocaml
favonia has joined #ocaml
<d_bot> <carmysilna> what would be the most efficient way to insert a `char` into a `string` at a given index, using `batteries` or `Stdlib`? Right now I'm converting the string to a list and then into a vect, inserting, then converting back into a list and then a string. but that seems horribly inefficient
bartholin has quit [Ping timeout: 268 seconds]
<rom1504> inserting in an array is inefficient
<thizanne> you could do something looking like `let (left, right) = split your_string your_index in String.concat [left; String.make 1 your_char; right]`
<thizanne> (probably not the right function names)
<thizanne> but that still wouldn't be ideally efficient, so if that's performance sensitive you might want to user another structure than strings
adanwan has quit [Ping timeout: 276 seconds]
<d_bot> <carmysilna> should I store them as a Vect instead so its a rope? this is for a text editor, if that helps
bartholin has joined #ocaml
mro has joined #ocaml
olle has quit [Ping timeout: 260 seconds]
<d_bot> <darrenldl> oh wait this is closer for text editing maybe https://github.com/ocaml-community/zed
mro has quit [Quit: Leaving...]
hendursaga has quit [Ping timeout: 276 seconds]
[itchyjunk] has quit [Remote host closed the connection]
hendursaga has joined #ocaml
waleee has quit [Ping timeout: 252 seconds]
waleee has joined #ocaml
bartholin has quit [Ping timeout: 268 seconds]
ppw has joined #ocaml
ppw has left #ocaml [#ocaml]
xd1le has quit [Quit: xd1le]
average has quit [Quit: Connection closed for inactivity]
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
gravicappa has quit [Ping timeout: 265 seconds]
gravicappa has joined #ocaml
<d_bot> <Bluddy> There is no great solution for string editing. Rope is the functional solution, but probably the more efficient option is a vector. I think what editors do is that they store each line in a different vector.
<d_bot> <darrenldl> a gap buffer for each line would be speedy enough right?
dstein64 has left #ocaml [#ocaml]
bartholin has joined #ocaml
dstein64 has joined #ocaml
<d_bot> <Bluddy> yeah I guess so
gravicappa has quit [Ping timeout: 240 seconds]
bartholin has quit [Ping timeout: 252 seconds]
<d_bot> <carmysilna> well, my lines are very short in practice (1-5 chars maybe?) because ||this is a structured editor for mlatu (where you edit the AST) and I'm making each term appear on its own line. so when someone inserts a char, it just needs to be inserted into the rendered string and then re-parsed || tldr: I have a short `string` that will be need to be re-converted into a `string` at the end of the insert operation, as efficiently as po
bartholin has joined #ocaml
mro has joined #ocaml
mro has quit [Read error: Connection reset by peer]
mro has joined #ocaml
[itchyjunk] has joined #ocaml
[_] has joined #ocaml
[_] has quit [Remote host closed the connection]
[itchyjunk] has quit [Remote host closed the connection]
[itchyjunk] has joined #ocaml
mro has quit [Client Quit]
Everything has quit [Quit: leaving]
bartholin has quit [Ping timeout: 265 seconds]
brettgilio has quit [Ping timeout: 252 seconds]
Serpent7776 has quit [Quit: leaving]
bartholin has joined #ocaml
terrorjack has quit [Remote host closed the connection]
terrorjack has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
brettgilio has joined #ocaml
bartholin has quit [Quit: Leaving]
average has joined #ocaml
hackinghorn has joined #ocaml
<d_bot> <salt rock lamp> I heard once that Vim stores text as a vector of strings, one per line