for the love of god
viewtopic.php?f=14&t=112700
viewtopic.php?f=14&t=114511
[v2] replace else-clause on loops/try with a different keyword
Re: [v2] replace else-clause on loops/try with a different keyword
continue? Else works fine here semantically speaking, but does interfere with the if-else construct.
Re: [v2] replace else-clause on loops/try with a different keyword
continue what? continue is already a keyword. a new (different) one is needed. one that would make sense reading-wise for both try and for all loop types
Re: [v2] replace else-clause on loops/try with a different keyword
The use case where an else is tied to a for-loop seems very unusual so unless that pattern is simply removed I agree that the else could be renamed, maybe to forelse or fallback or otherwise or perhaps something real ugly but self-explanatory like IfNoInterations
Try-else without catch inbetween also seems very unusual. As suggested in one of the linked threads that use case could instead be handled if IfTry or Try() was added. Renaming the else is tricky here since it would be messy to have both try-catch-else-finally and try-SomeOtherName. So a new name would need to make sense in the try-catch-SomeOtherName-finally pattern too. Maybe success or OnSuccess or IfNoError or proceed
Try-else without catch inbetween also seems very unusual. As suggested in one of the linked threads that use case could instead be handled if IfTry or Try() was added. Renaming the else is tricky here since it would be messy to have both try-catch-else-finally and try-SomeOtherName. So a new name would need to make sense in the try-catch-SomeOtherName-finally pattern too. Maybe success or OnSuccess or IfNoError or proceed
Re: [v2] replace else-clause on loops/try with a different keyword
anyway its a bug, according to the docs, 'else' can only be attached to a 'catch', not a 'try'