civboot / fngi

a readable language that grows from the silicon
The Unlicense
60 stars 3 forks source link

defer #13

Open vitiral opened 1 year ago

vitiral commented 1 year ago

Defer is fairly trivial to implement actually.

defer fn myFn do (
  defer (thingA;)
  blahBlah()
  defer (thingB;);
  ret blahBlah() // executes thingB -> thingA -> returns
)

For the TyDb, defer blocks are not allowed to either accept or return any types on the stack (that is the job of the function).