erkyrath / tworld

A choice-based shared online text environment sandbox
MIT License
71 stars 13 forks source link

Barename symbols should have an implicit dependency on the playstate location #152

Open erkyrath opened 10 years ago

erkyrath commented 10 years ago

I'm not positive of this, but I think it's needed for various corner cases to work.

If "[[foo]]" is in your focus description, it looks up the foo property of your location. If your location changes, the focus should change. Normally this is hidden from the player because all descriptions are wiped when you move. But I just ran into two cases where it might matter:

https://github.com/erkyrath/tworld/issues/81 A way to execute code in a given player's context https://github.com/erkyrath/tworld/issues/151 Execute instancepane in a context with a location

This change will make instancepane more expensive -- it will always have a dependency on location, so it will refresh whenever you move. (In theory you can avoid this by using _. lookup for all global symbols. But nobody's going to do that.)