Monday, October 3, 2011

The "else" keyword is the Evil

The Joshtra language has got the if (<condition>) construction but it does not allow the else clause.
Whether the else keyword is present in your program, it raises the exception IllegalElseKeyword

Example 1:
if (<condition>) {
    <Do  Something>
}

The code above does not raise any exception.


Example 2:
if (<condition>) {
    <Do something>
}
else {
    <Do something else>
}

The code above never executes the else block. If the program flow enter the else path, it raises the exception IllegalElseKeyword


No comments:

Post a Comment