From: Ray Andrews <rayandrews@eastlink.ca>
To: 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 09:16:42 -0800 [thread overview]
Message-ID: <049465fb-b49d-9984-73ce-fd5672bec01a@eastlink.ca> (raw)
In-Reply-To: <CAH+w=7ar+MYVEHXPuFOMAQp0N4sr4N9JS4YXRz1707OPMQ4FMQ@mail.gmail.com>
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
> appear.
>
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 ? ;-)
next prev parent reply other threads:[~2017-12-30 17:46 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
2017-12-30 23:00 ` Ray Andrews
2017-12-30 17:16 ` Ray Andrews [this message]
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=049465fb-b49d-9984-73ce-fd5672bec01a@eastlink.ca \
--to=rayandrews@eastlink.ca \
--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).