<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]"]
<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)]