Skip to content

[IoVM] Block isKindOf #24

superbobry opened this Issue Apr 3, 2010 · 2 comments

3 participants


I'm not quite sure what's happening here, but Block instances handle isKindOf incorrectly. Example:
Io> Block isKindOf(Object)
==> true
Io> Lobby getSlot("forward") type
==> Block
Io> Lobby getSlot("forward") isKindOf(Object)

  Exception: Object does not respond to 'self'
  Object self                 380
  Block ancestors             387
  Block isKindOf                       Command Line 1
kinda commented May 24, 2010

I think the issue comes from the "ancestors" method which shouldn't activate x and self.

Instead of:

ancestors := method(a,
  if(a, if(a detect(x, x isIdenticalTo(self)), return a), a = List clone)
  a append(self)
  self protos foreach(ancestors(a))

We should have something like:

ancestors := method(a,
  if(a, if(a detect(x, getSlot("x") isIdenticalTo(getSlot("self"))), return a), a = List clone)
  a append(getSlot("self"))
  self protos foreach(ancestors(a))

Fixed - thanks for report and suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.