foolang icon indicating copy to clipboard operation
foolang copied to clipboard

syntax-change: remove `return`

Open nikodemus opened this issue 3 years ago • 0 comments

Replace return x with x! -- consistent with using ! to terminate definitions.

Implementation plan: set precedence so that ! is consumed by sequence parsing, and wraps the prefix in a return. Allow returning from define, allowing guard clauses in defines.

define MyDef
   OtherDef > MagicValue
      ifTrue: { 0! }
   ...
   computedMagicValue!

Especially useful once main module is able to pass static assets to imported modules.

nikodemus avatar Jul 20 '20 13:07 nikodemus