00:00
lggr has quit [Ping timeout: 246 seconds]
00:01
Submarine has joined #ocaml
00:01
Submarine has quit [Changing host]
00:01
Submarine has joined #ocaml
00:05
lggr has joined #ocaml
00:12
lggr has quit [Ping timeout: 265 seconds]
00:16
lggr has joined #ocaml
00:23
lggr has quit [Ping timeout: 240 seconds]
00:28
lggr has joined #ocaml
00:32
Yoric has joined #ocaml
00:35
lggr has quit [Ping timeout: 264 seconds]
00:39
lggr has joined #ocaml
00:45
ulfdoz_ has joined #ocaml
00:46
lggr has quit [Ping timeout: 248 seconds]
00:49
ulfdoz has quit [Ping timeout: 246 seconds]
00:49
ulfdoz_ is now known as ulfdoz
00:51
lggr has joined #ocaml
00:53
ghostbuster2 has quit [Ping timeout: 252 seconds]
00:57
lggr has quit [Ping timeout: 265 seconds]
00:59
Yoric has quit [Ping timeout: 246 seconds]
01:02
lggr has joined #ocaml
01:06
Yoric has joined #ocaml
01:08
lggr has quit [Ping timeout: 248 seconds]
01:13
lggr has joined #ocaml
01:19
madroach has quit [Ping timeout: 265 seconds]
01:19
lggr has quit [Ping timeout: 246 seconds]
01:21
madroach has joined #ocaml
01:21
Yoric has quit [Ping timeout: 245 seconds]
01:24
lggr has joined #ocaml
01:31
lggr has quit [Ping timeout: 256 seconds]
01:35
lggr has joined #ocaml
01:42
lggr has quit [Ping timeout: 248 seconds]
01:46
lggr has joined #ocaml
01:49
sgnb` has joined #ocaml
01:51
sgnb has quit [Ping timeout: 246 seconds]
01:53
lggr has quit [Ping timeout: 256 seconds]
01:54
lggr has joined #ocaml
02:01
lggr has quit [Ping timeout: 240 seconds]
02:05
lggr has joined #ocaml
02:12
lggr has quit [Ping timeout: 245 seconds]
02:17
lggr has joined #ocaml
02:23
lggr has quit [Ping timeout: 248 seconds]
02:27
lggr has joined #ocaml
02:34
lggr has quit [Ping timeout: 256 seconds]
02:38
lggr has joined #ocaml
02:45
lggr has quit [Ping timeout: 256 seconds]
02:49
lggr has joined #ocaml
02:56
lggr has quit [Ping timeout: 256 seconds]
03:00
lggr has joined #ocaml
03:07
lggr has quit [Ping timeout: 264 seconds]
03:11
lggr has joined #ocaml
03:18
lggr has quit [Ping timeout: 248 seconds]
03:22
lggr has joined #ocaml
03:29
lggr has quit [Ping timeout: 240 seconds]
03:33
lggr has joined #ocaml
03:40
lggr has quit [Ping timeout: 265 seconds]
03:44
Yoric has joined #ocaml
03:44
lggr has joined #ocaml
03:51
lggr has quit [Ping timeout: 256 seconds]
03:55
lggr has joined #ocaml
04:02
lggr has quit [Ping timeout: 256 seconds]
04:04
lggr has joined #ocaml
04:10
lggr has quit [Ping timeout: 248 seconds]
04:12
<
pippijn >
jonafan: reminds me of my computer vision time
04:15
lggr has joined #ocaml
04:22
lggr has quit [Ping timeout: 252 seconds]
04:27
lggr has joined #ocaml
04:33
lggr has quit [Ping timeout: 245 seconds]
04:38
lggr has joined #ocaml
04:39
Yoric has quit [Ping timeout: 265 seconds]
04:44
lggr has quit [Ping timeout: 256 seconds]
04:46
lggr has joined #ocaml
04:54
lggr has quit [Ping timeout: 244 seconds]
04:57
lggr has joined #ocaml
05:04
lggr has quit [Ping timeout: 240 seconds]
05:06
Xizor has joined #ocaml
05:08
pngl has joined #ocaml
05:09
lggr has joined #ocaml
05:16
lggr has quit [Ping timeout: 265 seconds]
05:18
sgnb` is now known as sgnb
05:20
lggr has joined #ocaml
05:27
lggr has quit [Ping timeout: 252 seconds]
05:31
lggr has joined #ocaml
05:33
testcocoon has quit [Ping timeout: 245 seconds]
05:36
pngl has quit [Ping timeout: 246 seconds]
05:38
lggr has quit [Ping timeout: 240 seconds]
05:43
lggr has joined #ocaml
05:49
lggr has quit [Ping timeout: 246 seconds]
05:51
testcocoon has joined #ocaml
05:51
<
pippijn >
I want to allow ocaml classes to override C++ classes
05:53
<
pippijn >
so when a C++ virtual method is called, I will call the corresponding ocaml method, if available
05:53
<
pippijn >
now I have two problems
05:53
sepp2k has joined #ocaml
05:54
lggr has joined #ocaml
05:55
<
pippijn >
the second problem is type safety
05:56
<
pippijn >
and the first problem is that I don't know how to handle the overriding properly
05:57
<
pippijn >
if the ocaml method wants to call the base class method
05:57
<
pippijn >
also, I'm not sure about my marshalling
05:58
<
_habnabit >
does C++ even have that level of metaprogramming?
05:58
<
_habnabit >
or are the methods you override fixed
05:58
<
pippijn >
they are fixed
05:58
<
pippijn >
at the C++ level, all methods are overridden
05:58
<
pippijn >
then I look up the ocaml method and if it exists, I call it
05:59
<
pippijn >
at the moment, I just call it without arguments and ignoring the return value
06:00
lggr has quit [Ping timeout: 256 seconds]
06:02
lggr has joined #ocaml
06:09
lggr has quit [Ping timeout: 256 seconds]
06:11
lggr has joined #ocaml
06:12
chambart has joined #ocaml
06:13
<
pippijn >
okay, another question
06:13
<
pippijn >
I want to catch ocaml exceptions in C, do some cleanup on the C side and then re-raise it
06:14
<
pippijn >
so I apply the closure with caml_callbackN_exn, check whether it's an exception, extract the exception, do cleanup, and then..?
06:14
<
adrien >
pippijn: say you have a 5-level deep class hierarchy with a virtual protected method at the root (not unseen)
06:14
<
adrien >
you have to generate code for methods at
_each_ level?
06:14
<
adrien >
all methods, everywhere?
06:15
<
pippijn >
that's not my problem
06:15
<
pippijn >
it's a solved one
06:15
<
pippijn >
I'm using the solution
06:16
<
adrien >
(as far as I'm concerned, I'd rather generate the objects with their vtable at runtime by using some library (I'm sure there's one))
06:17
<
pippijn >
you still need to know the vtable indices
06:17
<
pippijn >
so you need to generate type information for every class
06:17
<
pippijn >
and that code would be compiler (and -version) dependent
06:17
lggr has quit [Ping timeout: 256 seconds]
06:18
pango is now known as pangoafk
06:22
lggr has joined #ocaml
06:26
<
pippijn >
any ideas about the exception handling issue?
06:29
<
pippijn >
the exception from Extract_exception seems to be a string "`g"
06:29
lggr has quit [Ping timeout: 248 seconds]
06:33
lggr has joined #ocaml
06:37
hkBst has joined #ocaml
06:37
hkBst has quit [Changing host]
06:37
hkBst has joined #ocaml
06:40
lggr has quit [Ping timeout: 252 seconds]
06:42
Submarine has quit [Ping timeout: 264 seconds]
06:45
lggr has joined #ocaml
06:45
testcocoon has quit [Quit: Coyote finally caught me]
06:49
Snark has joined #ocaml
06:49
testcocoon has joined #ocaml
06:51
ankit9 has joined #ocaml
06:51
lggr has quit [Ping timeout: 256 seconds]
06:54
<
adrien >
pippijn: have you looked at how python, perl or ruby handle that?
06:56
lggr has joined #ocaml
07:00
Yoric has joined #ocaml
07:02
ghostbuster2 has joined #ocaml
07:03
<
pippijn >
adrien: yes, and I'm doing it the same way
07:03
lggr has quit [Ping timeout: 244 seconds]
07:04
lggr has joined #ocaml
07:08
ftrvxmtrx has quit [Quit: Leaving]
07:11
lggr has quit [Ping timeout: 240 seconds]
07:13
lggr has joined #ocaml
07:16
cacho1 has quit [Ping timeout: 264 seconds]
07:19
lggr has quit [Ping timeout: 245 seconds]
07:20
chambart has quit [Ping timeout: 246 seconds]
07:24
lggr has joined #ocaml
07:26
eikke has joined #ocaml
07:30
err404 has joined #ocaml
07:31
lggr has quit [Ping timeout: 240 seconds]
07:33
cago has joined #ocaml
07:33
cacho has joined #ocaml
07:34
mika1 has joined #ocaml
07:36
lggr has joined #ocaml
07:39
djcoin has joined #ocaml
07:40
osa1 has quit [Quit: Konversation terminated!]
07:43
lggr has quit [Ping timeout: 244 seconds]
07:47
lggr has joined #ocaml
07:54
lggr has quit [Ping timeout: 256 seconds]
07:58
lggr has joined #ocaml
08:04
ontologiae has joined #ocaml
08:05
lggr has quit [Ping timeout: 252 seconds]
08:10
lggr has joined #ocaml
08:11
Yoric has quit [Remote host closed the connection]
08:11
Yoric has joined #ocaml
08:14
Playground has joined #ocaml
08:16
lggr has quit [Ping timeout: 256 seconds]
08:18
lggr has joined #ocaml
08:25
lggr has quit [Ping timeout: 248 seconds]
08:26
Kakadu has joined #ocaml
08:30
lggr has joined #ocaml
08:37
lggr has quit [Ping timeout: 244 seconds]
08:41
lggr has joined #ocaml
08:46
chambart has joined #ocaml
08:47
lggr has quit [Ping timeout: 256 seconds]
08:49
lggr has joined #ocaml
08:50
Kakadu_ has joined #ocaml
08:57
lggr has quit [Ping timeout: 244 seconds]
09:00
lggr has joined #ocaml
09:07
lggr has quit [Ping timeout: 252 seconds]
09:07
mika1 has quit [Ping timeout: 248 seconds]
09:08
<
Kakadu_ >
pippijn: hi!
09:10
Playground has quit [Quit: leaving]
09:10
<
pippijn >
hi Kakadu_
09:11
lggr has joined #ocaml
09:12
<
Kakadu_ >
Don't you object if I call inherited class from some QObject with calling OCaml methods in all overriden C++ methods like Twin-class?
09:12
julm has joined #ocaml
09:12
<
pippijn >
I won't object
09:13
<
Kakadu_ >
so, for example, we have abstract class A : QObject and class B : A
09:13
<
Kakadu_ >
both classes should have OCaml's analogue
09:13
<
Kakadu_ >
should ocaml's A-class be virtual?
09:14
<
pippijn >
I guess so
09:16
<
Kakadu_ >
but when some method boo from class C has return type A, what type signature will be in OCaml's analogue?
09:18
lggr has quit [Ping timeout: 265 seconds]
09:20
<
pippijn >
that's difficult :)
09:20
<
Kakadu_ >
I have stopped developing lablqt somewhere here
09:21
<
Kakadu_ >
it was very confusing to hit my head up the wall when almost nobody helps you
09:22
<
Kakadu_ >
also some projects in reallife was coming
09:22
lggr has joined #ocaml
09:25
<
Kakadu_ >
pippijn: btw, It seems you are from somewhere near China?
09:26
<
pippijn >
yes, in shanghai
09:26
<
Kakadu_ >
than an offtop question especially for you
09:27
<
Kakadu_ >
Does daojiao has concept similar to apocalypto in Western religions?
09:28
ftrvxmtrx has joined #ocaml
09:29
lggr has quit [Ping timeout: 245 seconds]
09:32
<
pippijn >
I am not chinese
09:33
lggr has joined #ocaml
09:40
lggr has quit [Ping timeout: 248 seconds]
09:40
ghostbuster2 has quit [Ping timeout: 245 seconds]
09:44
lggr has joined #ocaml
09:47
filp has joined #ocaml
09:47
<
Kakadu_ >
btw, We can make twin classes for Qt classes inherited from QObject, i'm right?
09:47
filp has left #ocaml []
09:48
ghostbuster2 has joined #ocaml
09:48
<
Kakadu_ >
because QObject has property() method when in other classes we have no place to contain `pointer` to OCaml class value
09:48
<
Kakadu_ >
pippijn: ^^
09:49
<
pippijn >
well, you can always have a map<void*, value>
09:50
lggr has quit [Ping timeout: 256 seconds]
09:51
<
Kakadu_ >
crutch on the crutches :)
09:52
* Kakadu_
don't know English analogue for this
09:52
lggr has joined #ocaml
09:59
lggr has quit [Ping timeout: 256 seconds]
10:04
lggr has joined #ocaml
10:11
lggr has quit [Ping timeout: 264 seconds]
10:15
lggr has joined #ocaml
10:21
<
pippijn >
Kakadu_: how do you solve overloaded C++ methods?
10:22
lggr has quit [Ping timeout: 246 seconds]
10:22
<
Kakadu_ >
different names
10:22
<
Kakadu_ >
^"1", ^"2"
10:23
lggr has joined #ocaml
10:25
<
Kakadu_ >
pippijn: From what data do you generated code?
10:25
<
Kakadu_ >
generate*
10:26
<
pippijn >
metaclasses
10:27
<
pippijn >
qt has them
10:28
chambart has quit [Ping timeout: 265 seconds]
10:28
<
Kakadu_ >
pippijn: do you have a good link describing it?
10:29
* Kakadu_
generates a big xml via qt-jambi generator and than evaluate it
10:30
ghostbuster2 has quit [Ping timeout: 256 seconds]
10:30
lggr has quit [Ping timeout: 240 seconds]
10:31
cdidd has quit [Remote host closed the connection]
10:35
lggr has joined #ocaml
10:41
lggr has quit [Ping timeout: 245 seconds]
10:43
lggr has joined #ocaml
10:43
ghostbuster2 has joined #ocaml
10:47
cdidd has joined #ocaml
10:50
lggr has quit [Ping timeout: 248 seconds]
10:54
lggr has joined #ocaml
10:54
ankit9 has quit [Ping timeout: 240 seconds]
11:00
lggr has quit [Ping timeout: 240 seconds]
11:00
ontologiae has quit [Ping timeout: 248 seconds]
11:05
lggr has joined #ocaml
11:07
ankit9 has joined #ocaml
11:07
sepp2k has quit [Read error: Connection reset by peer]
11:08
Yoric has joined #ocaml
11:10
sepp2k has joined #ocaml
11:12
lggr has quit [Ping timeout: 265 seconds]
11:16
lggr has joined #ocaml
11:23
lggr has quit [Ping timeout: 245 seconds]
11:28
lggr has joined #ocaml
11:35
lggr has quit [Ping timeout: 248 seconds]
11:36
chambart has joined #ocaml
11:37
thomasga has joined #ocaml
11:40
lggr has joined #ocaml
11:43
thomasga has quit [Ping timeout: 264 seconds]
11:46
lggr has quit [Ping timeout: 240 seconds]
11:47
<
Kakadu_ >
pippijn: It seems printing API with QMetaClass is more comfortable than mine
11:49
<
hcarty >
thelema: Would you object to an Infix module in BatFilename with let ( // ) = Filename.concat?
11:49
<
hcarty >
thelema: Or possibly ( / )...
11:49
<
pippijn >
Kakadu_: I'm trying Smoke, now
11:49
<
pippijn >
but it seems buggy
11:50
chambart has quit [Ping timeout: 265 seconds]
11:50
<
hcarty >
thelema: ... except there is no BatFilename
11:50
<
Kakadu_ >
pippijn: I've seen smoke but I declined it by some reason which I don't remember
11:52
ski has quit [Ping timeout: 264 seconds]
11:52
lggr has joined #ocaml
11:52
thomasga has joined #ocaml
11:53
ski has joined #ocaml
11:57
thomasga has quit [Ping timeout: 246 seconds]
11:59
lggr has quit [Ping timeout: 245 seconds]
12:03
_andre has joined #ocaml
12:03
lggr has joined #ocaml
12:07
<
pippijn >
Kakadu_: too bad you don't remember
12:10
lggr has quit [Ping timeout: 256 seconds]
12:12
err404 has quit [Remote host closed the connection]
12:12
lggr has joined #ocaml
12:13
ontologiae has joined #ocaml
12:19
lggr has quit [Ping timeout: 256 seconds]
12:21
lggr has joined #ocaml
12:26
<
thelema >
hcarty: (//) is taken by Enum.filter, but I approve of this infix and have used it in odb.ml
12:28
lggr has quit [Ping timeout: 246 seconds]
12:30
lggr has joined #ocaml
12:35
fraggle_laptop has joined #ocaml
12:37
lggr has quit [Ping timeout: 245 seconds]
12:38
ski has quit [Ping timeout: 256 seconds]
12:39
ski has joined #ocaml
12:39
lggr has joined #ocaml
12:46
lggr has quit [Ping timeout: 246 seconds]
12:51
lggr has joined #ocaml
12:53
ghostbuster2 has quit [Read error: Operation timed out]
12:58
lggr has quit [Ping timeout: 256 seconds]
13:01
lggr has joined #ocaml
13:06
paolooo has joined #ocaml
13:08
lggr has quit [Ping timeout: 244 seconds]
13:13
lggr has joined #ocaml
13:15
smondet has joined #ocaml
13:15
fraggle_laptop has quit [Quit: Quitte]
13:16
fraggle_laptop has joined #ocaml
13:19
lggr has quit [Ping timeout: 256 seconds]
13:22
lggr has joined #ocaml
13:29
lggr has quit [Ping timeout: 256 seconds]
13:30
ghostbuster2 has joined #ocaml
13:31
lggr has joined #ocaml
13:34
osa1 has joined #ocaml
13:38
lggr has quit [Ping timeout: 256 seconds]
13:38
Sablier has quit [Remote host closed the connection]
13:40
lggr has joined #ocaml
13:47
lggr has quit [Ping timeout: 240 seconds]
13:49
cago has quit [Ping timeout: 248 seconds]
13:52
jlouis_ is now known as jlouis
13:53
lggr has joined #ocaml
13:55
osa1 has quit [Ping timeout: 264 seconds]
13:57
<
eikke >
is there any way to define '*!', similar like saying "let (-!) a b = ..." ?
13:57
<
thizanne >
let ( *! ) = ...
13:59
lggr has quit [Ping timeout: 252 seconds]
14:01
ghostbuster2 has quit [Ping timeout: 264 seconds]
14:01
lggr has joined #ocaml
14:08
lggr has quit [Ping timeout: 252 seconds]
14:12
lggr has joined #ocaml
14:19
lggr has quit [Ping timeout: 264 seconds]
14:21
lggr has joined #ocaml
14:28
lggr has quit [Ping timeout: 244 seconds]
14:32
ghostbuster2 has joined #ocaml
14:32
lggr has joined #ocaml
14:39
lggr has quit [Ping timeout: 246 seconds]
14:40
ftrvxmtrx has quit [Quit: Leaving]
14:44
lggr has joined #ocaml
14:46
fraggle_laptop has quit [Ping timeout: 264 seconds]
14:51
joewilliams has quit [Remote host closed the connection]
14:51
lopex has quit [Remote host closed the connection]
14:51
lggr has quit [Ping timeout: 252 seconds]
14:53
joewilliams has joined #ocaml
14:53
lggr has joined #ocaml
14:56
osa1 has joined #ocaml
14:59
lggr has quit [Ping timeout: 256 seconds]
15:02
fraggle_laptop has joined #ocaml
15:02
lggr has joined #ocaml
15:05
Yoric has joined #ocaml
15:06
joewilliams has quit [Remote host closed the connection]
15:09
lggr has quit [Ping timeout: 256 seconds]
15:09
ghostbuster2 has quit [Ping timeout: 264 seconds]
15:11
lggr has joined #ocaml
15:12
joewilliams has joined #ocaml
15:16
<
thelema >
eikke: make sure to have a space between ( and * if you don't want to start a comment
15:18
lggr has quit [Ping timeout: 256 seconds]
15:20
lggr has joined #ocaml
15:24
lggr has quit [Ping timeout: 256 seconds]
15:29
lopex has joined #ocaml
15:32
wmeyer` has quit [Ping timeout: 264 seconds]
15:32
lopex has quit [Remote host closed the connection]
15:32
hkBst has quit [Quit: Konversation terminated!]
15:35
lggr has joined #ocaml
15:39
Cyanure has joined #ocaml
15:40
hiredman has quit [Read error: Operation timed out]
15:40
hiredman has joined #ocaml
15:41
lopex has joined #ocaml
15:42
Kakadu_ has quit [Quit: Konversation terminated!]
15:42
lggr has quit [Ping timeout: 240 seconds]
15:44
Kakadu has quit [Quit: Page closed]
15:48
lggr has joined #ocaml
15:55
lggr has quit [Ping timeout: 245 seconds]
15:56
Sablier has joined #ocaml
15:57
lggr has joined #ocaml
15:59
shkk has joined #ocaml
16:04
lggr has quit [Ping timeout: 252 seconds]
16:10
lggr has joined #ocaml
16:17
lggr has quit [Ping timeout: 245 seconds]
16:17
BiDOrD_ has joined #ocaml
16:19
lggr has joined #ocaml
16:19
BiDOrD has quit [Ping timeout: 265 seconds]
16:23
shkk has left #ocaml []
16:23
julm has quit [Ping timeout: 264 seconds]
16:23
julm has joined #ocaml
16:25
lggr has quit [Ping timeout: 240 seconds]
16:28
lggr has joined #ocaml
16:32
Kakadu has joined #ocaml
16:35
lggr has quit [Ping timeout: 256 seconds]
16:36
thomasga has joined #ocaml
16:37
lggr has joined #ocaml
16:42
wmeyer has joined #ocaml
16:44
lggr has quit [Ping timeout: 240 seconds]
16:44
djcoin has quit [Quit: WeeChat 0.3.7]
16:47
rixed has quit [Quit: deménagement...]
16:49
lggr has joined #ocaml
16:50
mk270 has quit [Ping timeout: 246 seconds]
16:51
mk270 has joined #ocaml
16:53
<
hcarty >
thelema: Do you think it would be bad to have Filename.(foo // bar) <> foo // bar?
16:54
<
hcarty >
thelema: Unrelated - is there a use for Format-targeted printers in Batteries?
16:54
<
thelema >
I'm tempted to drop the // for enum.filter
16:54
<
wmeyer >
pippijn: Qt bindings ..
16:54
<
hcarty >
thelema: I'd rather have // as Filename.concat
16:55
<
wmeyer >
pippijn: I appreciate, but does the lablgtk, or just custom gui doesn't solve the problem better?
16:55
<
hcarty >
thelema: But I don't use enums very often. If I do I tend to be pretty explicit to (hopefully) avoid being bitten by their mutability.
16:55
<
thelema >
hcarty: I'm not sure about format-targeted printers
16:56
<
hcarty >
thelema: The main use I'd see for them is easier to read debugging output.
16:56
<
wmeyer >
thelema: it would be good to have a enum turorial, showing some use cases and patterns - random thought
16:56
<
hcarty >
The output of (pp_enum ~first:"<" ~last:">" ~sep:"; " pp_print_int std_formatter (1 -- 100)) is a bit easier to read than the printf "%a" equivalent.
16:56
<
thelema >
hcarty: yes, but who has a format output around?
16:56
lggr has quit [Ping timeout: 245 seconds]
16:56
<
wmeyer >
thelema: i quite like the idea of having the predefined generators
16:56
<
hcarty >
thelema: Format.std_formatter = stdout
16:57
<
thelema >
hcarty: yes, but it doesn't mix properly with other IO
16:57
<
wmeyer >
hcarty: formatter is something special
16:57
osa1 has quit [Ping timeout: 264 seconds]
16:57
<
hcarty >
wmeyer: An Enum/Seq/LazyList tutorial and comparison would be nice
16:58
<
wmeyer >
hcarty: OK, might want to do it, as someday I want to start using it.
16:58
<
thelema >
hcarty: don't forget stream
16:58
<
hcarty >
wmeyer: It really seems that way (re: formatter):-)
16:58
<
hcarty >
thelema: Indeed... there are a lot of these
16:59
<
hcarty >
thelema: You're right, it doesn't mix nicely with the core Batteries IO. I'm not sure how to address that.
16:59
lggr has joined #ocaml
16:59
* wmeyer
is going for LLVM Social meetup in CB today. Hope to know better LLVM guys, from Dragon's perspective.
16:59
<
thelema >
hcarty: FWIW, I only use enum, and whenever I need anything special I List.of_enum or Array.of_enum
17:00
<
hcarty >
thelema: It looks like format could be made to play with BatIO. I don't know how difficult/useful the result would be.
17:00
<
thelema >
hcarty: as for format + batIO, the issue with format is that it has some internal state. the solution in stdlib is to stash that in the output channel
17:01
<
hcarty >
thelema: My enum use is usually in the form of ( -- ), ( --. ) or a few custom Calendar-based versions of the same.
17:02
<
thelema >
My solution would be to have that state be hidden in a first class module with the format functions
17:05
lggr has quit [Ping timeout: 240 seconds]
17:06
<
thelema >
Although I hope that the use of formatted output is contained, and not spread across the whole program
17:08
lggr has joined #ocaml
17:11
<
thelema >
but this would be difficult to implement in OCaml
17:11
ftrvxmtrx has joined #ocaml
17:13
thomasga has quit [Quit: Leaving.]
17:15
lggr has quit [Ping timeout: 244 seconds]
17:16
<
hcarty >
thelema: That sounds reasonable. Do you know if it's possible to create fixed-width boxes for Format?
17:16
<
hcarty >
I'm looking through the documentation now...
17:17
<
hcarty >
If that's provided already then it may provide a relatively nice way to implement a Perl6::Form-like interface.
17:17
<
thelema >
Format.set_margin sets a global right margin
17:18
<
hcarty >
Format.print_as could be helpful too
17:18
<
hcarty >
or pp_print_as
17:20
<
thelema >
hcarty: true, although you'd have to do the string breaking beforehand, basically losing most of what Format would help with
17:21
lggr has joined #ocaml
17:28
lggr has quit [Ping timeout: 240 seconds]
17:28
emmanuelux has joined #ocaml
17:33
lggr has joined #ocaml
17:37
osa1 has joined #ocaml
17:37
sepp2k1 has joined #ocaml
17:37
tufisi has joined #ocaml
17:38
sepp2k has quit [Ping timeout: 264 seconds]
17:40
lggr has quit [Ping timeout: 256 seconds]
17:41
pangoafk is now known as pango
17:41
lggr has joined #ocaml
17:42
ftrvxmtrx has quit [Quit: Leaving]
17:44
ftrvxmtrx has joined #ocaml
17:48
lggr has quit [Ping timeout: 265 seconds]
17:50
lggr has joined #ocaml
17:56
ontologiae has quit [Ping timeout: 240 seconds]
17:57
lggr has quit [Ping timeout: 256 seconds]
17:58
lggr has joined #ocaml
17:59
pngl has joined #ocaml
17:59
smondet has quit [Remote host closed the connection]
18:00
<
hcarty >
gist updated with Format-friendly functions for Enum, List and Array values
18:01
<
thelema >
hcarty: nice.
18:01
<
thelema >
hcarty: I'm tempted to add these as Foo.pp
18:05
lggr has quit [Ping timeout: 265 seconds]
18:05
<
hcarty >
thelema: Feel free, or I can do so and submit it as a pull request
18:06
<
hcarty >
I think they are useful enough in their current state, even if there are issues with Format/IO mismatching.
18:06
<
thelema >
the pp_print_flush() at the end helps
18:07
lggr has joined #ocaml
18:08
<
hcarty >
They still need some cleanup - I think I'd prefer to do that before they get added in.
18:08
<
hcarty >
For example, pp_array (pp_array ...) ... looks rather ugly for some reason.
18:08
smondet has joined #ocaml
18:09
<
hcarty >
But if you're interested in using them now go ahead and add them. I/someone can always make tweaks later.
18:09
<
thelema >
Array.pp (Array.pp ...) ?
18:11
<
thelema >
Array.pp_matrix?
18:11
<
hcarty >
thelema: Effectively, yes
18:12
<
hcarty >
But it would be nice if the former "just worked"
18:12
<
thelema >
hmm, maybe Batteries should get some module refactoring... yes...
18:12
<
thelema >
I'm planning to move printing functions all into their own modules
18:12
<
hcarty >
I still want to get Umatrix -> BatMatrix (or -> BatArray.Matrix)
18:12
<
thelema >
submodules of a Printing module, probably
18:13
<
hcarty >
BatPrint.Array.(print, pp, ...)?
18:13
<
thelema >
so that BatFoo data structures can be used without linking in all of BatIO
18:13
<
thelema >
after `open Batteries`, it'll all be merged together properly into nice modules...;
18:14
<
thelema >
hmm, except documentation will not be able to adjust...
18:14
<
hcarty >
That's a handy addition. It could get ugly if any of the printers rely on hidden data.
18:14
lggr has quit [Ping timeout: 256 seconds]
18:14
<
thelema >
Maybe just BatIO.Array.(print, pp, t_printer)
18:15
<
thelema >
and then module Array = struct include Array include BatArray include BatIO.Array end
18:15
<
thelema >
hmm, if documentation could be fixed, I kind of like this factoring...
18:15
lggr has joined #ocaml
18:15
Xizor has quit [Remote host closed the connection]
18:15
<
hcarty >
ocamldoc would point point to the appropriate location, correct?
18:16
<
thelema >
well, I think we'd want a single document that documents the flattened result
18:16
<
thelema >
we can do this with stdlib because we can merge List into BatList, and provide a single BatList.mli documenting both
18:16
<
hcarty >
Ideally. That's a sometimes painful shortcoming of ocamldoc.
18:17
<
thelema >
Maybe it would suffice to have a link to the BatIO.Foo.* module in the BatFoo.mli file's comments
18:17
<
thelema >
yes, that wouldn't be too bad
18:18
<
thelema >
existence is documented inline, details slightly removed
18:18
<
thelema >
although... as soon as you use one print function, you have to link in all modules referenced in that compilation of printers... :(
18:19
<
thelema >
bah, ocaml just needs purity checks for modules so that no-op modules that aren't referenced can be dropped from final assembly
18:19
<
thelema >
a/assembly/linking/
18:19
Submarine_ has joined #ocaml
18:19
Submarine_ has quit [Changing host]
18:19
Submarine_ has joined #ocaml
18:22
lggr has quit [Ping timeout: 264 seconds]
18:24
lggr has joined #ocaml
18:31
lggr has quit [Ping timeout: 256 seconds]
18:33
lggr has joined #ocaml
18:40
lggr has quit [Ping timeout: 252 seconds]
18:42
<
hcarty >
gist improved again. Output is less ugly, but there is a leading newline in all of my tests.
18:42
ankit9 has quit [Ping timeout: 264 seconds]
18:43
lggr has joined #ocaml
18:45
<
thelema >
I see more cuts...
18:46
<
hcarty >
And I think there was an unbalanced open/close box or few
18:46
<
hcarty >
I removed the flush from each because it was messing up indentation
18:47
<
hcarty >
Although that could have been due to some other issue in the code
18:48
tufisi has quit [Ping timeout: 265 seconds]
18:49
lggr has quit [Ping timeout: 256 seconds]
18:52
lggr has joined #ocaml
18:58
lggr has quit [Ping timeout: 256 seconds]
19:01
lggr has joined #ocaml
19:06
sepp2k1 has quit [Remote host closed the connection]
19:08
lggr has quit [Ping timeout: 240 seconds]
19:08
ontologiae has joined #ocaml
19:09
<
hcarty >
I had too many cuts. After taking them out the results are inline with what the toplevel prints.
19:10
<
hcarty >
thelema: Which approach do you think you will take? BatArray.pp or BatIO.Array.pp?
19:10
<
thelema >
I think BatIO.Array.pp is the better one, although it will take more work.
19:11
<
thelema >
mixing batio into all the data structures makes it very hard to get small executables
19:11
ghostbuster2 has joined #ocaml
19:12
<
thelema >
it's good to have proper formatters; as is, I had hacked up formatters out of the print functions for use in the toplevel
19:13
<
thelema >
(see batteriesPrint.ml)
19:13
<
hcarty >
I can probably get a pull request together this evening
19:13
lggr has joined #ocaml
19:14
<
thelema >
if you can, that'll be great
19:14
<
thelema >
if you can't, no worries
19:14
<
hcarty >
I'll start by only adding the BatIO.Foo.pp functions. The rest can be shuffled around separately.
19:14
<
thelema >
sounds good to me. I can do the shuffling.
19:15
<
thelema >
hmmm, maybe it should be BatIOPrint.Foo.*
19:15
<
thelema >
so that people could use BatIO without necessarily needing all the data structures we can print.
19:16
<
thelema >
or maybe I'm trying too hard to work around a problem whose real solution is somewhere else
19:16
<
thelema >
I'd really prefer not having BatArrayPrint, etc.
19:16
<
thelema >
but I want linking to work as if that's what I had.
19:17
osa1 has quit [Read error: Operation timed out]
19:20
lggr has quit [Ping timeout: 245 seconds]
19:22
ontologiae has quit [Read error: Operation timed out]
19:23
lggr has joined #ocaml
19:26
osa1 has joined #ocaml
19:28
ghostbuster2 has quit [Ping timeout: 246 seconds]
19:29
lggr has quit [Ping timeout: 245 seconds]
19:31
ftrvxmtrx has quit [Quit: Leaving]
19:32
ftrvxmtrx has joined #ocaml
19:32
lggr has joined #ocaml
19:37
osa1 has quit [Quit: Konversation terminated!]
19:39
lggr has quit [Ping timeout: 252 seconds]
19:41
lggr has joined #ocaml
19:42
paolooo has quit [Ping timeout: 245 seconds]
19:48
lggr has quit [Ping timeout: 265 seconds]
19:51
lggr has joined #ocaml
19:58
lggr has quit [Ping timeout: 265 seconds]
19:58
<
hcarty >
Or maybe in addition to Format.
19:59
eni has joined #ocaml
20:00
lggr has joined #ocaml
20:00
<
thelema >
hcarty: that's quite simple,
20:02
<
thelema >
hmm, I like its simplicity, but I don't think it has a place in batteries
20:03
Submarine_ has quit [Quit: Leaving]
20:03
_andre has quit [Quit: leaving]
20:03
eikke has quit [Ping timeout: 265 seconds]
20:03
<
thelema >
I may add it to the odb package file and use it in some of my own projects, as Format is too complex for me
20:04
<
thelema >
except it has no build/install system/ no META file
20:07
lggr has quit [Ping timeout: 252 seconds]
20:09
eikke has joined #ocaml
20:09
lggr has joined #ocaml
20:09
<
hcarty >
thelema: It gives you a relatively simple way to pretty-print to and IO.output. That seemed like the main draw to me for inclusion.
20:10
<
hcarty >
It may be worth adding an _oasis and sending a pull request. Another item for the code todo list.
20:14
<
thelema >
I just worry that adding one more print system on top of BatIO, BatPrint and Format...
20:16
lggr has quit [Ping timeout: 240 seconds]
20:21
Kakadu has quit [Ping timeout: 252 seconds]
20:22
lggr has joined #ocaml
20:23
Xizor has joined #ocaml
20:29
lggr has quit [Ping timeout: 264 seconds]
20:31
lggr has joined #ocaml
20:38
ontologiae has joined #ocaml
20:38
lggr has quit [Ping timeout: 246 seconds]
20:39
Yoric has quit [Ping timeout: 246 seconds]
20:40
lggr has joined #ocaml
20:47
lggr has quit [Ping timeout: 252 seconds]
20:49
lggr has joined #ocaml
20:56
lggr has quit [Ping timeout: 256 seconds]
20:58
lggr has joined #ocaml
21:05
lggr has quit [Ping timeout: 244 seconds]
21:07
eni has quit [Quit: Leaving]
21:11
lggr has joined #ocaml
21:18
lggr has quit [Ping timeout: 256 seconds]
21:20
lggr has joined #ocaml
21:22
eikke has quit [Ping timeout: 240 seconds]
21:24
eikke has joined #ocaml
21:27
lggr has quit [Ping timeout: 245 seconds]
21:29
lggr has joined #ocaml
21:34
Anarchos has joined #ocaml
21:36
lggr has quit [Ping timeout: 252 seconds]
21:38
lggr has joined #ocaml
21:44
lggr has quit [Ping timeout: 256 seconds]
21:47
lggr has joined #ocaml
21:50
Snark has quit [Quit: Quitte]
21:53
Sablier has quit []
21:54
lggr has quit [Ping timeout: 265 seconds]
21:56
eikke has quit [Ping timeout: 256 seconds]
21:56
lggr has joined #ocaml
22:03
lggr has quit [Ping timeout: 264 seconds]
22:05
lggr has joined #ocaml
22:12
lggr has quit [Ping timeout: 256 seconds]
22:14
lggr has joined #ocaml
22:16
Cyanure has quit [Remote host closed the connection]
22:20
lggr has quit [Ping timeout: 246 seconds]
22:26
lggr has joined #ocaml
22:33
lggr has quit [Ping timeout: 252 seconds]
22:34
ontologiae has quit [Ping timeout: 252 seconds]
22:38
lggr has joined #ocaml
22:43
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
22:44
lggr has quit [Ping timeout: 245 seconds]
22:47
jave has quit [Ping timeout: 260 seconds]
22:50
jave has joined #ocaml
22:50
lggr has joined #ocaml
22:55
yezariaely has quit [Ping timeout: 260 seconds]
22:55
yezariaely has joined #ocaml
22:57
lggr has quit [Ping timeout: 245 seconds]
22:59
lggr has joined #ocaml
23:03
ontologiae has joined #ocaml
23:06
lggr has quit [Ping timeout: 240 seconds]
23:07
<
wmeyer >
thelema: shouldn't be that something like special case of enum, a special case of stream of characters (possibly unicode)
23:11
lggr has joined #ocaml
23:14
<
thelema >
wmeyer: format?
23:17
emmanuelux has quit [Quit: emmanuelux]
23:18
lggr has quit [Ping timeout: 240 seconds]
23:19
ontologiae has quit [Ping timeout: 240 seconds]
23:21
<
thelema >
_habnabit: examining...
23:22
<
thelema >
BatGlobal is similar, although I don't think it has reify
23:22
<
_habnabit >
yeah, BatGlobal looks similar
23:22
<
thelema >
you can add reify if you like, I'm not sure about the use case
23:23
lggr has joined #ocaml
23:25
<
_habnabit >
lazily computing parts of a structure (in this specific case, they're loaded from disk) which can depend on each other
23:25
<
_habnabit >
running to bus; bbiab
23:30
lggr has quit [Ping timeout: 248 seconds]
23:32
lggr has joined #ocaml
23:32
Yoric has joined #ocaml
23:37
<
wmeyer >
thelema: ideally the abstraction should allow to use any of these: BatIO, Format, BatPrint, in the convenient way, and the character emitter should just work. I'm afraid that it would require to change the Format module
23:38
thebifnif has joined #ocaml
23:39
<
thelema >
wmeyer: yes. BatIO undeflies BatPrint, and BatFormat has been hacked to sit on top of BatIO, but still has problems mixing with other IO
23:39
hongboz has joined #ocaml
23:39
lggr has quit [Ping timeout: 244 seconds]
23:40
<
thelema >
the main reason for this is Format's design - it's way too imperative, being designed to have a million little functions modifying channel-wide mutable state
23:41
<
hongboz >
did any know how this format style "@[@]" was implemented?
23:44
lggr has joined #ocaml
23:45
<
thelema >
@[ opens a box, @] closes one
23:46
<
thelema >
they're the same as open_*box
23:46
<
hongboz >
thelema: yes, but how was that implemented?
23:46
<
hongboz >
it needs compiler hack?
23:49
<
_habnabit >
thelema, does that use case make sense, or is there a better way to implement something like that?
23:49
<
thelema >
hongboz: I don't think so
23:50
<
thelema >
_habnabit: my vision for Format is to encapsulate the mutable state in a larger structure - along the lines of the ocaml-pretty code
23:50
<
_habnabit >
thelema, mistell?
23:50
lggr has quit [Ping timeout: 252 seconds]
23:51
<
thelema >
_habnabit: no, just uselessly vague message.
23:51
thebifnif has left #ocaml []
23:51
<
_habnabit >
thelema, sorry, you mean mine?
23:53
<
thelema >
_habnabit: yes. Instead of having a bunch of functions that mutate global or semi-global state, do something like the ocaml-pretty code and encapsulate the state nicely
23:53
<
_habnabit >
thelema, this isn't global or semi-global state, though. it's all encapsulated in a struct
23:53
<
thelema >
hongboz: look at stdlib/format.ml L1115 in the ocaml source code
23:54
<
thelema >
_habnabit: sorry, I thought you started talking about format.
23:54
<
hongboz >
thelema: thanks, I will take a look
23:54
<
thelema >
yes, I saw the paste; it's very similar to batglobal
23:54
<
_habnabit >
oh, haha
23:54
<
hongboz >
oh, I see why fprintf is so expensive
23:55
<
thelema >
_habnabit: and we can add the reify function to batGlobal, although I'd like to have a better name
23:55
lggr has joined #ocaml
23:56
<
thelema >
hongboz: yes, the format string is parsed at compile time for typing purposes, but it's also parsed at runtime to execute the printing
23:56
<
hongboz >
thelema: yes, I should add this feature to new p4
23:56
<
thelema >
It might be possible for the compiler to rewrite format commands into more basic functions, but it doesn't.
23:57
<
thelema >
hongboz: i.e. printf "a%sb" foo -> print_string "a"; print_string foo; print_string "b"
23:58
<
hongboz >
hmm, maybe more smart "a$(int:foo)b" like this?
23:58
<
thelema >
hongboz: you've seen the camlp4 that batteries has to do things like that, right?
23:59
<
hongboz >
not yet, but I have seen something in xstrp4
23:59
<
_habnabit >
thelema, reify I took from someone else's code that does the same thing. I'm open to suggestions though
23:59
<
hongboz >
it was also possible that the type would be inferred
23:59
<
thelema >
hongboz: yup.