Re:Crafting Interpreters: Superclasses
by pansa2 on Wednesday March 18, 2020 @01:52PM
(#22619357)
Is it possible that there isn't a `this` binding? Does Lox allow access to "unbound" methods directly from a class, or are methods accessible only via instances?
[ Parent
| on HN ]
Re:Crafting Interpreters: Superclasses
by munificent on Wednesday March 18, 2020 @02:07PM
(#22619536)
Methods are only accessible from instances, so `this` is always meaningfully bound. If you try to use `this` outside of a class body, it's a static error.