00:06
pierpal has joined #ocaml
00:10
pierpal has quit [Ping timeout: 245 seconds]
00:12
carlosdagos has quit [Ping timeout: 250 seconds]
00:24
Haudegen has quit [Remote host closed the connection]
01:04
zolk3ri has quit [Remote host closed the connection]
01:09
silver has quit [Read error: Connection reset by peer]
01:32
xuib has quit [Quit: xuib]
01:43
mfp has quit [Ping timeout: 258 seconds]
02:02
ziyourenxiang has joined #ocaml
02:13
pierpal has joined #ocaml
02:18
pierpal has quit [Ping timeout: 258 seconds]
02:33
ocabot has joined #ocaml
02:34
companion_cube has joined #ocaml
03:25
ihavelotsoffries has joined #ocaml
03:26
ihavelotsoffries has quit [Changing host]
03:26
ihavelotsoffries has joined #ocaml
03:26
ihavelotsoffries has joined #ocaml
03:26
<
ihavelotsoffries >
Hello
03:27
ihavelotsoffries has quit [Remote host closed the connection]
03:27
ihavelotsoffries has joined #ocaml
03:28
ihavelotsoffries has quit [Changing host]
03:28
ihavelotsoffries has joined #ocaml
03:28
ihavelotsoffries has joined #ocaml
03:39
ihavelotsoffries has quit [Remote host closed the connection]
03:50
FreeBirdLjj has joined #ocaml
03:54
FreeBirdLjj has quit [Ping timeout: 245 seconds]
04:18
gravicappa has joined #ocaml
04:21
pierpal has joined #ocaml
04:25
pierpal has quit [Read error: Connection reset by peer]
04:38
oni-on-ion has quit [Remote host closed the connection]
04:39
oni-on-ion has joined #ocaml
04:42
Birdface has joined #ocaml
04:43
ygrek has quit [Ping timeout: 268 seconds]
05:18
_whitelogger has joined #ocaml
05:42
_whitelogger has joined #ocaml
06:06
_whitelogger has joined #ocaml
06:18
_whitelogger has joined #ocaml
06:30
tg has quit [Ping timeout: 245 seconds]
06:36
tg has joined #ocaml
06:39
kakadu has joined #ocaml
06:41
ihavelotsoffries has joined #ocaml
06:41
ihavelotsoffries has joined #ocaml
06:41
ihavelotsoffries has joined #ocaml
06:41
ihavelotsoffries has quit [Changing host]
06:41
<
ihavelotsoffries >
Is this the right place to ask questions about dune?
06:41
oni-on-ion has quit [Remote host closed the connection]
06:44
oni-on-ion has joined #ocaml
06:50
<
ihavelotsoffries >
oni-on-ion Hello!
06:50
<
ihavelotsoffries >
sorry I got disconnected.
06:51
<
def` >
yes it is the right place
06:51
<
ihavelotsoffries >
def` the right place ;)
06:51
<
oni-on-ion >
hi, its ok ive been d/c-ing myself
06:52
<
ihavelotsoffries >
And when I try to build the project with dune, I get: "Error: Unbound value Obj.magic"
06:52
<
ihavelotsoffries >
and it happens in the parser generated by menhir.
06:52
<
ihavelotsoffries >
On top level, I can look at "Obj.magic" and it seems to be there, obviously.
06:53
<
ihavelotsoffries >
Even more, merlin can find it, using the .merlin file generated by dune itself.
06:54
<
oni-on-ion >
may need preprocess ?
06:57
<
ihavelotsoffries >
hmmm, let me check.
07:01
<
ihavelotsoffries >
I don't think so, you don
07:01
<
ihavelotsoffries >
...'t need a ppx to use Obj.
07:03
<
oni-on-ion >
dune needs the same info that toplevel (utop? findlib?) and merlin have
07:09
<
ihavelotsoffries >
well, dune uses ocamlfind if it is installed.
07:10
<
def` >
ihavelotsoffries: do you have a module named Obj?
07:10
<
ihavelotsoffries >
okay, here is a simple one: can't compile `let _ = Obj.magic "no-magic"` with dune.
07:10
<
ihavelotsoffries >
probs not. I will search.
07:11
<
ihavelotsoffries >
OMG.
07:11
<
ihavelotsoffries >
Aren't I a dummy?
07:11
<
ihavelotsoffries >
Thank you so much def`!
07:11
<
ihavelotsoffries >
Thank you! thank you thank you.
07:11
<
ihavelotsoffries >
I have been banging my head over this one for a bit now!
07:11
<
ihavelotsoffries >
and viola! my parser compiles and runs!
07:12
<
ihavelotsoffries >
For future reference, how can I interrogate to display what module it finds?
07:15
<
def` >
What do you mean?
07:18
<
ihavelotsoffries >
I want to know what dune finds for say pkg `X`, as in give me the path to this module.
07:19
<
def` >
hmm, that's not a direct answer to your question but
07:19
<
def` >
`ocamlfind query X` will give you the folder where the contents of the package is stored
07:20
<
ihavelotsoffries >
cool, thanks!
07:20
<
def` >
all cmi files is this folder will be modules visible from OCaml
07:20
<
def` >
in this folder*
07:21
<
ihavelotsoffries >
I see, cmi being ocaml IR files?
07:22
<
ihavelotsoffries >
sort of like LLVM IR?
07:22
<
def` >
more or less, it is a bit different.
07:22
<
def` >
cmi files are "interface files", they contain what the typechecker needs to know about a module, but nothing about implementation.
07:22
<
def` >
(a kind of compiler ".h" if you compare to C)
07:23
<
ihavelotsoffries >
Okay, I will read up on them more.
07:23
<
ihavelotsoffries >
Time for more coding for me!
07:23
<
ihavelotsoffries >
Thank you :)
07:25
<
def` >
but you should probably focus on learning the language first (rather than how the implementation works :P)
07:25
<
ihavelotsoffries >
Getting there, about to finish chapter 2 now :)
07:25
<
ihavelotsoffries >
talk later!
07:25
ihavelotsoffries has quit [Remote host closed the connection]
07:30
_whitelogger has joined #ocaml
08:19
oni-on-ion has quit [Remote host closed the connection]
08:29
Niamkik has joined #ocaml
08:43
oni-on-ion has joined #ocaml
09:04
zv has quit [Ping timeout: 258 seconds]
09:18
_whitelogger has joined #ocaml
09:37
mfp has joined #ocaml
09:57
jnavila has joined #ocaml
10:04
Haudegen has joined #ocaml
10:05
<
amosbird >
heh, llpp generates suspicious warning: freetype getting character advance: invalid argument
10:08
<
amosbird >
what's the right way to test if a string is empty?
10:13
<
Armael >
yourstring <> "" ?
10:14
<
Armael >
uh sorry, yourstring = ""
10:49
bacam has quit [Quit: reboot]
11:00
silver has joined #ocaml
11:04
bacam has joined #ocaml
11:09
oni-on-ion has quit [Remote host closed the connection]
12:01
zolk3ri has joined #ocaml
12:15
silver has quit [Read error: Connection reset by peer]
12:22
keep_learning_M has quit [Quit: This computer has gone to sleep]
12:22
keep_learning_M has joined #ocaml
13:14
<
amosbird >
hmm, what's wrong with this? begin match self#elemunder @@ Printf.sprintf "%d" c with
13:19
dstolfa_ has joined #ocaml
13:19
dstolfa has quit [Ping timeout: 245 seconds]
13:22
<
def` >
I can't say anything without more context
13:23
ggole has joined #ocaml
13:28
<
amosbird >
I need to convert '1' to 1
13:29
<
def` >
int_of_string
13:31
<
amosbird >
even if that is a char?
13:34
<
ggole >
let int_of_decimal_char = function | '0'..'9' as char -> Char.code char - Char.code '0' | _ -> invalid_arg "non-decimal character"
13:40
<
amosbird >
hmm, does ocaml have negative index?
13:40
<
amosbird >
[-1] for accessing the last element of a list
13:45
<
amosbird >
so what's the right way to index a list reversely? m_items.(active)
13:48
<
def` >
it seems you are manipulating an array, not a list (they are very different things in ML).
13:48
<
def` >
m_items.(Array.length m_items - 1)
13:50
<
amosbird >
why is this wrong ? method exit2 _ _ = None
13:51
<
def` >
You have to say where 'c is bound / quantified.
13:52
<
def` >
method exit2 : 'a 'b 'c. 'a -> 'b -> 'c option
13:52
<
def` >
this should be ok
13:52
<
amosbird >
hmm, I don't follow
13:52
<
amosbird >
the declaration is method exit2 : cancel:bool -> active:int -> uioh option
13:53
<
amosbird >
I need to provide a default implementation that always returns a None
13:53
<
def` >
try `method exit2 ~cancel:_ ~active:_ = None`
13:54
<
amosbird >
The method exit2 has type cancel:'a -> active:'b -> 'c option where 'c
13:54
<
amosbird >
is unbound
13:55
ygrek has joined #ocaml
13:57
<
octachron >
if you are defining the method independently of the declaration/class type/virtual class, you need to add an explicit type annotation to exit2
13:58
<
amosbird >
octachron: hmm, how can I do that?
14:00
<
amosbird >
how can I return a Config.uioh option instead of 'a option?
14:00
<
amosbird >
is None typable?
14:03
AtumT has joined #ocaml
14:03
<
ggole >
Add an annotation, eg, method x y : return_type = None
14:04
<
ggole >
You might want annotations on the arguments as well.
14:05
<
amosbird >
method exit2 ~cancel:_ ~active:_ : uioh option = None
14:05
<
amosbird >
The method exit2 has type cancel:'a -> active:'b -> Config.uioh option
14:05
<
amosbird >
where 'b is unbound
14:05
<
amosbird >
very confused
14:07
<
ggole >
If you have free type variables in a class, you are going to have that problem. You can either make them polymorphic as def` suggested, or get rid of them with annotations.
14:09
<
amosbird >
ggole: well I tried both your suggestion with annotations and def` 's
14:09
<
amosbird >
neither works.
14:10
<
def` >
Add a type annotation on the class, e.g. `class virtual lvsourcebase : lvsource = ...`
14:10
<
def` >
Otherwise there is no relation between lvsourcebase and lvsource
14:11
<
amosbird >
def`: but that requires the class to have all methods defined
14:11
<
ggole >
method exit2 ~cancel:(_ : bool) ~active:(_ : int) : uioh option = None
14:11
<
ggole >
(And the same thing for the other errors which will pop up.)
14:12
<
amosbird >
thanks that works
14:12
<
amosbird >
hmm, overriden isn't allowed in ocaml?
14:12
<
amosbird >
Error (warning 7): the method hasaction2 is overridden.
14:13
<
def` >
It is a warning.
14:13
<
def` >
Put a bang after method to silence it
14:13
<
octachron >
Another option is to define lvsource as a virtual class (with all methods virtual) then inherit lvsource in lvsourcebase
14:14
<
amosbird >
I've defined another virtual class...
14:14
<
amosbird >
anyway it works out
14:14
<
amosbird >
thank you!
14:17
<
amosbird >
def`: putting that bang in where exactly?
14:22
dhil has joined #ocaml
14:26
<
octachron >
method!
14:27
<
amosbird >
Error: The method `hasaction2' has no previous definition
14:28
<
ggole >
You only use method! for overriding
14:57
dhil has quit [Ping timeout: 250 seconds]
15:16
<
amosbird >
is it the right one to use?
15:17
<
amosbird >
what's the recommended package to talk to dbus using ocaml?
15:24
Facebird has joined #ocaml
15:25
Birdface has quit [Ping timeout: 264 seconds]
15:55
<
amosbird >
why does ocamlopt need a -linkpkg flag?
15:57
ygrek has quit [Ping timeout: 245 seconds]
16:04
xuib has joined #ocaml
16:18
AnAverageHuman has joined #ocaml
16:33
ziyourenxiang has quit [Ping timeout: 245 seconds]
16:42
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
16:59
dimitarvp has joined #ocaml
17:07
AnAverageHuman has quit [Ping timeout: 256 seconds]
17:08
zv has joined #ocaml
17:11
dimitarvp has quit [Quit: Bye]
18:33
AnAverageHuman has joined #ocaml
19:02
Haudegen has quit [Remote host closed the connection]
19:19
gravicappa has quit [Ping timeout: 245 seconds]
19:22
troydm has joined #ocaml
19:39
gravicappa has joined #ocaml
19:42
Jeanne-Kamikaze has joined #ocaml
19:45
jnavila has quit [Ping timeout: 276 seconds]
19:49
Guest87353 has joined #ocaml
19:51
Guest87353 has quit [Read error: Connection reset by peer]
19:54
zolk3ri has quit [Remote host closed the connection]
19:55
jao has joined #ocaml
20:00
silver has joined #ocaml
20:05
ggole has quit [Quit: Leaving]
20:05
gravicappa has quit [Ping timeout: 250 seconds]
20:12
TheRuralJuror has joined #ocaml
20:12
Jeanne-Kamikaze has quit [Quit: Leaving]
20:14
TheRuralJuror has quit [Remote host closed the connection]
20:14
Haudegen has joined #ocaml
20:32
Keodedad has joined #ocaml
20:36
Keodedad has quit [Client Quit]
21:16
AnAverageHuman has quit [Ping timeout: 256 seconds]
21:35
AnAverageHuman has joined #ocaml
21:40
AnAverageHuman has quit [Ping timeout: 256 seconds]
21:42
Jesin has quit [Quit: Leaving]
21:48
Jesin has joined #ocaml
21:58
Facebird has quit [Ping timeout: 250 seconds]
22:19
kakadu has quit [Remote host closed the connection]
22:45
ziyourenxiang has joined #ocaml
22:52
Haudegen has quit [Remote host closed the connection]
22:58
zv has quit [Ping timeout: 264 seconds]
23:02
oni-on-ion has joined #ocaml
23:16
zv has joined #ocaml
23:39
weird_error has quit [Quit: weird_error]