aardappel / lobster

The Lobster Programming Language
http://strlen.com/lobster
2.25k stars 119 forks source link

Continue statement? #187

Open AntonBogun opened 2 years ago

AntonBogun commented 2 years ago

I could not find any description on a continue statement which can be seen in other languages, and it does not seem to be a reserved identifier inside loops. Is this intentional or was it just not implemented yet?

aardappel commented 2 years ago

I guess I've simply never had a need for it. It could definitely be added.

salping commented 1 year ago

is this planned to be added, or is this just a dead thread? continue would be super helpful for lots of projects.

aardappel commented 1 year ago

is this planned to be added, or is this just a dead thread?

Neither. This is not an open source project with permanent staffing, so things get added when contributors feel like implementing things, not anything on a set priority or schedule.

Hjagu09 commented 9 months ago

I think the new guard statement could be used like a conditional continue... Correct me if I'm wrong but a separate continue statement shouldn't be necessary, you can always write guard false and it should be perfectly equal to an conventional continue

aardappel commented 9 months ago

guard false only shortcuts the current block, so wouldn't allow for the more common if ...: continue. Also, guard false never executes the statements following it, so would be non-sensical.