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