gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0+beta1 http://permalink.gmane.org/gmane.comp.lang.caml.inria/49168
mbishop__ has quit [Read error: Connection reset by peer]
travisbrady has quit [Quit: travisbrady]
mbishop__ has joined #ocaml
EvanR has joined #ocaml
<EvanR> according to this ocaml for java programmers tutorial + +. * *. cant be overloaded. they are only for ints and floats respectively. so that makes them monomorphic functions. is there *any* way in ocaml to define + and * for other types like complex?
fschwidom has quit [Read error: Connection reset by peer]
<olegfink> EvanR: this doesn't have anything to do with ( + ) and ( * ) specifically
<EvanR> not those characters, no
<olegfink> overloading is not the same as parametric polymorphism; you can easily have the latter in ocaml, but not the former
<EvanR> so no adhoc polymorphism
<Associat0r> you should check out delimited operator overloading
<olegfink> yes, there are hacks that would allow you to use those characters for more than a single type, but yes, ocaml doesn't support ad hoc polymorphism
<EvanR> whats the idiomatic way to have some other numeric type thats not int or float
<olegfink> you may want to look at stdlib modules like Int32 and friends, and if you're speaking about overloading arithmetic functions, Associat0r's suggestion will help
<EvanR> no just, how to write a complex addition
<EvanR> complex_add a b
<olegfink> I'm not really sure I understand what you're asking; again you may use Complex module as a reference
<EvanR> i see functions add and mul for Int32
<EvanR> same for Complex
<EvanR> ok, so we save our sanity with a module system
<olegfink> in the standard library, the naming of those functions is just a convention; it is somewhat enforced by pa_do
<EvanR> pa_do ?
<EvanR> is there a single precision type
<olegfink> I don't think ocaml has a single-precision floating point type
<EvanR> hold the phone, i just discovered (<) : 'a -> 'a -> bool, i can see its parametrically polymorphic, but how does it manage to work without knowing its input types?
<EvanR> it doesnt work on just int and float
<olegfink> (<) is magic.
<EvanR> is this some of that < overloading thing Associat0r was talking about
bacam has quit [Ping timeout: 248 seconds]
bacam has joined #ocaml
<olegfink> no, this is a built-in ordering that is defined in the usual way for usual types and then extended to all types
<EvanR> sort of like ad hoc polymorphism
<EvanR> in disguise
<olegfink> it is not a language feature, you can't (easily) define your own (<)
<EvanR> ok
Edward__ has quit []
<EvanR> it says that (==) : 'a -> 'a -> bool has an implementation dependent result when applied to 'non mutable' structures
<EvanR> what does that mean in practice
<olegfink> that two structures that are (=) may be (!=)
<olegfink> if you know java or some such, (=) vs. (==) is like .equals() vs. ==
<olegfink> if String s1.equals(String s2), it doesn't imply s1==s2
Associat0r has quit [Quit: Associat0r]
<EvanR> k i dont really know java
<EvanR> physical equality
<EvanR> i get it
<EvanR> so for non mutable structures i should just use =
<EvanR> because == is defined in terms of mutation
<olegfink> you should almost always use =
<EvanR> ok
<EvanR> does ocaml have subtype polymorphism
_unK has quit [Remote host closed the connection]
sshc has joined #ocaml
sshc has quit [Read error: Connection reset by peer]
sshc has joined #ocaml
jeddhaberstro has joined #ocaml
elehack has joined #ocaml
<elehack> thelema, thanks for the 1.2.2 release. it works & has been pushed to GODI.
seanmcl has quit [Quit: seanmcl]
_JFT_ has quit [Quit: _JFT_]
bacam has quit [Read error: Operation timed out]
bacam has joined #ocaml
pad has quit [Remote host closed the connection]
elehack has quit [Quit: Goodbye...]
jonafan_ has joined #ocaml
mbac has joined #ocaml
jonafan has quit [Ping timeout: 264 seconds]
mbishop__ has quit [Ping timeout: 265 seconds]
valross has quit [Ping timeout: 260 seconds]
thrasibule has joined #ocaml
valross has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
mbishop has joined #ocaml
psnively has joined #ocaml
ulfdoz has joined #ocaml
<thelema> EvanR: (<) works on the runtime representations of the given two values.
<thelema> EvanR: ocaml requires explicit subtype coercion.
psnively has quit [Quit: psnively]
pad has joined #ocaml
thrasibule has quit [Ping timeout: 264 seconds]
Yoric has joined #ocaml
jeddhaberstro has quit [Quit: jeddhaberstro]
Yoric has quit [Quit: Yoric]
ttamttam has joined #ocaml
ttamttam has quit [Quit: Leaving.]
Amorphous has quit [Ping timeout: 248 seconds]
ttamttam has joined #ocaml
ttamttam has quit [Quit: Leaving.]
ulfdoz has quit [Ping timeout: 240 seconds]
Amorphous has joined #ocaml
hyperboreean has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
hyperboreean has joined #ocaml
valross has quit [Quit: Ex-Chat]
ttamttam has joined #ocaml
_unK has joined #ocaml
eelte has joined #ocaml
coucou747 has quit [Ping timeout: 264 seconds]
eelte is now known as coucou747
ftrvxmtrx has quit [Read error: Operation timed out]
ygrek has quit [Ping timeout: 245 seconds]
ikaros has joined #ocaml
ftrvxmtrx has joined #ocaml
barismetin has joined #ocaml
barismetin has quit [Changing host]
barismetin has joined #ocaml
det has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
drk-sd has quit [Quit: j're]
ftrvxmtrx has joined #ocaml
drk-sd has joined #ocaml
barismetin has quit [Remote host closed the connection]
fraggle_ has quit [Quit: -ENOBRAIN]
fraggle_ has joined #ocaml
barismetin has joined #ocaml
ftrvxmtrx has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
kidblubb has joined #ocaml
kidblubb has quit [Remote host closed the connection]
kidblubb has joined #ocaml
kidblubb has quit [Client Quit]
kidblubb has joined #ocaml
kidblubb has quit [Client Quit]
rwmjones is now known as rwmjones_afk
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
filp has joined #ocaml
Edward__ has joined #ocaml
_andre has joined #ocaml
emias has joined #ocaml
Yoric has joined #ocaml
hoho has joined #ocaml
hoho has quit [Client Quit]
Yoric has quit [Quit: Yoric]
oriba has joined #ocaml
ygrek has joined #ocaml
thrasibule has joined #ocaml
myu2 has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
thrasibule has quit [Ping timeout: 276 seconds]
dcolish has quit [Read error: Operation timed out]
dcolish has joined #ocaml
ccasin has joined #ocaml
iratsu has quit [Ping timeout: 240 seconds]
sepp2k has joined #ocaml
iratsu has joined #ocaml
rwmjones_afk is now known as rwmjones
oriba has quit [Quit: Verlassend]
seanmcl has joined #ocaml
myu2_ has joined #ocaml
myu2_ has quit [Remote host closed the connection]
fraggle_laptop has quit [Ping timeout: 240 seconds]
myu2 has quit [Ping timeout: 265 seconds]
rwmjones is now known as rwmjones_run
fraggle_laptop has joined #ocaml
_unK has quit [Read error: Connection reset by peer]
sepp2k has quit [Remote host closed the connection]
barismetin has quit [Remote host closed the connection]
_unK has joined #ocaml
barismetin has joined #ocaml
barismetin has quit [Remote host closed the connection]
barismetin has joined #ocaml
_unK has quit [Remote host closed the connection]
barismet_ has joined #ocaml
barismetin has quit [Read error: Connection reset by peer]
_unK has joined #ocaml
barismet_ has left #ocaml []
ftrvxmtrx has quit [Quit: Leaving]
jonafan_ is now known as jonafan
jeddhaberstro has joined #ocaml
filp has quit [Quit: Bye]
seanmcl has quit [Ping timeout: 245 seconds]
ttamttam has quit [Quit: Leaving.]
Yoric has joined #ocaml
adrien has quit [Ping timeout: 264 seconds]
Yoric has quit [Client Quit]
ftrvxmtrx has joined #ocaml
emmanuelux has joined #ocaml
ztfw has joined #ocaml
_unK has quit [Remote host closed the connection]
rwmjones_run is now known as rwmjoes
rwmjoes is now known as rwmjones
sepp2k has joined #ocaml
ulfdoz has joined #ocaml
Yoric has joined #ocaml
rwmjones has quit [Ping timeout: 245 seconds]
rwmjones has joined #ocaml
sepp2k1 has joined #ocaml
sepp2k has quit [Ping timeout: 276 seconds]
travisbrady has joined #ocaml
iratsu has quit [Ping timeout: 260 seconds]
iratsu has joined #ocaml
<jonafan> is there a way to do something similar to objdump -d with ocaml bytecode?
<flux> ocamldumpobj?
<jonafan> cool
coucou747 has quit [Quit: 0x2a]
<jonafan> this output makes little sense to me
<flux> well, what did you expect?-)
<jonafan> hehe i was just curious
<flux> I would expect it to have the publicly exported symbols somewhere, though..
iratsu has quit [Ping timeout: 240 seconds]
iratsu has joined #ocaml
ygrek has joined #ocaml
Edward__ has quit [Ping timeout: 248 seconds]
ygrek has quit [Ping timeout: 245 seconds]
adrien has joined #ocaml
avsm has joined #ocaml
BigJ has quit [Remote host closed the connection]
mbishop has quit [Ping timeout: 240 seconds]
th5 has joined #ocaml
avsm has quit [Quit: Leaving.]
mbishop has joined #ocaml
_andre has quit [Quit: Lost terminal]
Edward__ has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 264 seconds]
ftrvxmtrx has joined #ocaml
mbishop has quit [Ping timeout: 252 seconds]
fabjan has joined #ocaml
Yoric has quit [Quit: Yoric]
mbishop has joined #ocaml
slash_ has joined #ocaml
valross has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
ccasin has quit [Quit: Leaving]
boscop has quit [Ping timeout: 260 seconds]
seafood has joined #ocaml
seafood has quit [Quit: seafood]
slash_ has quit [Quit: Lost terminal]
th5 has quit [Quit: th5]
sepp2k1 has quit [Quit: Leaving.]
bacam has quit [Ping timeout: 260 seconds]
avsm has joined #ocaml
bacam has joined #ocaml
bacam has quit [Ping timeout: 276 seconds]
ftrvxmtrx has quit [Ping timeout: 265 seconds]
ftrvxmtrx has joined #ocaml
travisbrady has quit [Quit: travisbrady]
Edward__ has quit []