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 29/12/17 03:45 PM, Bart Schaefer wrote:

If  you realize that aliasing is mostly analogous to #define in
C-and-friends, this becomes less horrifying.  It's little more than a
built-in preprocessor.

When you put it that way, yes, the horror diminishes ... just so long as no anarchist tries to redefine 'alias' or some such thing. There HAS to be something who's meaning is not negotiable.

  #define define "undefine"
  #define undefine "define"
  alias alias="this must surely be forbidden"

I dunno, maybe there are reasons to want to fiddle with reserved words but it seems blasphemous to me.  Never mind.

But I am curious, what does it
mean to say that an interpreted program is incomplete?
In this case it means any unfinished complex code structure -- "if"
without "fi", "do" without "done", "case" without "esac", "foreach"
without "end".  Mathieu wants execution to begin as soon as there is
some code in the buffer, without waiting for the final keyword to

I see.  Well, just for my education, why would that be impossible?  The protections zsh offers us against unfinished code are obviously helpful virtually always, but since we are interpreting, would it not be possible to just sorta turn those protections off and march blindly ahead executing each line in turn until the cliff is reached and some sort of crash happens? I'd expect the shell would have to crash at that point, or maybe there could be some kind of graceful auto-return, with a sort of presumptive close of all open grammars so that no feathers are ruffled.  But I'd expect such a thing should be doable, strange as it seems to want it.  Would that not be what would have happened in the early days before code checking was implemented?

  setopt crash_and_burn ?

  setopt press_on_regardless ?

  setopt close_everything_magically ?

  setopt no_code_checking_we_warned_you_not_to_do_this_but__did_you_listen ?  ;-)

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