mcspud has quit [Remote host closed the connection]
caltelt_ has quit [Ping timeout: 264 seconds]
mcspud has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 264 seconds]
spew has quit [Quit: Connection closed for inactivity]
halogenandtoast has joined #ocaml
halogena1dtoast has joined #ocaml
halogenandtoast has quit [Ping timeout: 264 seconds]
gtrak has joined #ocaml
silver has quit [Read error: Connection reset by peer]
gtrak has quit [Ping timeout: 268 seconds]
ygrek has quit [Ping timeout: 248 seconds]
caltelt_ has joined #ocaml
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 240 seconds]
mcspud is now known as cockbot
cockbot is now known as mcspud
shinnya has joined #ocaml
malina has joined #ocaml
pierpal has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shinnya has quit [Ping timeout: 248 seconds]
kvda has joined #ocaml
mfp has quit [Ping timeout: 256 seconds]
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 240 seconds]
Denommus has joined #ocaml
pierpa has quit [Quit: Page closed]
jbrown has quit [Ping timeout: 245 seconds]
jao has quit [Ping timeout: 264 seconds]
Denommus has quit [Remote host closed the connection]
mbuf has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
pierpal has quit [Ping timeout: 240 seconds]
kvda has joined #ocaml
MercurialAlchemi has joined #ocaml
cbot has quit [Quit: Leaving]
wklm has joined #ocaml
groovy2shoes has quit [Ping timeout: 260 seconds]
maufred has quit [Quit: WeeChat 1.9]
maufred has joined #ocaml
caltelt_ has quit [Ping timeout: 256 seconds]
wklm has quit [Ping timeout: 264 seconds]
mbuf has quit [Remote host closed the connection]
mbuf has joined #ocaml
Haudegen has joined #ocaml
groovy2shoes has joined #ocaml
dhil has joined #ocaml
freyr has joined #ocaml
lokydor_ has joined #ocaml
lokydor has quit [Ping timeout: 240 seconds]
wklm has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ehirdoy>
I failed to build with 'let%lwt'. How/what libs to append?
kvda has joined #ocaml
halogena1dtoast is now known as halogenandtoast
<discord3>
<mseri> What error do you get? To use that syntax you need the lwt-ppx rewirter
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ehirdoy>
discord3: I didn't know how to add preprocess in jbuild. Now I put (preprocess (pps (lwt.ppx))) instead of in (libraries). It seems working. Thanks
<xvilka>
if I have a some calculation for lets say Int32, like (a lsr 16) + (b lsl 32) land 65535, how I can in a short form convert constants 16, 65535 to Int32?
flodin1 has quit [Quit: WeeChat 2.1]
<reynir>
16l IIRC
<reynir>
Yes
<reynir>
and 16L for int64 :)
barcabuona has joined #ocaml
<xvilka>
wow
<xvilka>
that was unexpected, thank you
kvda has joined #ocaml
<xvilka>
one more question, I have a record with mutable fields, but want to write a function alike "let func mut_field = ... mut_field <- some", where I will apply this func alike "func rec.mut_field" instead of doing the same code multiple times in { mut_field1 <- ... }
<xvilka>
how to specify that function argument is mutable record field?
<xvilka>
nvm, rewrote code
<xvilka>
seems impossible
barcabuona has quit [Quit: WeeChat 2.1]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
argent_smith has joined #ocaml
tarptaeya has joined #ocaml
malina has quit [Ping timeout: 248 seconds]
freyr has quit [Ping timeout: 248 seconds]
kvda has joined #ocaml
kvda has quit [Client Quit]
inr has quit [Quit: WeeChat 2.1]
inr has joined #ocaml
freyr69 has joined #ocaml
malina has joined #ocaml
<flux[m]>
xvilka: yes, impossible. if you can instead of mutable fields use 'ref', then you can pass that ref to a function.
zolk3ri has joined #ocaml
gareppa has joined #ocaml
mk9 has joined #ocaml
gareppa has quit [Remote host closed the connection]
mk9 has quit [Quit: mk9]
ziyourenxiang has joined #ocaml
mk9 has joined #ocaml
mk9 has quit [Quit: mk9]
mengu has joined #ocaml
mfp has joined #ocaml
dhil has quit [Ping timeout: 276 seconds]
tarptaeya has quit [Remote host closed the connection]
tarptaeya has joined #ocaml
Haudegen has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
Haudegen has joined #ocaml
zolk3ri has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
jao has joined #ocaml
zolk3ri has joined #ocaml
Lucretia has joined #ocaml
<Lucretia>
hi, just trying out the interactive tutorial, lesson 2 step 3 doesn't work
<discord3>
<Christophe> Another issue found out tht it prints to javascript console
<Lucretia>
vertainly does
<Lucretia>
c
gtrak has joined #ocaml
shinnya has joined #ocaml
mbuf has quit [Quit: Leaving]
zv has quit [Ping timeout: 265 seconds]
tarptaeya has quit [Ping timeout: 265 seconds]
_andre has joined #ocaml
malina has quit [Ping timeout: 240 seconds]
zv has joined #ocaml
gtrak has quit [Ping timeout: 265 seconds]
tarptaeya has joined #ocaml
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ocaml
spew has joined #ocaml
dhil has quit [Ping timeout: 268 seconds]
dhil has joined #ocaml
Haudegen has quit [Remote host closed the connection]
wklm has quit [Quit: Lost terminal]
gareppa has joined #ocaml
dtornabene has joined #ocaml
jbrown has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
gtrak has joined #ocaml
neatonk has joined #ocaml
gtrak has quit [Ping timeout: 260 seconds]
gareppa has quit [Quit: Leaving]
zv has quit [Ping timeout: 260 seconds]
gtrak has joined #ocaml
zv has joined #ocaml
<ELLIOTTCABLE>
o7
<ELLIOTTCABLE>
Is there a method like String.concat that operates on a reverse list?
<Fardale>
ELLIOTTCABLE: what do you mean by reverse list ?
jmiven has quit [Quit: co'o]
<ELLIOTTCABLE>
I'm constructing an accumulated list of strings, on each iteration doing something like `new_str :: acc`
jmiven has joined #ocaml
<ELLIOTTCABLE>
and when the (imperative 🤮) iteration is complete, I thus have a reversed list of strings, that I then want to efficiently concatenate into one string
<octachron>
ELLIOTTCABLE, there is Buffer in the stdlib for this kind of task
<ELLIOTTCABLE>
`let acc = []; "a" :: acc; "b" :: acc; "c" :: acc;`, now I want `Magic.method acc` to be `"abc"`
<ELLIOTTCABLE>
octachron: I'll look! Thanks!
<ELLIOTTCABLE>
oh, using Core, for context. thanks RWO
<octachron>
otherwise reversing the list with List.rev should be fine too?
<ELLIOTTCABLE>
I'd think that'd be slow, but that was what I was about to write down anyway
malina has joined #ocaml
<Armael>
can't you use Buffer even if you're using Core ?
<ELLIOTTCABLE>
probably — I just forgot to mention it
steenuil_ has joined #ocaml
steenuil has quit [Ping timeout: 240 seconds]
Denommus has joined #ocaml
shinnya has quit [Ping timeout: 265 seconds]
Denommus has quit [Read error: Connection reset by peer]
freyr69 has quit [Remote host closed the connection]
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ocaml
tarptaeya has quit [Quit: Konversation terminated!]
Denommus has joined #ocaml
<discord3>
<Christophe> you could always fold I guess: List. fold_left (fun acc x -> x^acc) l
<discord3>
<Christophe> but since octachron says Buffer is made for that you should follow his advice :)
jrslepak has joined #ocaml
<Drup>
Christophe O(n²)
<discord3>
<Christophe> I know, I'm just trying to answer the question literally :)
<Drup>
But it's a bad answer, the complexity is terrible :D
<Drup>
Using List.rev is faster
<discord3>
<Perry> Sometimes n^2 doesn't matter. Like if you're dong this once in a long running program on a list of size 10.
<discord3>
<Christophe> you still need to concatenate after, isn't that what is expensive?
<Drup>
If n² doesn't matter, then List.rev doesn't matter either, and it's better x)
<companion_cube>
I think String.concat is more efficient, right?
<companion_cube>
it computes the size of the result first
<Drup>
Pretty sure it just stuffs things in a buffer
<Drup>
(aka, O(n))
<discord3>
<Christophe> yeah, making a buffer straight rather than a list sounds like the best option anyway
<companion_cube>
no, String.concat does a series of blits into a pre-allocated buffer of the right size
tokomak has joined #ocaml
shinnya has joined #ocaml
<discord3>
<Christophe> I actually don't really know the complexity of stdlib functions, is it documented somewhere?
<companion_cube>
it's not always documented, sadly
<companion_cube>
although it's generally the best complexity possible for the corresponding data structure
<companion_cube>
what isn't documented, and should be, is tail-rec-ness
dhil has quit [Ping timeout: 240 seconds]
<discord3>
<Christophe> for the corresponding data structure, it means we should know the internal representation.
<Drup>
That's usually explicit though
<companion_cube>
exactly, it's pretty clear taht Hashtbl is a hash table :-)
<companion_cube>
Map/Set are less explicit, but it's said that they're AVL trees
<discord3>
<Christophe> For instance, I remember our teacher saying that the concatenation of two lists, seen as stacks, is linear in the size of the first list, but there might be some trick to make it constant time...
halogenandtoast has quit [Ping timeout: 256 seconds]
<companion_cube>
there is no such trick with chained lists :p
<discord3>
<Christophe> And still, it assumes you know the complexity of all those data structures
<companion_cube>
well PRs to update the docs would probably be welcome :-)
dhil has joined #ocaml
<discord3>
<Christophe> That would be my pleasure, alas, I don't have the answer to those questions :)
<ELLIOTTCABLE>
god this lexer is becoming an eldritch horror
<ELLIOTTCABLE>
if I have a type with `[@@deriving show]`, and I want to print a *list* of them, how do I go about doing so?
<ELLIOTTCABLE>
do I need to create an explicit type for `list_of_bleh` or whatever so I can add `[@@deriving show]` to `list_of_bleh` as well?
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ocaml
jao has quit [Remote host closed the connection]
jao has joined #ocaml
mk9 has joined #ocaml
tane has joined #ocaml
dtornabene has quit [Read error: Connection reset by peer]
inr_ has joined #ocaml
inr__ has joined #ocaml
inr has quit [Ping timeout: 260 seconds]
inr_ has quit [Ping timeout: 248 seconds]
ratschance has joined #ocaml
<discord3>
<Perry> Why write a lexer by hand? They are always messy that way.
<companion_cube>
argh, why does ppx-deriving now require 4.04 ???: /
<discord3>
<ELLIOTTCABLE> @Perry I'm using sedlex; but I couldn't figure out a good way to handle nested block-comments
<discord3>
<ELLIOTTCABLE> frankly I was planning to Get It Working, and then post a begging sadface post on Stack Overflow asking for help refactoring it.
<discord3>
<ELLIOTTCABLE> just pushed a working/tested impl, lemme link it
<Drup>
Just have several lexer calling each others
<discord3>
<ELLIOTTCABLE> there's my monstrosity. refactoring tips welcome, though I don't expect anybody from here to go waste their time reading it in detail rrofl
<discord3>
<ELLIOTTCABLE> the horrific block-comment-consuming algorithm is what I am most unhappy with, but hey, it passes my tests rn, sooo
<companion_cube>
gnnnnnn, ok, it's because of an issue on 4.03…