Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Can zsh `else` reserved keyword command be aliased and the lexem itself be repurposed as `fi` keyword command?



On 30/12/17 02:06 PM, Bart Schaefer wrote:

You really don't want to go there.

If you're desperate to experience something like this,

Heck no, not me, I'm just interested in the zen of the idea.  And you've already said enough for me to understand that some naive idea about a 'csh' mode is a nonstarter.

Yabut, what about some sort of auto-ending of code structures? Even if parsing was by exactly the same non-csh method, would it not be possible to turn off the code checker and just sorta run until the tracks stop at which point the thing returns?

    if [ something ]; then blah

    elif [something_else]; then foo

... and it just stops there not worrying about the fact that 'fi' is missing.

Or, does the zsh parsing system really forbid such a thing? True, it would know about the issue at the parse and before execution even begins, but could it not just 'presume' the 'fi'? Sorta like the fact that I should close the door after I leave, but it is possible for me to depart and leave the door open. Mind, this could only even theoretically apply to code that is missing closings at the very end of itself.  Maybe easier to imagine than to implement, and certainly rather strange.  Never mind, I'm just curious.




Messages sorted by: Reverse Date, Date, Thread, Author