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
gnuvince has joined #ocaml
jmcarthur has joined #ocaml
letrec has quit [Ping timeout: 252 seconds]
KDr2 has joined #ocaml
philtor has quit [Ping timeout: 246 seconds]
datkin has quit [Ping timeout: 246 seconds]
brooksbp has joined #ocaml
fantasticsid has joined #ocaml
cdidd has joined #ocaml
brooksbp has quit [Quit: Leaving]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 245 seconds]
ulfdoz_ is now known as ulfdoz
oriba has quit [Quit: oriba]
asdfhjkl has quit [Ping timeout: 252 seconds]
datkin has joined #ocaml
avsm has quit [Quit: Leaving.]
mjonsson has joined #ocaml
bzzbzz has joined #ocaml
mjonsson has quit [Remote host closed the connection]
wagle has quit [Ping timeout: 244 seconds]
jimmyrcom has quit [Ping timeout: 264 seconds]
wagle has joined #ocaml
philtor has joined #ocaml
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
twittard has joined #ocaml
philtor has quit [Ping timeout: 244 seconds]
andreypopp has quit [Quit: Quit]
zorun has quit [Read error: Connection reset by peer]
zorun has joined #ocaml
ulfdoz has quit [Ping timeout: 248 seconds]
Snark has joined #ocaml
willb has quit [Ping timeout: 246 seconds]
willb has joined #ocaml
pango is now known as pangoafk
andreypopp has joined #ocaml
ftrvxmtrx_ has quit [Quit: Leaving]
thelema_ has joined #ocaml
thelema has quit [Read error: Connection reset by peer]
djcoin has joined #ocaml
Ptival has quit [Read error: Connection reset by peer]
Ptival has joined #ocaml
ftrvxmtrx has joined #ocaml
cago has joined #ocaml
Snark has quit [Quit: Quitte]
<adrien> hi
skchrko has joined #ocaml
skchrko has quit [Quit: ChatZilla 0.9.88.1 [Firefox 11.0/20120314111819]]
Submarine has joined #ocaml
thomasga has joined #ocaml
rks has joined #ocaml
KDr2 has quit [Remote host closed the connection]
avsm has joined #ocaml
Kakadu has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
avsm has quit [Client Quit]
KDr2 has joined #ocaml
_andre has joined #ocaml
mnabil has joined #ocaml
fraggle_ has quit [Read error: Connection reset by peer]
fraggle_ has joined #ocaml
avsm has joined #ocaml
letrec has joined #ocaml
snearch has joined #ocaml
Kakadu has quit [Quit: Page closed]
probst has joined #ocaml
lamawithonel has joined #ocaml
lamawithonel has quit [Client Quit]
Drakken has quit [Ping timeout: 244 seconds]
Drakken has joined #ocaml
jimmyrcom has joined #ocaml
iago has joined #ocaml
gnuvince has quit [Ping timeout: 276 seconds]
ocp has joined #ocaml
asdfhjkl has joined #ocaml
emmanuelux has joined #ocaml
smondet has joined #ocaml
probst has quit [Quit: probst]
gnuvince has joined #ocaml
regex has joined #ocaml
regex has quit [Client Quit]
regexBeginner has joined #ocaml
regexBeginner has quit [Client Quit]
regexBeginner has joined #ocaml
<hcarty> _andre: That sounds like a reasonable fix. Have you uploaded a newer version to oasis-db?
<_andre> hcarty: doing it right now
regexBeginner has quit [Client Quit]
ocamlBeginner has joined #ocaml
ocamlBeginner has quit [Client Quit]
<hcarty> _andre: Cool, thank you
regexBeginner has joined #ocaml
<_andre> hcarty: should i just upload as if it were a new package or is there a way to "edit" a previous upload to add a new version?
regexBeginner has quit [Client Quit]
<hcarty> _andre: If the name in the _oasis file is the same but the version is newer then you can use the same upload interface you did previously
<hcarty> _andre: That will make both versions selectable through oasis-db
<_andre> ok
<hcarty> _andre: Also, be sure to include the build system oasis generates, otherwise the package will not be installable through odb
<_andre> oh
<_andre> time for a new release then :p
KDr2 has quit [Remote host closed the connection]
<_andre> do i need "CompiledObject: best" or is that the default?
<hcarty> _andre: I don't remember... I think it may default to bytecode
<hcarty> thelema_: Is it possible to force unbuffered output for an arbitrary Batteries.IO.output?
<_andre> hcarty: ok, uploaded version 1.0.2
<hcarty> thelema_: For example, forcing Batteries' stdout to be unbuffered
<hcarty> _andre: Thank you! Unfortunately, I'm not sure how to force your version over the one I uploaded
<hcarty> Let me see what I can do from the admin interface
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
<hcarty> _andre: I don't have ospec, so the build fails
<hcarty> _andre: You could package that with oasis and add it to oasis-db as well :-)
<_andre> hrm
<_andre> i'm planning to rewrite ospec to make the syntax extension optional
<hcarty> ospec looks like an interesting tool, but I haven't had an opportunity to build and try it out
<thelema_> hcarty: not that I know of. How would you like that to be handled?
oriba has joined #ocaml
<thelema_> We can possibly flush the buffers after each IO operation
<thelema_> maybe a BatIO.make_unbuffered : 'a output -> 'a output that returns an output that flushes on each write.
<thelema_> but if you want to Printf.printf to be unbuffered by tweaking something internal to stdout, I'm less happy with that.
<hcarty> thelema_: I'm not sure what the proper interface would be, or if there really is a good, general way to do this.
<hcarty> I'm thinking of it specifically for logging and being able to force flushing of the logging output. But I'm leaning toward that being better handled at the logging code level, rather than the output level.
<thelema_> hcarty: ah, yes. The loggers should flush when they log.
snearch has quit [Quit: Verlassend]
ocp has quit [Read error: Operation timed out]
cdidd has quit [Remote host closed the connection]
ftrvxmtrx has quit [Quit: Leaving]
ulfdoz has joined #ocaml
cago has quit [Quit: Leaving.]
emmanuelux has quit [Ping timeout: 245 seconds]
letrec has quit [Ping timeout: 265 seconds]
djcoin has quit [Quit: WeeChat 0.3.2]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 265 seconds]
ulfdoz_ is now known as ulfdoz
oriba has quit [Quit: oriba]
Submarine has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
hnrgrgr has quit [Quit: leaving]
hnrgrgr has joined #ocaml
hyperbor1ean is now known as hyperboreean
twittard has quit [Quit: twittard]
Submarine has joined #ocaml
twittard has joined #ocaml
Cyanure has joined #ocaml
twittard has quit [Quit: twittard]
andreypo_ has joined #ocaml
<Drakken> I haven't been able to make a copy of a module with changes to regular values. Apparently the only things you can change are types and submodules.
<thelema_> Drakken: let Y = struct include X let x = x2 end
<thelema_> values are the easiest thing to change
<Drakken> thelema_ okay, I'll try that.
iago has quit [Read error: Operation timed out]
pangoafk is now known as pango
gnuvince has quit [Ping timeout: 276 seconds]
emmanuelux has joined #ocaml
Cyanure has quit [Ping timeout: 260 seconds]
<Drakken> Okay, what if I want to use an external type who name is exported but whose implementation is not? I tried type t = Foo.t == <the implementation copied from the original source>,
<Drakken> but the compiler says "Error: Multiple definition of the type name t."
<thelema_> Drakken: let Y = (X: type of X with type t := Foo.t)
<Drakken> thelema_ Foo is the module I'm including.
<thelema_> let Y = (Foo : type of Foo with type t = <new type>)
<thelema_> err, :=
<thelema_> type t := <new type>
<Drakken> thelema what happens to all the functions in X whose signatures include t?
<thelema_> well, this won't work if they don't also work with the new type
<Drakken> Do they have to be redefined? I'm already redefining a function that I don't need to change because it closes around the function I _do_ need to change.
<Drakken> the "new" type is just a copy of the old type.
Cyanure has joined #ocaml
<Drakken> I just need to get at its implementation.
<thelema_> you're modifying a module to make its implementation public?
<thelema_> the type
iago has joined #ocaml
<thelema_> In that case, everything should work fine.
<Drakken> I want to copy a module with one function changed, but there's another function that closes around that function. So now I'm redefining two functions, but the second function returns a value of the type whose implementation is unexported.
<Drakken> So now I need to use the type's implementation without breaking everything else in the original module.
<thelema_> hmmm..
<mrvn> you need to copy the full source of the module
<mrvn> or use Obj-magic
<thelema_> it looks like you can't break open modules with this kind of structure
<mrvn> you can't. That is the point of abstract/private types
<Drakken> obj-magic is starting to look pretty good at this point.
<thelema_> hmm, obj-magic on module types?
<mrvn> It will break horribly if the module changes its type.
<thelema_> maybe with first class modules
<mrvn> thelema_: No, Obj.magic to convert Hidden.t -> Open.t
<thelema_> mrvn: ah, yes. of course that way works. I was still thinking about this on the module level
<mrvn> Drakken: You need to replace every funtion that has a t type with one hat runs Obj.magic on each t.
<Drakken> mrvn that's every function in the module. I might as well just copy the source.
<mrvn> Drakken: let f x = M.f (Obj.magic x), probably much shorter than the full function
<thelema_> best to define conversion functions to convert to/from abstract type
<mrvn> Drakken: alternatively use Obj.magic to convert your public type to the abstract M.t
<mrvn> Drakken: Then you only need it in the two functions and your module will still use the abstract type
<Drakken> Hmmm. Actually, the module I'm including is X.Z. I tried to copy all of X, but it's too complcated. Maybe it's not so bad to copy Z and then define Y as X with Z'..
<mrvn> module Y = struct include X module Z = struct .. end end
<mrvn> What is complicated in that?
<thelema_> mrvn: actually, that's not allowed, for similar reasons that multiple definitions of a type aren't allowed in a module
<thelema_> mrvn: there's a way around it by applying a module type to X when it's included
<mrvn> Oh? Ok, then you need to seperately inlcude all X.* except Z.
<mrvn> or the type thing if that is shorter (which i doubt)
<thelema_> mrvn: module Y = struct module Z = struct ... end include (X: module type of X with module Z := Z) end
gnuvince has joined #ocaml
Cyanure has quit [Remote host closed the connection]
Cyanure has joined #ocaml
_andre has quit [Quit: leaving]
cyphase has quit [Ping timeout: 240 seconds]
cyphase has joined #ocaml
ocp has joined #ocaml
ftrvxmtrx has joined #ocaml
snearch has joined #ocaml
<iZsh> thelema_: how can I pretty print a big_int to an hexadecimal string?
<thelema_> hmmm...
ocp has quit [Ping timeout: 272 seconds]
<thelema_> :( builtin routine only does base 10...
<iZsh> yeah it sucks
<iZsh> I need to do 2 ** n - 1 and print it as a mask
jderque has joined #ocaml
<iZsh> I can do modulo and shits
<iZsh> but it's annoying
<mrvn> Printf.printf "0x%x\n" ((1 lsl n) - 1)
<iZsh> mrvn: you're missing the point
<thelema_> investigate the file ocaml-3.12.1/otherlibs/num/nat.ml function unadjusted_string_of_nat
<thelema_> iZsh: you need to print a hex value of 2**n-1 for large n?
<iZsh> yes
<mrvn> just print?
<iZsh> mrvn: it's a bigint!
<thelema_> umm, "0x" ^ (String.init (n/4) "F")
<thelema_> err, String.create
<thelema_> and 'F'
<iZsh> thelema_: yeah, but that works only for such masks :)
<mrvn> plus n mod 16 as hex
<mrvn> n mod 4 I mean
<mrvn> iZsh: so you need a bugint_to_hex function?
<thelema_> so you do need a full general big-int to hex function?
<thelema_> or you can get away with something that just works for a small subset of bigints?
<iZsh> yeah, I guess I can do modulo/div
<iZsh> (recursively and concat)
<thelema_> iZsh: I think you might have to do that. If you come up with a good solution, we should put it in batteries
<iZsh> but I was hopping for something smarter or already available
<thelema_> (I'm pretty sure there isn't one already)
<iZsh> ok, thx
<mrvn> iZsh: unless you look into the internal representation of Bigint you can't do better tha mod/div
<thelema_> how big are your masks?
<iZsh> thelema_: I can't know in advance
<thelema_> possibly > 128 bits?
<iZsh> possibly yes
<thelema_> ok. Then you're going down the right path, I think.
<mrvn> iZsh: Carve the Bigint up into 60 bit chunks and print them with %015x
<thelema_> You may be able to shift off 64-bits at a time from a big int and use %Lx
<mrvn> thelema_: no unsigned int64 in ocaml
<iZsh> and there is no shift operator, only divide
<iZsh> oh well, n/m, I'll go the obvious path then :)
<thelema_> # Printf.printf "%Lx" Int64.min_int;;
<thelema_> 8000000000000000
<iZsh> it's not critical, it was just in case something was already available in batteries
<mrvn> thelema_: oh, interesting.
<thelema_> iZsh: there is shift operator...
<thelema_> val shift_right_big_int : big_int -> int -> big_int
<mrvn> thelema_: not in my Big_int module
<mrvn> thelema_: Batteries?
<thelema_> at the very bottom
<mrvn> thelema_: new in 3.12
<thelema_> iZsh: can you use zarith? It has a "to_bits"
<thelema_> also, format "%x" might work
<iZsh> zarith?
<thelema_> a very nice bigint library
<thelema_> better than ocaml's builtin
<thelema_> yup, it prints to hex
<iZsh> I'll keep that in mind, I'm not sure I want to add an extra dependency
<iZsh> thx
<mrvn> You can use "int64_of_big_int (extract_big_int x i (i+63))" in 3.12 to extract 64bit chunks.
<thelema_> I think i+64
<thelema_> very odd that it's not a length like everything else...
<mrvn> Actually "x i 64"
<thelema_> n/m, it is.
<mrvn> bits ofs to ofs + n - 1
<thelema_> yup
<mrvn> Why is there no big_int / int?
<thelema_> cation and addition somehow are special...
<thelema_> *multiplication
jderque has quit [Quit: leaving]
rwmjones has quit [Read error: Operation timed out]
ulfdoz has quit [Read error: Operation timed out]
rwmjones has joined #ocaml
snearch has quit [Quit: Verlassend]
oriba has joined #ocaml
Xizor has joined #ocaml
andreypo_ has quit [Quit: Quit]
zorun has quit [Read error: Connection reset by peer]
zorun has joined #ocaml
Submarine has quit [Remote host closed the connection]
Tobu has quit [Ping timeout: 260 seconds]
Tobu has joined #ocaml
Cyanure has quit [Ping timeout: 245 seconds]
thomasga has quit [Quit: Leaving.]
iago has quit [Ping timeout: 246 seconds]
diml has quit [Ping timeout: 244 seconds]
ski has quit [Ping timeout: 244 seconds]
KDr2 has joined #ocaml
diml has joined #ocaml
letrec has joined #ocaml
ski has joined #ocaml