else if
Created by: pepa65
I have been reading through https://doc.redox-os.org/ion-manual/ and it really makes me want to use ion (except I haven't been able to get a working install...)
There was only one big red flag that went up when reading 7.1 Conditionals
. Now it might be that the description there is not accurately reflecting the actual design choices, but the example raised a big concern that is connected with using else if
instead of elif
or elsif
or elseif
or else-if
.
Usually in languages that don't have this, else if
can still be used, but it is parsed according to normal parsing rules (I am disregarding significant-whitespace languages). But in ion it seems there is a keyword that contains a space, else if
that functions as else-if
. What happens if there are 2 spaces, will it still work as else-if
? Or is it parsed regularly when written as else; if
(requiring an extra end for the new if
)? I think having a 'keyword' with a space is unusual and bound to be confusing, and I think it will be confusing to people who expect this to work:
if c1
a1
else if c2
a2
else
a3
end
end
I think you're not doing yourselves (as builders/implementers/testers) or users of ion any favour. I think the else-if
functionality is very useful and clear, but not like this. Sorry for sounding impossibly pedantic, I just don't understand why you're doing this to yourselves and the rest of the world.