boltlang / Bolt

A programming language for rapid application development
35 stars 1 forks source link

Allow for deferred assignment #43

Open samvv opened 1 year ago

samvv commented 1 year ago

As discussed in issue #42, it should be possible to omit the body of a variable expression and only have it assigned later in the program.

Eventually, this will require a program that can track the control-flow of Bolt source code, as in the following example:

let foo : Int

if toss.
  foo = 1 # branch 1
else.
  foo = 2 # branch 2

foo # correct: both branches assigned a value