JacquelineCasey / Nom

0 stars 0 forks source link

While loops #12

Closed JacquelineCasey closed 1 year ago

JacquelineCasey commented 1 year ago

Requires #2 Booleans.

Once if statements are added, while loops should be pretty easy.

Should we add break and continue? How might those work in the future if we don't add them now. Can we break to an arbitrary outer loop? Outer block even (see Zig)?

JacquelineCasey commented 1 year ago

Do we want something weird like while-else or while-finally? Do we want a separate loop construct like in Rust?

I do think that for loops can wait until we get collections to loop over.

JacquelineCasey commented 1 year ago

I think break statements and while-else can be postponed for now. There's a chance we will have better machinery for breaks / continues after we do #14 and especially #5.

I like the idea of Zig's continue clause...

JacquelineCasey commented 1 year ago

Basic while loops done!