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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27878 invoked from network); 20 May 2023 02:06:35 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 20 May 2023 02:06:35 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1684548395; b=ol2ID4NkTzUOOva+MNxrpHfoE79WhBXM39Nn/fzycs6wy9B/8g+tL7A1+PAVdVoGXn9wWyuCd6 DZzoc+6eRtAySyzUIeV1S+cEXy9cPzEYyIhD0Kl3wxqyZVZ3MZfGZiVhfvAePul+zKFLD7B0rI Jw+D53CUTOEP4Uk5LCX7fIW+HuBoBxGPrskOs0BMFPHRPkN6OiUX0u4cfO9FavgJePhMdZ94UV oibhxk9MwwIMTi3nNClEcttF73xldUbPIO+a9nD6wEQcD6YHjec9t+r/4e9gFQYCOr6K0vmegE KuNSGJ3NvbGj0WFFhfMuE4SYKIIjo/PkkWU7yYfhSS1alQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mx.spodhuis.org) smtp.remote-ip=94.142.241.89; dkim=pass header.d=spodhuis.org header.s=d202305e2 header.a=ed25519-sha256; dkim=pass header.d=spodhuis.org header.s=d202305 header.a=rsa-sha256; dmarc=pass header.from=spodhuis.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1684548395; bh=eb3Jo/zGGebK5/d5EegfALIKKnOiOguU7KJU3vrjgXY=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=Z/utJgoMgIGFJgZ5R4tqjz8ZurmkAWYvf6LGIIExkliZ8KF8ELwB5dgI2lcw1YULOZW6X4COsj E/kPwYmKkUgPfrptIitnNyYlUd1j4nIFLGwg+03lIrIQo14/JJC38DDUQWv9EJdebB0/M7G4uL DPLRAu06dnL7llEfSB6BNPhmWqeC0FSQ7dC/dfbiH0GdvTwhaMZnN4x1PH2e3xK2cHgSZiJ9p+ N/zs98wTYwDJLYR5YZrq/6MFMFuc/w2hC+kAnWelWKakdERyouv7jA7OTNgszEeuoIs8tus7cB JBR5FlXVewcNySRreJl4AGexPpSATtgW4IIDL5NPPaBLXQ==; 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:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=QSavqjxBzJNsZtscu3Be7jz6exIychYd95EgE2roa0g=; b=aQgvLyM0z6xXqAzMvdN+CMk851 gcGhe/ro9i8xyTcuL3eX2baVhjdsfLCDFwzGG0R+efH7xtT46tDVxsSYKlBvGWMioot/agpmmc4vd a/3BTWN1fGroJAC1ykhy6VFfXdCqpeypG3x2o+d5OQlwM0AtIZSnxg6dWfK1a2kBVqIWZ65UKVprt flS5LsQ+yP2sxmPBZdmMKVrQBD3kyuEdZUPH70f6paw1jHFxlXrGTSzUjpw8Yy9fk+e7bsj+H084X 7XbjEjp/sgFJfhapLDIDlxY3OoQjWOw7TK8IM2xmzNAnhr/Q90oEt/WTFXfwAQ8EMOIu7B8UVsTVh ZtyvzYZA==; Received: by zero.zsh.org with local id 1q0BzM-000IpS-7J; Sat, 20 May 2023 02:06:32 +0000 Authentication-Results: zsh.org; iprev=pass (mx.spodhuis.org) smtp.remote-ip=94.142.241.89; dkim=pass header.d=spodhuis.org header.s=d202305e2 header.a=ed25519-sha256; dkim=pass header.d=spodhuis.org header.s=d202305 header.a=rsa-sha256; dmarc=pass header.from=spodhuis.org; arc=none Received: from mx.spodhuis.org ([94.142.241.89]:53350) (DNSSEC AD) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1q0Byj-000IVw-Po; Sat, 20 May 2023 02:05:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d202305; h=OpenPGP:In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date:From: Reply-To:Subject:Date:To:Cc:Content-ID:Content-Description:OpenPGP: Organization:Auto-Submitted; bh=QSavqjxBzJNsZtscu3Be7jz6exIychYd95EgE2roa0g=; t=1684548353; x=1685757953; b=bkrwENzwwrQCO63ZAv7uiogpVFtmhCkGvBnrjV5+C8wTAWr NZ66vKWY8k1qAZ8KCTtU6mUNk5iQPWM4baw4rLkFHR6aWR8QkgKzj1s2TyKPxXKfxHqJcKSf9E5yX /75DDwzbiB2i7yS+KhIwpWERlTbsWXro8DZoRCUzB7hIQ4XNAQwNz5p3lnv2CeHBkqzJbCgFkFE92 31NbEeMv/yqoV8bW57gHm6HUiBN4H0wmBTqqLPDCDuc1AWxcE79shEu6uy9N/WLjOjbqB08KpOae+ bwg1s5wVwVnD3gP3CUhS9M+jugcI4X/Bu4Z/UFXEhJ/SM42W5yTccsTuR1iCSNsQ==; DKIM-Signature: v=1; a=ed25519-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d202305e2; h=OpenPGP:In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date:From: Reply-To:Subject:Date:To:Cc:Content-ID:Content-Description:OpenPGP: Organization:Auto-Submitted; bh=QSavqjxBzJNsZtscu3Be7jz6exIychYd95EgE2roa0g=; t=1684548353; x=1685757953; b=3MyQWrx2CQ64J4CD96Ff1MSN6oPA15hbksTBZtqL5bIBHGH DqdsObwR4XGUkkwKDnZQaxZzea91pHq0qSsrIDQ==; Received: from authenticated user by smtp.spodhuis.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1q0Byi-000IVq-FV; Sat, 20 May 2023 02:05:52 +0000 Date: Fri, 19 May 2023 22:05:50 -0400 From: Phil Pennock To: zsh-workers@zsh.org Subject: Re: [PATCH 1/3] Extended ksh compatibility: namespace parameter syntax Message-ID: Mail-Followup-To: zsh-workers@zsh.org References: <26170-1678007435.186071@mDq6.Euc0.bAwZ> <52850-1678055097.553101@HAUa.4aGe.fmcC> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: OpenPGP: url=https://www.security.spodhuis.org/PGP/keys/keys-2013rsa-2020cv25519.asc X-Seq: 51765 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: On 2023-03-05 at 14:42 -0800, Bart Schaefer wrote: > On Sun, Mar 5, 2023 at 2:25 PM Oliver Kiddle wrote: > > There must be an off-by-one error in a check: > > > > a.b=c > > zsh: command not found: a.b=c > > Ah, thanks. It was assuming there would be a leading ".". AFAICT, in zsh, .a.b=c is assigning to var b in namespace a, while a.b=c is setting the b attribute of the compound variable a. > Hmm, but ... if we change these to .zle.bracketed_paste etc., at what > point to deprecate the current names? I hadn't realized ksh had namespaces or I'd have looked before, but at some point I started thinking through how namespaces could benefit a shell design (I was going to call them varspaces to avoid confusion on Linux). I think that you can use a set of namespaces for subsystems and have bound names (aliases) from the main namespace to those for existing behavior, unless an emulate directive says to be particularly strict. Then you could have the completion system switch away from littering the main namespace with _foo functions, by moving completion functions into the namespace, and all sorts of cache variables there, which has the added bonus that leaks in user written completions won't pollute the main namespace. Once you have binding names (one level "deeper" than a ksh/bash nameref in that it's not repointable by the user, only something you can omit from the namespace, and can be for commands, not just variables) you can move all the builtin and module-loadable commands into one namespace, builtin variables into another, and then lock all existing variables into a "legacy" mapping to make them available in other namespaces. By default the legacy mapping would be on in the main namespace. To some extent, the problems we faced with modules such as zsh/files and zsh/stat are because everything sits in one global namespace, so we ended up with Peter writing neat extensions to zmodload so we can selectively load feature-sets, to try to work around this. Why are infix operators in conditional expressions not just callables in an infix namespace, where people can write their own functions or load modules? -Phil