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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8035 invoked from network); 27 Nov 2021 19:43:37 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Nov 2021 19:43:37 -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:Content-Type:Subject:Cc:To:From:Date: References:In-Reply-To:Message-Id:Mime-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=JACA8Z3h3nsiul9Gn9sy3BmVTh1SnLDBdA0yi0/hHXk=; b=ZlRThDgLiGYR5AClDTAV0wFH5m b1JLHO2ovudOEZ2c9NA1LDtClvyERTaAww+/MqJB4iVeo6376PlqaalHotDBhf0VNPA2rpQnhTneg l315PSBXZ93iUqHbEM190zEpPwF77dRcv+jzlo0GFx4bm1Gq7C+lpXnIwkCon8fJN+Z0TUEEwh5oX UG5HLY2p8euO7FMFQRQc5Bum+uDDPGiw1j2bBFC0Pau839M26eOYCJ1XBsYzsPduTMzssGTfexEC5 yxfR7TrcJ4RziZ06CauE+GAlAdatnUqCHp04p1f7oE0oj3aCKhHRlp33figoA+DojKrwbd5z7HRlT Gz9aZ3ag==; Received: from authenticated user by zero.zsh.org with local id 1mr3bl-000LkZ-2V; Sat, 27 Nov 2021 19:43:37 +0000 Received: from authenticated user by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mr3ZA-000KyY-2l; Sat, 27 Nov 2021 19:40:56 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 57FE327C0054; Sat, 27 Nov 2021 14:40:54 -0500 (EST) Received: from imap48 ([10.202.2.98]) by compute4.internal (MEProxy); Sat, 27 Nov 2021 14:40:54 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrheeggddutdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreerjeenucfhrhhomhepnfgrfihr vghntggvpgggvghljoiiqhhuvgiiuceolhgrrhhrhihvseiishhhrdhorhhgqeenucggtf frrghtthgvrhhnpeeikeejveeludegfeeigfeulefggfdttdegheevvdehvdeigfehvdff uedvvdeuheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehlrghrrhihvhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudduhedu keejjedtgedqudduledvjeefkeehqdhlrghrrhihvheppeiishhhrdhorhhgsehfrghsth hmrghilhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 2248B21E006E; Sat, 27 Nov 2021 14:40:54 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-1371-g2296cc3491-fm-20211109.003-g2296cc34 Mime-Version: 1.0 Message-Id: <8ad53605-3f4c-482b-afb2-82a627de44d0@www.fastmail.com> In-Reply-To: <66a84643-de4f-ef74-4664-d2400f74f2e6@eastlink.ca> References: <66a84643-de4f-ef74-4664-d2400f74f2e6@eastlink.ca> Date: Sat, 27 Nov 2021 14:40:02 -0500 From: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= To: "Ray Andrews" Cc: zsh-users@zsh.org Subject: Re: Source mangling in $functions_source and typeset -f Content-Type: text/plain X-Seq: 27372 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 Sat, Nov 27, 2021, at 2:25 PM, Ray Andrews wrote: > 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? Are you asking why ''typeset -f'' and its ilk don't reread the original source code? > Is it perhaps faster to perform the 3d step than > repeat the first step? Surely it is, if the first step involves disk I/O. > But repeating the first step would surely preserve more? Don't assume code comes from a file that can be read again. What if the original file is no longer available? What if the function was defined using standard input and didn't originate from a file at all? -- vq