companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.2.0 released: https://ocaml.org/releases/5.2.0 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
bibi_ has quit [Quit: Konversation terminated!]
zenes has quit [Quit: zenes]
Everything has quit [Ping timeout: 246 seconds]
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
Haudegen has quit [Quit: Bin weg.]
tremon has quit [Quit: getting boxed in]
Tuplanolla has quit [Ping timeout: 248 seconds]
germ has quit [Ping timeout: 272 seconds]
germ has joined #ocaml
germ has quit [Max SendQ exceeded]
germ has joined #ocaml
germ has quit [Max SendQ exceeded]
germ has joined #ocaml
germ has quit [Max SendQ exceeded]
germ has joined #ocaml
germ has quit [Max SendQ exceeded]
germ has joined #ocaml
germ has quit [Max SendQ exceeded]
germ has joined #ocaml
germ has quit [Max SendQ exceeded]
germ has joined #ocaml
troydm has quit [Ping timeout: 245 seconds]
mbuf has joined #ocaml
bartholin has joined #ocaml
bartholin has quit [Quit: Leaving]
Serpent7776 has joined #ocaml
szkl has quit [Quit: Connection closed for inactivity]
Haudegen has joined #ocaml
mbuf has quit [Ping timeout: 245 seconds]
<discocaml> <contextfreebeer> dh`: the latest Fortran standard says that redefining constants is not permitted
<dh`> awww
<dh`> but not surprising
<discocaml> <alyxshang> Good morning, fellow 🐫. How is everyone?
<discocaml> <alyxshang> I came to the conclusion testerday that OCaml is a good foray into diversifying my experience of paradigms.❤️
<discocaml> <alyxshang> I came to the conclusion yesterday that OCaml is a good foray into diversifying my experience of paradigms.❤️
olle has joined #ocaml
mbuf has joined #ocaml
szkl has joined #ocaml
dmoerner has quit [Ping timeout: 260 seconds]
dmoerner has joined #ocaml
<discocaml> <contextfreebeer> welcome to the community
<discocaml> <alyxshang> Thank you. ❤️
<discocaml> <alyxshang> Forgive me if this is a dumb question but I'm attempting to loop through a string. Would the idiomatic way be to use recursion for this?
<discocaml> <alyxshang> Or is a for-loop fine?
mange has quit [Quit: Zzz...]
<companion_cube> A loop is fine, or String.iter
<discocaml> <octachron> Both are fine. If you are traversing the whole string, I would tend to use a for-loop and a recursive function otherwise.
<discocaml> <octachron> But anyway using a recursive function might be a good exercice (even if it not necessarily more idiomatic) .
<discocaml> <octachron> (there is also `String.fold_left` which is essentially a higher-order function implementation of a generic for-loop)
<olle> Also, use-case? Might matter for which method is best.
<olle> Like str replace rather
<discocaml> <alyxshang> Getting the position of a character in the alphabet.
Haudegen has quit [Quit: Bin weg.]
<olle> hm is the string already sorted?
<olle> and without gaps?
<discocaml> <alyxshang> Exactly. It is literally `abcdefghijklmnopqrstuvwxyz`
<olle> ok, then ascii code can be used for index, no need to loop
<discocaml> <alyxshang> How would that look?
<olle> chatgpt knows ;)
<olle> or any other LLM
<discocaml> <alyxshang> I never use AI for anything. In my view, it just makes people dumber and dumbs down the craft of writing code elegantly.
<olle> prompt like "using ocaml and ascii code for char, give me the code to calculate the index of alphabetic string like 'abcde' etc"
<discocaml> <alyxshang> I'll figure it out. 😉
<olle> well, would asking for help in a chat channel make people dumber? :D
<olle> same thing (soon enough, at least)
<discocaml> <alyxshang> No, because those are experienced real people.
<discocaml> <alyxshang> Nevermind. 🙂
<olle> hehe
<olle> (no one can prove I'm a real person btw, but that's #philosophy)
<discocaml> <contextfreebeer> do you want to solve this particular problem or getting the position of a character in any alphabet independent of specific encoding?
habnabit has joined #ocaml
habnabit_ has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #ocaml
<discocaml> <alyxshang> Already figured it out. Btw I wanted to ask, how do you annotate a function with a return type?
<discocaml> <._null._> let f (x : 'a) : 'b = e
<discocaml> <alyxshang> 🙏
Haudegen has joined #ocaml
toastal has quit [Ping timeout: 252 seconds]
toastal has joined #ocaml
berberman has quit [Quit: ZNC 1.8.2 - https://znc.in]
berberman has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
olle has quit [Ping timeout: 260 seconds]
Tuplanolla has joined #ocaml
mbuf has quit [Remote host closed the connection]
alexherbo2 has quit [Remote host closed the connection]
Haudegen has joined #ocaml
zenes has joined #ocaml
zenes has quit [Changing host]
zenes has joined #ocaml
zenes has quit [Quit: zenes]
rak has quit [Quit: Segmentation fault (core recycled)]
rak has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Anarchos has joined #ocaml
troydm has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
bartholin has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
olle__ has joined #ocaml
bartholin has quit [Quit: Leaving]
mange has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
olle__ has quit [Ping timeout: 272 seconds]
pi3ce_ has joined #ocaml
Anarchos has joined #ocaml
Everything has joined #ocaml
Anarchos has quit [Remote host closed the connection]
Serpent7776 has quit [Ping timeout: 272 seconds]
Haudegen has joined #ocaml
mercxry has joined #ocaml
pi3ce_ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]