towerofnix / tlnccuwagnf

The Language Nobody Could Come Up With A Good Name For
MIT License
18 stars 3 forks source link

Contexts #32

Open plastpappa opened 8 years ago

plastpappa commented 8 years ago

(dis is suggestion btw)

Contexts work a bit like environments - or, at least, they look and are meant for similar things. The current context can be gotten at any time from the var context. Here are the properties contexts would have:

Possible uses: Return value from parent function: context.origin.return("something"). Define globals from anywhere: context.top.var -> "something" Get variables from anywhere: someContext.environment etc.

I think they work great alongside environments. Maybe they're stupid and non-programming-like though. :P Discuss them.

bates64 commented 8 years ago

:+1: Although, context.origin should return context.top when in the top-level, don't you think?