flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
jlouis has quit ["Leaving"]
asmanur has quit [Remote closed the connection]
asmanur has joined #ocaml
kig has quit [Remote closed the connection]
ulfdoz has quit ["brb"]
ulfdoz has joined #ocaml
seafood has quit []
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
redocdam has quit [Read error: 104 (Connection reset by peer)]
eelte has quit ["bye ca veut dire tchao en anglais"]
asmanur has quit [Read error: 110 (Connection timed out)]
jeddhaberstro has quit []
GustNG2 has quit [Read error: 113 (No route to host)]
Associat0r has quit []
bluestorm has quit [Remote closed the connection]
GustNG has joined #ocaml
Jeff_123_ has joined #ocaml
ygrek has joined #ocaml
GustNG1 has joined #ocaml
Asmadeus has joined #ocaml
ygrek has quit [Remote closed the connection]
GustNG has quit [Read error: 110 (Connection timed out)]
seafood has joined #ocaml
ygrek has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
gdmfsob has quit [Read error: 104 (Connection reset by peer)]
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
gdmfsob has joined #ocaml
ygrek is now known as ygrek_away
tvn1981a has joined #ocaml
<tvn1981a> in ocaml object, how would I initialize a variable of type say Cil.file ? for instance -> val var1 = (need_some_thing_here:Cil.file)
<Jeff_123_> whath kind of type is CIL.fil? record? Variant?
<tvn1981a> it's a type
<tvn1981a> I am not sure how to declare a var of that type
<Jeff_123_> let somevar = {filename=""; globals = []; globinit = None; globinitcalled = false}
<Jeff_123_> if you don't have the Cil namespace open you might have to prepend "Cil." to each of the fields
<tvn1981a> right
<tvn1981a> thanks
<tvn1981a> so that's a record ?
<tvn1981a> also I don't know when to use object vs module
<Jeff_123_> yup it's a record
<Jeff_123_> You can use modules or objects. Just use whichever has the semantics you want, though for ocaml modules are normally considered default.
<tvn1981a> thanks
<Jeff_123_> yer welcome
ygrek_away has quit [Remote closed the connection]
<Asmadeus> Oh, while that's in the topic, how would you make uninitialized, say, file descriptor ? It's probably just an int, but I somehow doubt it'd type properly... I used to either use Unix.std* or Obj.magic if I wanted to segfault on uninitialized value, but I think that's just wrong :P
Linktim has joined #ocaml
<mfp> Asmadeus: in such situations, you can use an option
<Asmadeus> Yes, but then I'm using that fdescr reference all the time, and I don't want to either have pattern matching warning (if I do let Some fdescr = !thing), nor having to use a wrapping function that'd unbox the option
<Asmadeus> Well, I could actually do that second, but I'm lazy :p
ulfdoz has quit ["brb"]
ulfdoz has joined #ocaml
asmanur has joined #ocaml
asmanur has quit [Client Quit]
ulfdoz has quit ["deprecated"]
ulfdoz has joined #ocaml
guillem has joined #ocaml
Camarade_Tux has joined #ocaml
asmanur has joined #ocaml
asmanur has quit [Client Quit]
jlouis has joined #ocaml
ygrek_away has joined #ocaml
pantsd has joined #ocaml
ulfdoz has quit ["deprecated"]
ulfdoz has joined #ocaml
kig has joined #ocaml
seafood has quit []
LDE has quit [Read error: 110 (Connection timed out)]
Jeff_123_ has quit [Read error: 54 (Connection reset by peer)]
Jeff_123__ has joined #ocaml
Yoric[DT] has joined #ocaml
bluestorm has joined #ocaml
coucou747 has joined #ocaml
seafood has joined #ocaml
Seneka has joined #ocaml
Seneka has left #ocaml []
GustNG has joined #ocaml
pantsd has quit [Read error: 110 (Connection timed out)]
pantsd has joined #ocaml
GustNG1 has quit [Read error: 110 (Connection timed out)]
Yoric_ has joined #ocaml
Yoric[DT] has quit [Read error: 113 (No route to host)]
seafood has quit []
GustNG has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
Associat0r has joined #ocaml
Camarade_Tux has quit ["Leaving"]
jeddhaberstro has joined #ocaml
redocdam has joined #ocaml
seafood has quit []
bzzbzz has joined #ocaml
fremo has quit [Remote closed the connection]
fremo has joined #ocaml
rwmjones has joined #ocaml
jeddhaberstro has quit [Read error: 110 (Connection timed out)]
Yoric_ has quit [Read error: 113 (No route to host)]
vixey has quit ["Q"]
vixey has joined #ocaml
rwmjones has quit ["Closed connection"]
pango_ has quit [Remote closed the connection]
bluestorm has quit [Remote closed the connection]
pango_ has joined #ocaml
Camarade_Tux has joined #ocaml
Camarade_Tux_ has joined #ocaml
Camarade_Tux has quit [Read error: 110 (Connection timed out)]
bzzbzz has quit ["leaving"]
tomh has joined #ocaml
Yoric_ has joined #ocaml
tvn1981a has quit ["ChatZilla 0.9.83 [Firefox 3.0.1/2008070206]"]
GustNG has joined #ocaml
GustNG has quit ["Leaving."]
GustNG has joined #ocaml
Camarade_Tux_ has quit ["Leaving"]
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
tomh has joined #ocaml
Camarade_Tux has joined #ocaml
Camarade_Tux has quit ["Leaving"]
lde has joined #ocaml
Camarade_Tux has joined #ocaml
netx has quit [Read error: 110 (Connection timed out)]
netx has joined #ocaml
Yoric_ has quit [Read error: 113 (No route to host)]
Axioplase has joined #ocaml
authentic has quit [Read error: 104 (Connection reset by peer)]
authentic has joined #ocaml
Yoric_ has joined #ocaml
Linktim has quit ["Quitte"]
GustNG has quit [Read error: 104 (Connection reset by peer)]
marmotine has joined #ocaml
Linktim has joined #ocaml
coucou747 has quit [Read error: 110 (Connection timed out)]
coucou747 has joined #ocaml
asmanur has joined #ocaml
nDuff has quit [Remote closed the connection]
Camarade_Tux has quit ["Leaving"]
ygrek_away has quit [Remote closed the connection]
Camarade_Tux has joined #ocaml
Camarade_Tux has quit ["Leaving"]
Yoric_ has quit [Read error: 113 (No route to host)]
Camarade_Tux has joined #ocaml
Jeff_123__ has quit []
Asmadeus has quit ["nighters"]
guillem has quit [Remote closed the connection]
noohgodno has quit [Read error: 104 (Connection reset by peer)]
bluestorm has joined #ocaml
Linktim has quit ["Quitte"]
marmotine has quit ["mv marmotine Laurie"]
Camarade_Tux has quit ["Leaving"]
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
tomh has joined #ocaml
authentic has left #ocaml []
authentic has joined #ocaml
Axioplase has quit ["leaving"]
tvn1981a has joined #ocaml
<tvn1981a> can I overload function ? so that a function can take different type of parameters ? for instant printMe can take an int or a string or nothing
<bluestorm> tvn1981a: no you can't
<bluestorm> you can use parametric polymorphism, but then your function behavior can't depend on the type of the input
<tvn1981a> oh ok
<vixey> if it can take an int or a string it can't take nothing though
<bluestorm> and you can use a sum type : type printable = Int of int | String of string | Couple of printable * printable
<tvn1981a> vixey: that's what I mean by overloading -- if I call printMe (); it outputs something if I call call prineMe 3 ; it outputs something else
<bluestorm> you could also pack your values into type 'a printable = 'a * ('a -> string) values
Camarade_Tux has joined #ocaml
<bluestorm> so you'd use printMe (3, string_of_int), printMe ((), fun () -> "unit"), etc.
<vixey> tvn1981a: () is a unit
<vixey> tvn1981a: that's not nothing
<bluestorm> with some auxiliary function for convenience, that could work
TypedLambda has joined #ocaml
jlouis has quit [Remote closed the connection]
redocdam has quit []
Morphous has quit [Read error: 110 (Connection timed out)]
Morphous has joined #ocaml
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
Camarade_Tux has quit ["Leaving"]
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml