jamiebuilds / ghost-lang

:ghost: A friendly little language for you and me.
302 stars 10 forks source link

Variable shadowing #22

Closed aleclarson closed 6 years ago

aleclarson commented 6 years ago

Can parameters & variables be shadowed by variables declared by inner blocks?

jamiebuilds commented 6 years ago

Yes, any new {block} creates a new scope which can have its own bindings with the same names as parent scopes.

Places where you have keyword (...binding...) {...} those bindings get inserted into the block scope