<drlion>
another one -- i'm really sorry about the complicated explanation: i have two classes foo and bar, where bar inherits from foo, and foo contains a method adopt that takes another foo. foo takes a constructor parameter called parent, on which it invokes adopt with self as an argument. bar also takes such a paramter, which it uses to inherit foo. now the problem is that when i try to create a bar and pass a foo to the construc
<drlion>
i suspect that this might be because there's an initializer in foo: initializer parent#adopt self and when bar inherits this, self will actually be a bar -- not a foo. so my question then becomes: how can i avoid this and instead always use the base class foo? in other programming languages, i believe i would use some sort of upcast
<drlion>
i understand if noone feels like trying to interpret all that. there's another clue though: the compiler also tells me regarding this that "self type cannot escape its class," which does sound rather dramatic, but unfortunately doesn't tell me much. what does it mean?
<Kinners>
I don't know much about the class system yet, but there is some slight magic required with up/down casting
olrion has quit [Read error: 113 (No route to host)]
systems has joined #ocaml
systems has quit ["Client Exiting"]
<drlion>
Kinners: yeah, that's the impression i get too. anyway, i have no idea how to solve the problem, so i'm currently reading through the manual again :-)
whee has quit ["My damn controlling terminal disappeared!"]
docelic has quit ["later"]
reltuk has joined #ocaml
lament has joined #ocaml
Kinners has quit [Read error: 110 (Connection timed out)]
whee has joined #ocaml
gl has quit [asimov.freenode.net irc.freenode.net]
gl has joined #ocaml
Smerdyakov has joined #ocaml
rhil has quit [Read error: 104 (Connection reset by peer)]
rhil has joined #ocaml
Smerdyakov has quit ["gworgh"]
wax has quit [Remote closed the connection]
wax has joined #ocaml
reltuk has quit ["Client exiting"]
mattam has joined #ocaml
rhil is now known as rhil_zzz
TachYon has joined #ocaml
TachYon has quit [Remote closed the connection]
smklsmkl has quit [Read error: 54 (Connection reset by peer)]
smklsmkl has joined #ocaml
_DL_ has joined #ocaml
_DL_ has quit [Client Quit]
lament has quit ["I WILL NOT BELCH THE NATIONAL ANTHEM"]
Yurik has joined #ocaml
__DL__ has quit [Read error: 54 (Connection reset by peer)]
lus|wazze has quit ["Quidquid latine dictum sit, altum sonatur."]
systems has joined #ocaml
__DL__ has joined #ocaml
rox has quit [Read error: 60 (Operation timed out)]
docelic has joined #ocaml
systems has quit [Read error: 110 (Connection timed out)]
AndyA has joined #ocaml
rox has joined #ocaml
gene9 has joined #ocaml
olrion has joined #ocaml
<olrion>
hi guys
gene9 has quit [Read error: 54 (Connection reset by peer)]
karryall has joined #ocaml
rhil_zzz is now known as rhil_sea
gene9 has joined #ocaml
Zadeh_ has joined #ocaml
Zadeh has quit [Read error: 104 (Connection reset by peer)]
foxster has quit [Read error: 104 (Connection reset by peer)]
Smerdyakov has joined #ocaml
gene9 has quit []
AndyA has left #ocaml []
owll has joined #ocaml
async has joined #ocaml
<async>
is there a Hastbl structure that is totally polymorphic?
<async>
i.e, you can add ("key","keyval") and ("key
<async>
i.e, you can add ("key","keyval") and ("key",12)
<vegai>
hmm, can't use 'a there?
* vegai
tries
<karryall>
of course not
<karryall>
use a variant type
<vegai>
of course not? why?
<karryall>
how would you know wether you data is an int (12) or a string ("keyval")
<vegai>
hmm, yes
<async>
karryall: yea
<async>
the second type depends on the first type
<async>
like if the string is "asdf" or "sdjfv" then the second type is a string
<async>
etc..
<async>
i could use a type
<vegai>
I still keep thinking too dynamically for this language
<async>
type secondval = Str of string | Number of int ;;