PlasmaLang / plasma

Plasma Programming Language
Other
162 stars 10 forks source link

Add scoping blocks as a new statement type. #418

Open PaulBone opened 2 years ago

PaulBone commented 2 years ago

Add scoping blocks so that:

scope {
   var v = ...
   ... use v ..
}
... can't use v ...

But also implement the ability to hide variables within blocks.

var v = ...
scope hiding [v] {
   ... can't use v ...
}
... can use v ...

And the ability to hide everything except some listed variables.

var v = ...
var u = ...
scope [v] {
   // Can use v
   // Can't use u
}