In something like C++ you could create a scope like so:

{
	// Do something neat here
}

I was wondering about having or maybe even requiring a scope keyword, which might look like this:

scope
{
	// Do something neat here
}

This seems even more relevant in an indentation sensitive language like python:

scope:
	pass

Interested to hear any opinions, TIA.

  • xigoi
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    Nim, which is indentation-based, has a block keyword.

    block:
      echo "something"