zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: Can zsh `else` reserved keyword command be aliased and the lexem itself be repurposed as `fi` keyword command?
Date: Sat, 30 Dec 2017 14:06:52 -0800	[thread overview]
Message-ID: <CAH+w=7Yy1AGQzCri2AQn5sMQe3mCaw7QVzBc3PcnBrDG9MyctQ@mail.gmail.com> (raw)
In-Reply-To: <d7a6b0f1-de8e-a3d4-5129-3d7aea366321@eastlink.ca>

On Sat, Dec 30, 2017 at 9:22 AM, Ray Andrews <rayandrews@eastlink.ca> wrote:
> Cool!  These insights from history are so very illuminating.  Mind ... that
> would seem to make it all the more possible/acceptable to do what Mathieu
> wants, it'd be a compatibility feature not some sort of abominable novelty
> the way my suggestions are abominable novelties.

It would still be pretty abominable.  Every loop structure would need
two implementations, the current one and the "csh" one, because if you
execute as you parse you can't keep the parse around for re-use -- you
have to store all the original text and re-parse it again the next
time.  Some csh implementations put the text in a hidden file and use
lseek() to move back and forth in the file for looping.  For scripts
they just use the original source file!  (I've written self-modifying
csh scripts by taking advantage of this.)

You really don't want to go there.

If you're desperate to experience something like this, you can get
close in an interactive shell by having accept-line call "eval" on the
buffer and then deciding what to do next based on the results.  It'd
be a bit tricky to retain what's already been processed once so you
know whether/when to eval it again, but something could probably be
worked out.  I'm not going to try.


  reply	other threads:[~2017-12-30 22:07 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-28 15:07 mathieu stumpf guntz
2017-12-28 15:19 ` mathieu stumpf guntz
2017-12-29  8:47   ` Bart Schaefer
2017-12-29 10:51     ` mathieu stumpf guntz
2017-12-29 19:15       ` Bart Schaefer
2017-12-29 19:29         ` mathieu stumpf guntz
2017-12-29 19:49           ` Bart Schaefer
2017-12-29 20:27             ` Ray Andrews
2017-12-29 23:45               ` Bart Schaefer
2017-12-30  1:07                 ` Bart Schaefer
2017-12-30  9:50                   ` mathieu stumpf guntz
2017-12-30 10:05                     ` Frank Terbeck
2017-12-30 17:22                   ` Ray Andrews
2017-12-30 22:06                     ` Bart Schaefer [this message]
2017-12-30 23:00                       ` Ray Andrews
2017-12-30 17:16                 ` Ray Andrews
2017-12-30 22:23                   ` mathieu stumpf guntz
2017-12-30 23:06                     ` Ray Andrews
2017-12-30 23:32                       ` mathieu stumpf guntz
2017-12-30  9:36               ` mathieu stumpf guntz
2017-12-30 17:39                 ` Ray Andrews
2017-12-29 22:59       ` Nikolay Aleksandrovich Pavlov (ZyX)
2017-12-29  8:38 ` Bart Schaefer
2017-12-29 10:24   ` mathieu stumpf guntz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7Yy1AGQzCri2AQn5sMQe3mCaw7QVzBc3PcnBrDG9MyctQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).