00:00
sailorCat has joined #ocaml
01:15
rgrinberg has quit [Ping timeout: 260 seconds]
01:19
rgrinberg has joined #ocaml
01:21
anpad has joined #ocaml
01:34
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
01:38
ygrek has joined #ocaml
02:04
<
discocaml >
<antomfdez> why this results always to none even if i change the list in match
02:04
<
discocaml >
<antomfdez> ```ocaml
02:04
<
discocaml >
<antomfdez> let rec aux k ac = function
02:04
<
discocaml >
<antomfdez> | [] -> if k = 0 then Some (List.rev ac) else None
02:04
<
discocaml >
<antomfdez> | h :: t -> aux (k - 1) (h :: ac) t;;
02:04
<
discocaml >
<antomfdez>
02:04
<
discocaml >
<antomfdez> match (aux 3 [] [1; 2; 3; 4; 5]) with
02:04
<
discocaml >
<antomfdez> | Some v -> Printf.printf "%s\n" (String.concat "; " (List.map string_of_int v))
02:04
<
discocaml >
<antomfdez> | None -> Printf.printf "None\n"
02:04
<
discocaml >
<antomfdez> ;;
02:04
<
discocaml >
<antomfdez> ```
02:04
<
discocaml >
<antomfdez>
02:04
<
discocaml >
<antomfdez> this is the solution VVV
02:04
<
discocaml >
<antomfdez> ```ocaml
02:04
<
discocaml >
<antomfdez> let split list n =
02:04
<
discocaml >
<antomfdez> let rec aux i acc = function
02:04
<
discocaml >
<antomfdez> | [] -> List.rev acc, []
02:04
<
discocaml >
<antomfdez> | h :: t as l -> if i = 0 then List.rev acc, l
02:05
<
discocaml >
<antomfdez> else aux (i - 1) (h :: acc) t
02:05
<
discocaml >
<antomfdez> in
02:05
<
discocaml >
<antomfdez> aux n [] list;;
02:05
<
discocaml >
<antomfdez> ```
02:05
<
discocaml >
<antomfdez> but i still dont understand the solution and dont know why i cannot use the way i was building
02:39
<
dh` >
here's a hint: what happems if you call aux 0 [1; 2]?
02:39
<
dh` >
also I think you're supposed to post stuff like that in the beginners channel :-)
02:46
Haudegen has joined #ocaml
03:43
<
discocaml >
<antomfdez> There is an API lib for discord actively maintained?
03:44
terrorjack45 has joined #ocaml
04:49
Haudegen has quit [Quit: Bin weg.]
04:49
jotik has joined #ocaml
04:50
jotik has left #ocaml [#ocaml]
05:31
Inline has joined #ocaml
05:33
agentcasey has joined #ocaml
05:34
YuGiOhJCJ has joined #ocaml
05:34
Inline has quit [Client Quit]
05:38
ygrek has quit [Remote host closed the connection]
05:42
Inline has joined #ocaml
10:35
alexherbo2 has joined #ocaml
10:53
bartholin has joined #ocaml
11:11
rgrinberg has joined #ocaml
11:18
Serpent7776 has joined #ocaml
11:35
alexherbo2 has quit [Remote host closed the connection]
11:49
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
11:52
euphores has quit [Ping timeout: 246 seconds]
11:57
luc4 has joined #ocaml
11:59
<
luc4 >
Hello! I noticed that, as soon as I try to link to the threads module, I get this segfault:
https://pastebin.com/kT59x9B4 . No code changes, just linking to it. Any idea what the cause may be?
12:00
euphores has joined #ocaml
12:02
sailorCat has quit [Remote host closed the connection]
12:03
sailorCat has joined #ocaml
12:05
rgrinberg has joined #ocaml
12:14
Haudegen has joined #ocaml
12:22
sailorCat has joined #ocaml
12:29
Tuplanolla has joined #ocaml
12:31
<
octachron >
The threads library install hooks in the runtime to handle the interaction between threads and the runtime/domain lock.
12:34
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
12:53
<
luc4 >
octachron: I see, this may explain why it makes the difference. Do you have any idea why this may happen? Do you think this is an ocaml bug?
13:02
Inline has quit [Ping timeout: 265 seconds]
13:05
Inline has joined #ocaml
13:05
Inline has quit [Remote host closed the connection]
13:05
Inline has joined #ocaml
14:04
<
octachron >
This most likely due to the C bindings that you are using making assumptions that are no longer valid once the threads library is linked.
14:05
<
octachron >
This is very unlikely to be an OCaml bug.
14:16
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
14:21
ygrek has joined #ocaml
14:28
<
luc4 >
octachron: I see, I'll have to find another way then. Thanks!
14:40
Serpent7776 has quit [Ping timeout: 276 seconds]
15:31
rgrinberg has joined #ocaml
15:48
luc4 has quit [Quit: Konversation terminated!]
16:06
Serpent7776 has joined #ocaml
16:35
Serpent7776 has quit [Ping timeout: 248 seconds]
16:47
mbuf has joined #ocaml
16:57
luc4 has joined #ocaml
17:02
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
17:12
luc4 has quit [Quit: Konversation terminated!]
17:12
rgrinberg has joined #ocaml
17:21
anpad has joined #ocaml
17:25
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
17:27
Anarchos has joined #ocaml
17:31
Anarchos has quit [Client Quit]
17:36
Anarchos has joined #ocaml
18:09
mbuf has quit [Quit: Leaving]
18:13
Haudegen has quit [Read error: Connection reset by peer]
18:18
Haudegen has joined #ocaml
18:49
ygrek has quit [Remote host closed the connection]
19:23
Haudegen has quit [Read error: Connection reset by peer]
19:27
Haudegen has joined #ocaml
19:37
Serpent7776 has joined #ocaml
19:59
Inline has quit [Ping timeout: 272 seconds]
20:35
Inline has joined #ocaml
20:45
<
discocaml >
<mikeconstantin> Hi there
20:45
rgrinberg has joined #ocaml
20:45
<
discocaml >
<mikeconstantin> Its me Mihail from Moldova
21:35
Everything has joined #ocaml
21:47
bartholin has quit [Quit: Leaving]
22:02
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
22:07
rgrinberg has joined #ocaml
22:43
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]
22:45
rgrinberg has joined #ocaml
22:57
mange has joined #ocaml
22:59
YuGiOhJCJ has joined #ocaml
23:02
Serpent7776 has quit [Ping timeout: 265 seconds]
23:05
keyboard has quit [Ping timeout: 272 seconds]
23:15
Everything has quit [Quit: Lost terminal]
23:17
Anarchos has quit [Quit: Vision[]: i've been blurred!]
23:48
rgrinberg has quit [Quit: My Unrecognized Mac has gone to sleep. ZZZzzz…]