al-damiri has quit [Quit: Connection closed for inactivity]
SomeDamnBody has joined #ocaml
moei has quit [Quit: Leaving...]
cbot has joined #ocaml
gtrak has quit [Ping timeout: 240 seconds]
gtrak has joined #ocaml
mfp has quit [Ping timeout: 260 seconds]
mfp has joined #ocaml
gtrak has quit [Ping timeout: 260 seconds]
silver_ has quit [Read error: Connection reset by peer]
gtrak has joined #ocaml
jaar has quit [Ping timeout: 260 seconds]
Soni has quit [Read error: Connection reset by peer]
cbot_ has joined #ocaml
Soni has joined #ocaml
cbot has quit [Ping timeout: 256 seconds]
btbytes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
btbytes has joined #ocaml
btbytes has quit [Ping timeout: 265 seconds]
moei has joined #ocaml
mfp has quit [Ping timeout: 268 seconds]
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 260 seconds]
tonyle has joined #ocaml
tonyle has quit [Client Quit]
gtrak has quit [Ping timeout: 268 seconds]
gtrak has joined #ocaml
pierpa has quit [Quit: Page closed]
argent_smith has joined #ocaml
ygrek has quit [Ping timeout: 268 seconds]
donviszneki has quit [Ping timeout: 260 seconds]
shinnya has quit [Ping timeout: 260 seconds]
donviszneki has joined #ocaml
donviszneki has quit [Ping timeout: 240 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
argent_smith has quit [Quit: Leaving.]
<discord3>
<mars0i> Anyone have a quick explanation of this? # fun x -> x 42;; - : (int -> 'a) -> 'a = <fun> What the heck? There's nothing between the x and the integer. It looks like it should be a syntax error. And why that signature? Without polymorphism: # fun x -> 2 * x 3;; - : (int -> int) -> int = <fun>
<discord3>
<mars0i> Moving the question to discuss.ocaml. (Someone might want to answer there when back on online. 😃 )
bartholin has quit [Ping timeout: 248 seconds]
<discord3>
<mars0i> I figured it out. OCaml sees x 42 as an application of a function to 42, so a function must be passed as x, and it must accept an int as its argument.
bartholin has joined #ocaml
kvda has joined #ocaml
<discord3>
<mars0i> Duh. It's obvious now.
jbrown has quit [Ping timeout: 256 seconds]
mbuf has joined #ocaml
shinnya has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
donviszneki has joined #ocaml
<xvilka>
Hi! What is the most efficient yet OCaml-ish way to read ASCIIZ string from buffer (bytes) in OCaml? Basically reading characters until zero?
shinnya has quit [Ping timeout: 268 seconds]
mk9 has quit [Quit: mk9]
<donviszneki>
xvilka: what do you want to do with them once you've read them?
donviszneki is now known as hdon
hdon has quit [Changing host]
hdon has joined #ocaml
<hdon>
for example if you were going to take a slice of your buffer from index 0 to index n where n is where you encounter your termination character, then a recursive function is very ocamly and will do the trick:
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<xvilka>
this is what I currently wrote
<xvilka>
asking if there is a better way
<flux[m]>
in particular let str1 = str ^ String.make 1 ch in is inefficient
<flux[m]>
if you want to collect a set of strings and make one big string of them, I suggest you use Buffer
<flux[m]>
(alternatively you can collect a list of strings and then use String.concat)
<xvilka>
flux[m]: but how collecting a list can be done? I mean I don't know where the end of the string is, so I have to search zero character
kvda has joined #ocaml
<flux[m]>
well, you could use String.index_from buf pos '\000' and then use String.sub on that
<flux[m]>
avoiding the first String.sub and this collecting stuff altogether
<xvilka>
flux[m]: aha, this sounds good
<flux[m]>
but it seems you want to support strings that span multiple chunks, so for that case you would use Buffer. Buffer also supports adding substrings directly.
<xvilka>
hdon: those target text parsing I think, I am working with binary formats
<xvilka>
I use Cstruct heavily already
<hdon>
mmm... yeah i thought that might be an issue :)
cbot_ has quit [Quit: Leaving]
discord3 is now known as discord
hdon has quit [Ping timeout: 256 seconds]
<kvda>
I'm doing Ruby right now, kill me
jao has quit [Ping timeout: 248 seconds]
hdon has joined #ocaml
shw has left #ocaml [#ocaml]
<xvilka>
I always wondered, if it is possible to have a different highlight of different function arguments across the function body in OCaml, to improve the speed of reading
<xvilka>
I use Vim, where it seems impossible to do, does anyone know if there are other editors that support this?
caltelt_ has quit [Ping timeout: 260 seconds]
sagotch has joined #ocaml
SomeDamnBody has quit [Ping timeout: 240 seconds]
dhil has joined #ocaml
larhat has joined #ocaml
sgnb has quit [Remote host closed the connection]
sgnb has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
tarptaeya has joined #ocaml
ratschance has quit [Remote host closed the connection]
ratschance has joined #ocaml
TarVanimelde has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
Haudegen has joined #ocaml
mfp has joined #ocaml
FreeBirdLjj has joined #ocaml
silver has joined #ocaml
TarVanimelde has quit [Quit: TarVanimelde]
tarptaeya has quit [Remote host closed the connection]
tarptaeya has joined #ocaml
<discord>
<rizo> One Vim plugin I sometimes use is cursorword. It underlines all occurrences of the word under the cursor. https://github.com/itchyny/vim-cursorword
jaar has joined #ocaml
zolk3ri has joined #ocaml
dhil has quit [Ping timeout: 256 seconds]
larhat has quit [Quit: Leaving.]
nephanth has joined #ocaml
mbuf has quit [Quit: Leaving]
jaar has quit [Ping timeout: 248 seconds]
mal``` has quit [Quit: Leaving]
mengu has joined #ocaml
mal`` has joined #ocaml
<discord>
<n4323> this would be cool to combine with :MerlinOccurences
<discord>
<n4323> i would also like to have a type-browsing mode where the :MerlinTypeOf is continuously displayed when the cursor or mouse is over something
gtrak has quit [Ping timeout: 248 seconds]
gtrak has joined #ocaml
nephanth has quit [Ping timeout: 260 seconds]
ziyourenxiang has joined #ocaml
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
dhil has joined #ocaml
malina has joined #ocaml
jao has joined #ocaml
gtrak has quit [Ping timeout: 264 seconds]
nephanth has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
dhil has quit [Ping timeout: 260 seconds]
gtrak has joined #ocaml
mengu has quit [Read error: Connection reset by peer]
mengu_ has joined #ocaml
flodin has quit [Quit: Konversation terminated!]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
Haudegen has quit [Remote host closed the connection]