Wish Block ... Exit Block ... End Block

emexes

Expert
Licensed User
as a safety crib to compartmentalise scope/visibility of (usually temporary) variables, and enable reuse of same variable name in different blocks for different purposes

much as per Pascal Begin ... End and C { ... }

Exit Block
would be a wonderful bonus (and, again: one-up on most other languages šŸ» )
 

agraham

Expert
Licensed User
Longtime User
If I remember correctly from the early days, it was Erel's design decision to have all local variables in a Sub 'hoisted' to entire Sub visibility wherever they were declared within a Sub so there was only one level of local variables. I have to admit that I never notice this nor miss the C/C++/C#/Java block visibility of declarations.
 

Alessandro71

Well-Known Member
Licensed User
Longtime User
If I remember correctly from the early days, it was Erel's design decision to have all local variables in a Sub 'hoisted' to entire Sub visibility wherever they were declared within a Sub so there was only one level of local variables. I have to admit that I never notice this nor miss the C/C++/C#/Java block visibility of declarations.
Actually I had several times: the most common occurrence is with using codes from various samples, where a Result as Int conflicts with a subsequent Result as Boolean usageā€¦
 
Top