From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24320 invoked from network); 24 May 2023 15:58:36 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 24 May 2023 15:58:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-ID:Date: Content-Transfer-Encoding:Content-ID:Content-Type:MIME-Version:Subject:To: References:From:In-reply-to:Reply-To:Cc:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=7ae54cExmlXeLQRBsdIGObXVsRvGZAVB/goWE/6oK14=; b=sj9GX+Cw5qZDrWOuhqkus957oO XymNpfgP+P/PZdJ1KHk2dGvf/dwS50fkWyMJ1AAh4G6WK89rFmAJ/OQN03/owYv5m3EXBDAAuq/ig yqbxumL3rXa4diiqmT8SxEE0ErpcEOm/J0H5nH+pST2k+MXGL1vnGapqWUaN2+Gh9tSoI1uLpZq3L Uou4JB5tXsgVml0AFsGwUaiJvD+nTvHrfSd7wyUACjNg0NPbYKJt62KqG7PJjNGqlNKoqcz2itevp ITpe5b1xbsFMczkoikXjei4RXKTVM4kuiCaeBwMRB4nDYSRjW3Mz27dwwaqgS0DlgSzsaIptY1K6g mmBtvbHg==; Received: by zero.zsh.org with local id 1q1qsk-000E2U-S7; Wed, 24 May 2023 15:58:34 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1q1qsC-000DiU-HZ; Wed, 24 May 2023 15:58:01 +0000 Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.95) (envelope-from ) id 1q1qsA-000NqY-Rg for zsh-workers@zsh.org; Wed, 24 May 2023 17:57:59 +0200 In-reply-to: From: Oliver Kiddle References: <26170-1678007435.186071@mDq6.Euc0.bAwZ> <52850-1678055097.553101@HAUa.4aGe.fmcC> To: zsh-workers@zsh.org Subject: Re: [PATCH 1/3] Extended ksh compatibility: namespace parameter syntax MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <91668.1684943878.1@hydra> Content-Transfer-Encoding: 8bit Date: Wed, 24 May 2023 17:57:58 +0200 Message-ID: <91669-1684943878.854747@fivr.hfcP.0LL-> X-Seq: 51781 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: Phil Pennock wrote: > On 2023-05-21 at 21:35 -0700, Bart Schaefer wrote: > > On Sun, May 21, 2023 at 7:36 PM Mikael Magnusson wrote: > > > > So, to match the intent of ksh as I understand it: > > > > * .identifier.x is always treating identifier as a namespace > > > > * identifier.x is always treating identifier as a compound var > > > > * this is consistent across assignment LHS and expansion > > > > > > Does this mean compound vars can't be namespaced? > > > > No, but it does mean namespaces can't be nested. That naming system alone wouldn't necessarily preclude nesting of namespaces if you allow for consecutive runs of dots - something like: .identifier..identifier The current code doesn't allow that and I'm not even remotely suggesting it should. Namespaces at the top-level only seems fine. > Bart is (as per 99.9% of the time) correct. The examples below might > make it clearer (and are original to me so fine to grab into the test > suite). Note though that ksh does have nested collection types, which > would make full zsh compatibility trickier: Compatibility with ksh93 has limited value. What is useful should be priority. As I've mentioned before, my main wish is that we keep our options open for the compound variable syntax to be nothing more than an alternative syntax for associative arrays. I'd ideally like it if we could somehow stick everything the shell has - keymaps, functions, aliases, options styles etc into the variable hierarchy so that features like references, scoping etc might be usable with all. The current associative array syntax is at least compatible with the fact that functions have different naming rules because you can use .sh.function[.a/b] for a function named .a/b While we can't remove the underscore, it isn't necessarily too late for us to remove completion functions from polluting the global namespace. There's a lot of pieces that we'd need in place first but it could be done. Oliver