kaustuv changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.1 out now! Get yours from http://caml.inria.fr/ocaml/release.html
Associat0r has quit ["#proglangdesign #ltu ##concurrency"]
komar_ has joined #ocaml
mjs22 has quit []
komar_ has quit [Read error: 60 (Operation timed out)]
komar_ has joined #ocaml
slash_ has quit [Client Quit]
Mr_Awesome has quit [Remote closed the connection]
mjs22 has joined #ocaml
Smerdyakov has quit ["Leaving"]
maskd has joined #ocaml
Lomono has joined #ocaml
Mr_Awesome has joined #ocaml
mjs22 has quit []
komar_ has quit [Read error: 60 (Operation timed out)]
julm has quit ["Genetic engineering: no thanks!"]
julm has joined #ocaml
komar_ has joined #ocaml
mbishop has quit [Read error: 110 (Connection timed out)]
mbishop has joined #ocaml
mbishop_ has joined #ocaml
Pepe_ has quit ["leaving"]
Ppjet6 has quit ["leaving"]
Ppjet6 has joined #ocaml
Ppjet6 is now known as Pepe_
koppology has joined #ocaml
mbishop has quit [Read error: 60 (Operation timed out)]
julm has quit [Read error: 110 (Connection timed out)]
julm has joined #ocaml
Associat0r has joined #ocaml
koppology has quit [Remote closed the connection]
<Ori_B> hm, a while ago I came across a paper about a typesafe printf replacement that used function composition
<Ori_B> does anyone know the one I'm talking about?
<thelema> batteries has a module like that
<Ori_B> ah, found it
<Ori_B> thelema: yeah, I was looking for the paper, not the module :)
eydaimon has joined #ocaml
<eydaimon> how can I see if an object will respond to a method call?
<mrvn> "respond"?
invercargill has joined #ocaml
<eydaimon> thanks
<invercargill> I'd like to know if it's possible to receive an ocaml value in an external function, store it somewhere inside the C program, and retrieve it later on from a different call originating from ocaml. I'm wondering if it's safe to do so, or if the value might get relocated in the heap after the GC runs. Anyone knows ?
<mrvn> register a root
<invercargill> Wouldn't that mean that I have to come up with a name for each object that I want to pass to the C code ?
<mrvn> invercargill: no. Just register where you store it as root.
<invercargill> Just to make sure we're talking about the same thing... you're thinking about caml_named_value(), or something else ?
Lomono has quit ["Don't even think about saying Candlejack or else you wi"]
<invercargill> mrvn. Ah I just found the right section in the manual I think "Living in harmony with the GC..."
<mrvn> No, caml_register_global_root()
<eydaimon> how can I send a message to an object? for examle, variable "call_name" contains the name of the method I want to call obj object OBJ I cant to do something like OBJ.send "call_name" which would be equiv to OBJ#call_name
<invercargill> I'll rtfm. Thanks for the pointer mrvn !
<mrvn> eydaimon: I don't think you can do that in ocaml.
<mrvn> why not use (fun () -> obj#method) instead of string?
<mrvn> eydaimon: as a side node, in C you can do callback(caml_get_public_method(foo, hash_variant("bar")), foo);
jeddhaberstro has quit []
raboof_ has joined #ocaml
<eydaimon> ok
hto has quit ["Lost terminal"]
invercargill has left #ocaml []
<eydaimon> $kissme
<eydaimon> or not
eydaimon has left #ocaml []
thanhvu has joined #ocaml
thanhvu is now known as tvn2009
xcthulhu has quit []
sgwizdak has quit [Remote closed the connection]
komar_ has quit [Read error: 60 (Operation timed out)]
raboof_ has left #ocaml []
tvn2009 has quit ["ChatZilla 0.9.85 [Firefox-3.5 3.5.1pre/20090704165003]"]
mpwd has joined #ocaml
komar_ has joined #ocaml
gim_ has joined #ocaml
gim_ has quit [Read error: 104 (Connection reset by peer)]
Associ8or has joined #ocaml
mjs22 has joined #ocaml
ulfdoz has joined #ocaml
<mfp> Ori_B: Danvy's functional unparsing http://www.brics.dk/RS/98/12/BRICS-RS-98-12.pdf
Associat0r has quit [Read error: 110 (Connection timed out)]
_zack has joined #ocaml
jeremiah has joined #ocaml
mpwd has quit [Read error: 60 (Operation timed out)]
Yoric[DT] has joined #ocaml
mpwd has joined #ocaml
mpwd has quit []
mjs22 has quit []
mpwd has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
hkBst has joined #ocaml
Yoric[DT] has quit [Read error: 113 (No route to host)]
Yoric[DT] has joined #ocaml
<C_Tux> noooooooo, they updated gobject-introspection and I need to update everything I wrote now ='(
<C_Tux> well, maybe they haven't change everything but I still have to check everything =/
Fullma has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
<C_Tux> anyone know a good tool to diff xml files? it shouldn't rely on the order of the nodes, only on the contents
<C_Tux> xmlstarlet did what I needed : it sorted the file and I could use gvimdiff afterwards, and I learned that that operation was making the xml 'canonical'
<C_Tux> (or not =/ )
Associ8or has quit ["#proglangdesign #ltu ##concurrency"]
Yoric[DT] has joined #ocaml
esope has joined #ocaml
Associat0r has joined #ocaml
esope has left #ocaml []
rwmjones_ has quit [Read error: 113 (No route to host)]
mpwd has quit []
Lomono has joined #ocaml
Alpounet has joined #ocaml
mpwd has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
_zack1 has joined #ocaml
_zack has quit [Read error: 104 (Connection reset by peer)]
_zack1 is now known as zack_
Fullma has quit ["Quitte"]
mpwd has quit []
Fullma has joined #ocaml
hkBst has quit [Read error: 110 (Connection timed out)]
Lomono has quit ["Don't even think about saying Candlejack or else you wi"]
ztfw has joined #ocaml
komar_ has quit ["WeeChat 0.2.6.3-ohshi"]
zack_ has quit ["Leaving."]
jeddhaberstro has joined #ocaml
thelema has quit [Read error: 60 (Operation timed out)]
mpwd has joined #ocaml
mpwd has quit [Client Quit]
Alpounet has quit [Remote closed the connection]
AxleLonghorn has joined #ocaml
<AxleLonghorn> say I have a type: "type register = [`Int of int | `Num of int | `Str of int | `PMC of int]"
<AxleLonghorn> and a function "let s i = `Str(i)"
<AxleLonghorn> and a function "let string_of_register = function ..."
<flux> ok, still with you :)
<AxleLonghorn> the type of string_of_register is the register type
<flux> you mean register -> string?
<AxleLonghorn> right
<AxleLonghorn> I can't use "s" to create a variant and have it accepted by string_of_register
<AxleLonghorn> er
<AxleLonghorn> missed the punchline
<AxleLonghorn> the type of "s" is [> `Str of int]
<AxleLonghorn> which is kind of ugly, and I wanted to make it look nice by using a "type strreg = [`Str of int]
<flux> actually it's [> `Str of 'a], no?
<flux> but, it works for me
<AxleLonghorn> hmmm, I'm gonna attach the code, since my storytelling sucks
<flux> type register = [`Int of int | `Num of int | `Str of int | `PMC of int] let s i = `Str(i) let string_of_register : register -> string = fun a -> "" let _ = string_of_register (s "foo");;
<flux> ah, that actually doesn't work :)
<flux> I wonder is it because it's the same compilation unit
<flux> grah, no
<flux> I was supposed to put an integer, not a string in..
<flux> so, it doesn't work for you?
<AxleLonghorn> Error: This expression has type Ptypes.intreg but is here used with type Ptypes.register. The first variant type does not allow tag(s) `Local, `Num, `PMC, `Str,
<AxleLonghorn> it's okay when "i" is of type int -> [> `Int of int]
<AxleLonghorn> I guess this makes sense, because intreg is in some sense closed to other tags
<AxleLonghorn> however, [> `Int of int] doesn't really get across what I want. I'm trying to make it clear what is required of someone who wants to use functions that take int registers
Yoric[DT] has joined #ocaml
<AxleLonghorn> I mean, [> `Int of int] isn't too bad but it doesn't help that there are locally bound registers so the type balloons to [> `Int of int | `Local of [< `Int] * string]
<AxleLonghorn> so the question is, is there no way to rewrite that to something nicer?
<C_Tux> I didn't follow everything, but what you pastebin'ed typechecks correctly here
<flux> c_tux, it does, but string_of_register (i 42) doesn't
<flux> axlelonghorn, well, you could do type 'a intreg = 'a constraint 'a = [> `Int of int ], but I doubt it is what you're looking for
<flux> because the type of i would be int -> [ > `Int of int ] intreg..
<flux> axlelonghorn, I think the only other solution is to explicitly cast
<flux> so: string_of_register (i 42 :> register)
<AxleLonghorn> hmm
<C_Tux> AxleLonghorn: I'd let ocaml do the typing for string_of_register
_zack has joined #ocaml
<AxleLonghorn> yes thank you
<AxleLonghorn> that worked
<AxleLonghorn> unfortunately it makes string_of_register not as clean looking as I would have liked, but I'll trade that for clarity on the rest of my functions that take registers
<C_Tux> AxleLonghorn: if you let ocaml do the typing, it will type string_of_register as taking only what you are matching against so the typing is still strong
ched_ has joined #ocaml
mbishop_ is now known as mbishop
ztfw` has joined #ocaml
lcars has left #ocaml []
ertai has quit ["leaving"]
* palomer thinks constraints are pretty cool
Ched has quit [Read error: 101 (Network is unreachable)]
flux has quit [Read error: 54 (Connection reset by peer)]
ztfw has quit [Connection timed out]
ztfw` has left #ocaml []
flux has joined #ocaml
<C_Tux> constraints are cool, hmmm, bindings too ><
<C_Tux> (sorry)
Yoric[DT] has quit [Read error: 113 (No route to host)]
<AxleLonghorn> how do you specify a polymorphic variant that contains a polymorphic variant
<C_Tux> use more () and [] ;)
<C_Tux> type v = [ `Int of [ `Int of int ]]
<AxleLonghorn> figured it out, thanks
<AxleLonghorn> the two times I tried it, I alternately forgot the "of" and tried to use [> ...]
<C_Tux> same here when I tried for the first time :)
sgwizdak has joined #ocaml
jeanbon has joined #ocaml
jeanbon has quit [Client Quit]
jeanbon has joined #ocaml
Associat0r has quit ["#proglangdesign #ltu ##concurrency"]
mjs22 has joined #ocaml
Fullma` has joined #ocaml
Fullma has quit [Read error: 60 (Operation timed out)]
mjs22 has quit []
peddie_ is now known as peddie
Yoric[DT] has joined #ocaml
AxleLonghorn has left #ocaml []
ulfdoz has joined #ocaml
slash_ has joined #ocaml
itewsh has joined #ocaml
bind_return has joined #ocaml
itewsh has quit [Remote closed the connection]
jeanbon has quit [Read error: 110 (Connection timed out)]
_zack has quit ["Leaving."]
Ched has joined #ocaml
ched_ has quit [Read error: 60 (Operation timed out)]
kaustuv_ is now known as kaustuv
jeddhaberstro has quit [Client Quit]
Yoric[DT] has quit ["Ex-Chat"]
maskd has quit ["leaving"]
maskd has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
slash_ has quit [Client Quit]