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=-5.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5365 invoked from network); 27 Nov 2021 19:26:28 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Nov 2021 19:26:28 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1638041188; b=p2OQfULPMwQxUa+r0r28w+l7E+veEdBFkJ6IvdymNsxytar0qex16in0j92E6E4r2DOZ1h7xOh OoqGzaZtHbosGw5zcETOVveec5Xzra9GTY5UCzCzyaH1m1uVdnN/uCnm2JflGpHzJAH1PwJsr2 crlgJByRuxSuBD4eGbRWV27V2p4FyqwAYSGEiWTglzMU2GINk75KZwZQKt3P3ERR7hQeLfzRIl xQl578K/u3zEakkEv0IqkljeRatjhAyHIhnIBcGTi6vG41fL6sx0iQB5cIProC/joavSWvQSa9 7eJck60yGOgD3JMxXB0RnPtaTSUAy0js1lkE0pFPbn76ZA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1638041188; bh=urJgCIp4/IgZKFzqQ1+Leqsi7KzkIAGcr/7TY/OrBFw=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:To:Subject:DKIM-Signature; b=Ej5/ZSXsR8cZM9179WpZIx/5XLhrC54o4gc/gnpO/OMMM7kGnzGaiRqavHiJc68VPN91zheSC8 TlfhDRgbKxcGjIrnrdAdq4e5c8F6i+WDwO+/E+Te5y+RbWLbkf/4gRO/aTbz5aJIUOtw+qDYbL OgU2FqNJGBllD4a+AINOWeCKNktzhI/ogjwdWODqzRnp9JOhs1maT5oQowqiklz8ZW8oDKSJ57 dboqtwvAIr0oz/fZ266XDhehVD7z+7zErtvxDlHUqZW3nLgqXGj++Umi9/FEVGD0gf+/0AvsPF gfFPzHF/wGleJnb+NFryEDlqme76QjQBadwekWVmiWQEAQ==; 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:Content-transfer-encoding: Content-type:In-reply-to:MIME-version:Date:Message-id:From:References:To: Subject:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=xk/KDQvTvVyDtjbstiArQ0g901x5gNLn7spgiBLe1tA=; b=G9xZJpTRbpTKl3b+X5MnM1QIhB gFmaRhfgUvVTUkFBtkPwn8F37olnj1RDIGQr1Ns3QLPgTdv305SSf804cLs+b0V29V+gBYpswaVVl 0JrVDExYa0xAP2pSDN+TcJ+oT/mT7tMM19nlW9O40fh0qC48KkJlszc5n6C4XFH3e+KPd5Lzwffsx JaFLhTdrgKpAYU3+ITZE0DukkuCFI8FM9T5qpV1ZQ9zb1oPN9p/+2TrqZJuIaKrB7D06iOumLqeRl lhbDco9Gv0Wh7c7ray8v7UOYMNcAsFVGcXivf855HwQmdcIGlGmzdnXTPHjG7RoeMu5QnBl5u4hTH zSgtH5ng==; Received: from authenticated user by zero.zsh.org with local id 1mr3L9-000KEj-A2; Sat, 27 Nov 2021 19:26:27 +0000 Authentication-Results: zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none Received: from mta04.eastlink.ca ([24.224.136.10]:47040) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1mr3Kc-000JXm-TS; Sat, 27 Nov 2021 19:25:55 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta04.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0R3800BQYW71VI60@mta04.eastlink.ca> for zsh-users@zsh.org; Sat, 27 Nov 2021 15:25:53 -0400 (AST) Received: from [192.168.0.2] ([24.207.90.194]) by Eastlink with ESMTP id r3Kamy3Xc7w3Pr3KbmLLwH; Sat, 27 Nov 2021 15:25:53 -0400 X-Authority-Analysis: v=2.4 cv=af6kITkt c=1 sm=1 tr=0 ts=61a28641 a=zv49KfEsxEDzuN5AGO7r0Q==:117 a=zv49KfEsxEDzuN5AGO7r0Q==:17 a=IkcTkHD0fZMA:10 a=-b2DYF2mFpIILX7QvTYA:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrheeggdellecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpeekvdeuuefffefhvdeuieetffdvtddvjeegueejkeeiudehieetieehgeetvdfhfeenucfkphepvdegrddvtdejrdeltddrudelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrledtrdduleegpdhhvghloheplgduledvrdduieekrddtrddvngdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhgpdhgvghtqdgkihhprfgrshhsfigupehtrhhuvg X-Vade-Score: 0 X-Vade-State: 0 X-EL-IP-NOAUTH: 24.207.90.194 Subject: Re: Source mangling in $functions_source and typeset -f To: zsh-users@zsh.org References: From: Ray Andrews Message-id: <66a84643-de4f-ef74-4664-d2400f74f2e6@eastlink.ca> Date: Sat, 27 Nov 2021 11:25:52 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-version: 1.0 In-reply-to: Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 8bit Content-language: en-US X-Seq: 27371 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On 2021-11-27 9:47 a.m., Bart Schaefer wrote: > > With the exception of the contents of strings (including > here-documents), the original source of a function is not kept in > shell memory. Instead a parse tree is stored and used to regenerate > the function definition by "typeset -f" et al. That's most interesting, it seems circular so there must be a good reason for it, but why take the source as written, then parse it down to 'clean code' and then construct whatever internal representations zsh uses and then reconstruct clean code from that when one could just repeat the first step?  Is it perhaps faster to perform the 3d step than repeat the first step?  But repeating the first step would surely preserve more?