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

MYNAMEP for child object #155

Open
jasonsikes opened this issue Feb 6, 2023 · 1 comment
Open

MYNAMEP for child object #155

jasonsikes opened this issue Feb 6, 2023 · 1 comment

Comments

@jasonsikes
Copy link

? make "a something
? ask :a [have "bar]
? ask :a [make "bar "baz]
? ask :a [show mynamep "bar]  ; [1]
true
? show mynamep "bar           ; [2]
true

The output of [1] makes sense to me; bar is a variable owned by the current object.

[2] does not. The Logo object does not own bar.

@jasonsikes
Copy link
Author

...continuing

? make "b kindof :a
? ask :b [have "joe]
? show mynamep "joe
true
? ask :a [show mynamep "joe]
false
? ask :b [show mynamep "joe]
true

The hierarchy looks like this:

B -> A -> Logo

B is a child of A, and A is a child of Logo.

We ask B to have a variable named "Joe". Then we ask all three of them, "Who has 'Joe'?"

B and Logo say they do, but A says it doesn't.

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

1 participant