0

How does the Io's method scope work? When I define:

method(x, x + 1)

what object does slot x belong to? I tried self, call and even Object without any luck?

For example in the REPL:

slotNames

is the same as

Lobby slotNames

in a method:

method(slotNames)

is the same as? What?

Thanks

Maciej Goszczycki
  • 1,118
  • 10
  • 25

1 Answers1

2

x is stored in the arguments list of the message not as slots.

You can access the arguments of the current message via

m := method(x, y, call message arguments).

MKroehnert
  • 3,637
  • 2
  • 34
  • 43