From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13135 invoked by alias); 30 Dec 2017 17:46:48 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23034 Received: (qmail 16368 invoked by uid 1010); 30 Dec 2017 17:46:48 -0000 X-Qmail-Scanner-Diagnostics: from mta04.eastlink.ca by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(24.224.136.10):SA:0(-2.6/5.0):. Processed in 0.634583 secs); 30 Dec 2017 17:46:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: rayandrews@eastlink.ca X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | MIME-version: 1.0 Content-transfer-encoding: 8BIT Content-type: text/plain; charset=utf-8; format=flowed X-Authority-Analysis: v=2.3 cv=OKgJIxSB c=1 sm=1 tr=0 a=RnRVsdTsRxS/hkU0yKjOWA==:117 a=RnRVsdTsRxS/hkU0yKjOWA==:17 a=IkcTkHD0fZMA:10 a=zDM2p8kitsUI8MgSXw0A:9 a=QEXdDO2ut3YA:10 X-EL-IP-NOAUTH: 24.207.101.9 Subject: Re: Can zsh `else` reserved keyword command be aliased and the lexem itself be repurposed as `fi` keyword command? To: zsh-users@zsh.org References: <71ef7896-39f8-66fe-f8f8-c7c81b11e2ce@culture-libre.org> <918acbfa-b637-1d13-816b-c6edee0afa5c@culture-libre.org> <81beaeae-6507-c961-b6fd-5831ba58e045@eastlink.ca> From: Ray Andrews Message-id: <049465fb-b49d-9984-73ce-fd5672bec01a@eastlink.ca> Date: Sat, 30 Dec 2017 09:16:42 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 In-reply-to: Content-language: en-CA 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 ?  ;-)