Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IoVM] Block isKindOf #24

Closed
superbobry opened this issue Apr 3, 2010 · 2 comments
Closed

[IoVM] Block isKindOf #24

superbobry opened this issue Apr 3, 2010 · 2 comments

Comments

@superbobry
Copy link
Contributor

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                          A2_Object.io 380
  Block ancestors                      A2_Object.io 387
  Block isKindOf                       Command Line 1
@kinda
Copy link

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))
  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))
  a
)

@stevedekorte
Copy link
Member

Fixed - thanks for report and suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants