« Return to Thread: Literal instance slots, 10 foo := 1

Literal instance slots, 10 foo := 1

by Mike Austin :: Rate this Message:

Reply to Author | View in Thread

In Io, I know it's possible to set a slot on a specific literal, for example:

Io> 10 foo := 1
==> 1
Io> 10 foo
==> 1
 > 20 foo
Exception: Number does not respond to 'foo'

1. Does it introduce any overhead, or only when the first slot is set?
2. Is there a good use for this functionality, other than being "correct"?

Thanks,
Mike

 « Return to Thread: Literal instance slots, 10 foo := 1