Open stohrendorf opened 1 year ago
We can already do delete else!
at the beginning of a file. However, to achieve a consensus and save time, that line could be added by compiler by default. If someone wants to use else
anyways, a new directive ;delete else
might come at handy.
Interesting idea. I like ;delete
instead of undelete
or restore
or recycle
or whatever keyword, although personally I would prefer -delete
.
Instead of ;delete else
, we have add (new todepond.dreamberd.lang.syntax.features.FeatureSingletonFactoryManager()).factory().getElse().create()
. Please note that in all code after 1 + 1
would be invalid syntax, instead you would do add(1,1)
But don't worry you can still delete add
.
The
else
keyword is usually useless for the following reasons:if ... else if
chain can be written as a series ofif
statements.if ... else
statement can be written by initializing variables with a default value, and overwrite them (if necessary) within anif
statementwhen ... else
, theelse
is usually an unexpected condition, and this means the programmer is incompetentThis relates to #122, and simplifies the language, so newbies can learn something about computer science.