News for hackers. Stuff that matters.
Re:Ask HN: Help me choose the best syntax for a new language by tremens on Wednesday November 01, 2017 @07:38AM (#15600293)
A mix of B and C.

Variables bound within a scope should be able to shadow variables bound in parent scopes, but global vars should be made obvious when they are used within the codebase - visually marking global variables is a good thing.

Example:

  <set var="@x" global>3</set>
  <scope>

      <set var="x">4</set>

      <put>x</put> // 4
      <put>@x</put> // 3

      <scope>
         <set var="x">10</set>

         <put>x</put> // 10
         <put>@x</put> // 3
      </scope>

      <put>x</put> // 4
      <put>@x</put> // 10
  </scope>

There are no comments on this comment yet.