<rox>
this might be a bit weird wuestion for this channel
<rox>
but
<rox>
does anyone know prolog around here?
upiom has joined #ocaml
lus|wazze has joined #ocaml
<upiom>
I'm totaly new to ocaml and I've been looking a bit at the tutorials and I thought I should try writing a small program. But I totaly stuck in this behaviour: Why does 1.0 == 1.0 return false?
<lus|wazze>
because they are not the same object, only two objects of the same value
<lus|wazze>
ie the same reason "foo" == "foo" returns false
<Riastradh>
(==) tests for _identity_, not structural equality. If you did [1] == [1], it would return false as well; floats are probably compound objects, and thus 1.0 has a different identity than 1.0.
<Riastradh>
Bah!
* Riastradh
waves his paw at lus|wazze.
<lus|wazze>
sorry :)
<upiom>
lus|wazze: thank you. Now I'll be able to sleep (I did suspect something like that). Is there a buildin testfunction to test the value of floats?
<upiom>
<> seems to work
<lus|wazze>
if you want to compare floats (or strings, for that matter) simply use =
<lus|wazze>
but I wouldn't recommend comparing floats for equality anyway ....
ayrnieu has quit [calvino.freenode.net irc.freenode.net]
vect has quit [calvino.freenode.net irc.freenode.net]
mattam has quit [calvino.freenode.net irc.freenode.net]
lam has quit [calvino.freenode.net irc.freenode.net]
Riastradh has quit [calvino.freenode.net irc.freenode.net]
phubuh has quit [calvino.freenode.net irc.freenode.net]
brwill_zzz has quit [calvino.freenode.net irc.freenode.net]
whee has quit [calvino.freenode.net irc.freenode.net]
The-Fixer has quit [calvino.freenode.net irc.freenode.net]
Tomasso has quit [calvino.freenode.net irc.freenode.net]
Maddas has quit [calvino.freenode.net irc.freenode.net]
Smerdyakov has quit [calvino.freenode.net irc.freenode.net]
smkl has quit [calvino.freenode.net irc.freenode.net]
upiom has quit [calvino.freenode.net irc.freenode.net]
cm has quit [calvino.freenode.net irc.freenode.net]
mw has quit [calvino.freenode.net irc.freenode.net]
wax has quit [calvino.freenode.net irc.freenode.net]
themus has quit [calvino.freenode.net irc.freenode.net]
demitar_ has quit [calvino.freenode.net irc.freenode.net]
Hadaka has quit [calvino.freenode.net irc.freenode.net]
buggs|afk has quit [calvino.freenode.net irc.freenode.net]
lus|wazze has quit [calvino.freenode.net irc.freenode.net]
Hipo has quit [calvino.freenode.net irc.freenode.net]
liyang has quit [calvino.freenode.net irc.freenode.net]
drlion has quit [calvino.freenode.net irc.freenode.net]
teratorn has quit [calvino.freenode.net irc.freenode.net]
det has quit [calvino.freenode.net irc.freenode.net]
rox has quit [calvino.freenode.net irc.freenode.net]
upiom has joined #ocaml
demitar_ has joined #ocaml
phubuh has joined #ocaml
whee has joined #ocaml
themus has joined #ocaml
cm has joined #ocaml
wax has joined #ocaml
mw has joined #ocaml
smkl has joined #ocaml
Tomasso has joined #ocaml
The-Fixer has joined #ocaml
brwill_zzz has joined #ocaml
Smerdyakov has joined #ocaml
Maddas has joined #ocaml
lus|wazze has joined #ocaml
Hadaka has joined #ocaml
buggs|afk has joined #ocaml
Hipo has joined #ocaml
liyang has joined #ocaml
rox has joined #ocaml
teratorn has joined #ocaml
drlion has joined #ocaml
det has joined #ocaml
ayrnieu has joined #ocaml
vect has joined #ocaml
mattam has joined #ocaml
Riastradh has joined #ocaml
lam has joined #ocaml
liyang has left #ocaml []
Tomasso has quit ["Client exiting"]
brwill_zzz is now known as brwill
systems has joined #ocaml
systems has left #ocaml []
Hadaka has quit [calvino.freenode.net irc.freenode.net]
buggs|afk has quit [calvino.freenode.net irc.freenode.net]
Hadaka has joined #ocaml
buggs|afk has joined #ocaml
lus|wazze has quit [calvino.freenode.net irc.freenode.net]
Hipo has quit [calvino.freenode.net irc.freenode.net]
drlion has quit [calvino.freenode.net irc.freenode.net]
teratorn has quit [calvino.freenode.net irc.freenode.net]
det has quit [calvino.freenode.net irc.freenode.net]
rox has quit [calvino.freenode.net irc.freenode.net]
demitar_ has quit [calvino.freenode.net irc.freenode.net]
ayrnieu has quit [calvino.freenode.net irc.freenode.net]
phubuh has quit [calvino.freenode.net irc.freenode.net]
brwill has quit [calvino.freenode.net irc.freenode.net]
whee has quit [calvino.freenode.net irc.freenode.net]
The-Fixer has quit [calvino.freenode.net irc.freenode.net]
Maddas has quit [calvino.freenode.net irc.freenode.net]
Smerdyakov has quit [calvino.freenode.net irc.freenode.net]
Hadaka has quit [calvino.freenode.net irc.freenode.net]
buggs|afk has quit [calvino.freenode.net irc.freenode.net]
lam has quit [calvino.freenode.net irc.freenode.net]
mattam has quit [calvino.freenode.net irc.freenode.net]
Riastradh has quit [calvino.freenode.net irc.freenode.net]
vect has quit [calvino.freenode.net irc.freenode.net]
smkl has quit [calvino.freenode.net irc.freenode.net]
cm has quit [calvino.freenode.net irc.freenode.net]
mw has quit [calvino.freenode.net irc.freenode.net]
wax has quit [calvino.freenode.net irc.freenode.net]
themus has quit [calvino.freenode.net irc.freenode.net]
upiom has quit [calvino.freenode.net irc.freenode.net]
det has joined #ocaml
drlion has joined #ocaml
teratorn has joined #ocaml
rox has joined #ocaml
Hipo has joined #ocaml
lus|wazze has joined #ocaml
buggs|afk has joined #ocaml
Hadaka has joined #ocaml
ayrnieu has joined #ocaml
lam has joined #ocaml
Riastradh has joined #ocaml
mattam has joined #ocaml
vect has joined #ocaml
upiom has joined #ocaml
phubuh has joined #ocaml
whee has joined #ocaml
smkl has joined #ocaml
mw has joined #ocaml
wax has joined #ocaml
cm has joined #ocaml
themus has joined #ocaml
The-Fixer has joined #ocaml
brwill has joined #ocaml
Smerdyakov has joined #ocaml
Maddas has joined #ocaml
demitar_ has joined #ocaml
afxpy_sleep has joined #ocaml
afxpy_sleep is now known as afxpy
brwill is now known as brwill_zzz
afxpy has quit ["Client exiting"]
srv has joined #ocaml
g1m has joined #ocaml
mimosa has joined #ocaml
phubuh` has joined #ocaml
karryall has joined #ocaml
Maddas_ has joined #ocaml
Maddas has quit [Remote closed the connection]
async has joined #ocaml
demitar_ is now known as Demitar
<async>
Smerdyakov
phubuh` has quit [Remote closed the connection]
_cm has joined #ocaml
cm has quit [Read error: 104 (Connection reset by peer)]
_cm is now known as cm
upiom has quit [Remote closed the connection]
phubuh has quit [Remote closed the connection]
phubuh has joined #ocaml
phubuh has quit [Remote closed the connection]
phubuh has joined #ocaml
mimosa has quit [calvino.freenode.net irc.freenode.net]
ayrnieu has quit [calvino.freenode.net irc.freenode.net]
phubuh has quit [calvino.freenode.net irc.freenode.net]
cm has quit [calvino.freenode.net irc.freenode.net]
g1m has quit [calvino.freenode.net irc.freenode.net]
whee has quit [calvino.freenode.net irc.freenode.net]
The-Fixer has quit [calvino.freenode.net irc.freenode.net]
Smerdyakov has quit [calvino.freenode.net irc.freenode.net]
brwill_zzz has quit [calvino.freenode.net irc.freenode.net]
smkl has quit [calvino.freenode.net irc.freenode.net]
async has quit [calvino.freenode.net irc.freenode.net]
srv has quit [calvino.freenode.net irc.freenode.net]
themus has quit [calvino.freenode.net irc.freenode.net]
wax has quit [calvino.freenode.net irc.freenode.net]
mw has quit [calvino.freenode.net irc.freenode.net]
phubuh has joined #ocaml
cm has joined #ocaml
async has joined #ocaml
mimosa has joined #ocaml
g1m has joined #ocaml
srv has joined #ocaml
ayrnieu has joined #ocaml
whee has joined #ocaml
Smerdyakov has joined #ocaml
brwill_zzz has joined #ocaml
The-Fixer has joined #ocaml
smkl has joined #ocaml
mw has joined #ocaml
wax has joined #ocaml
themus has joined #ocaml
Maddas_ has quit [calvino.freenode.net irc.freenode.net]
vect has quit [calvino.freenode.net irc.freenode.net]
mattam has quit [calvino.freenode.net irc.freenode.net]
Riastradh has quit [calvino.freenode.net irc.freenode.net]
lam has quit [calvino.freenode.net irc.freenode.net]
Maddas_ has joined #ocaml
vect has joined #ocaml
mattam has joined #ocaml
Riastradh has joined #ocaml
lam has joined #ocaml
lam has quit [Broken pipe]
lam has joined #ocaml
lus|wazze has quit ["Copyright is a temporary loan from the public domain, not property"]
srv has quit ["leaving"]
karryall has quit ["home"]
CybeRDukE has joined #ocaml
maihem has joined #ocaml
mattam_ has joined #ocaml
<CybeRDukE>
hi, i've got a question about the parameter-types of the a constructor.
<CybeRDukE>
class test a = object
<CybeRDukE>
when i use a in my class, i get the message that the type of a is unknown
<CybeRDukE>
why is that a problem for ocaml? do i really have to use generics to tell ocaml, that the type will be specified a initilization-time?
mattam has quit [Read error: 110 (Connection timed out)]
<Demitar>
CybeRDukE, polymorphic types need to be specified explicitly.
<Demitar>
class ['a] test a = object
<Demitar>
Possibly even, class ['a] test (a : 'a) = object
<CybeRDukE>
i know that it works this way, but i don;t really understand, why an implizit 'a is forbidden. do you know that?
<Demitar>
Not authoritively.
<Demitar>
It has been up on the mailing list iirc.
<CybeRDukE>
well, it's not that important... was just curious *g*
* Demitar
is a bit tired and should probably keep silent anyway. ;-)
<CybeRDukE>
oh sorry. i didn't want to wake you up
systems has joined #ocaml
* Demitar
grins.
<CybeRDukE>
is constructor overloading possible in ocaml? e.g. one time initializing with (), another time with an int, just as known from java or c++ ?
<Demitar>
You can use optional labels.
<CybeRDukE>
could you give me an example?
Demitar has quit [Read error: 104 (Connection reset by peer)]
<CybeRDukE>
noooooooo
Demitar has joined #ocaml
<CybeRDukE>
puh *g*
<Demitar>
Did you get my answer?
<CybeRDukE>
that i can use optional labels? yes got it
<Demitar>
Good. :)
<CybeRDukE>
but could you please give me a small example.
<Demitar>
class myint ?(v=0) () = object val i = v method get = i end
<CybeRDukE>
thx
<CybeRDukE>
parsing....
Maddas_ has quit [Remote closed the connection]
<CybeRDukE>
i know i'm annoying, but how do i initialize an obkect with a number? let a = new myint 1 and derivates do not work
<CybeRDukE>
ah, found it
<Demitar>
They are labels. ;-) Just like you'd do in a normal function application.
<CybeRDukE>
never saw labels before *g*
<CybeRDukE>
but i already found the section in the manual
CybeRDukE has quit [Read error: 110 (Connection timed out)]
mattam_ is now known as mattam
systems has left #ocaml []
__buggs has joined #ocaml
buggs|afk has quit [Read error: 110 (Connection timed out)]