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=-6.0 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 19577 invoked from network); 7 Oct 2022 21:59:56 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 Oct 2022 21:59:56 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1665179996; b=EDrkoFRzypKkmQ5BqzBBPDxBP5CkV5DoXfCYMSB2yM6w6kf5BiDeAZX+3UQNSKkJkJFNOZZtTr pgRllUJEMxxa8uBnaX+NC9cpI3KxITwjj4V6i0oAIsHEkrJNKWEej+zc14oiX5p7U/e8krACSM Z9W/YAfQ979ssQMDDip8XLeZMfGNXRNzrX6B+RM3zOSiZpkAbuhLGdxW/HNhI7omIva9rmoS2F bHrGFqYiRyBaoJMfo7UDuSYbtatcFu9v1FyqJrsgbZeKZaxARI2QCDF4zEH5BXKyDdMO3X0Tva AwU2yQxec+ZE8jTWIPpAs5otvDbRIUsXeV0NQaHGMTY6tg==; 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=1665179996; bh=vMigmV8JsMd8xN703cMcXoShdY3wTlK0TSkgUtWdsNo=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature; b=oxHeM3tYdkvtbH4qG73VFUXZC/2w5NdQvR6UTEgZ8CupQ6heJXeFMjf7LTzDuZJLAN0ugiqfM8 1qd8fhTP6zR2N9lbTZdA0wOm6aqr1xKwXRiDg2bmW19sUtTOmbDrwaacPaniQwKDfXGiCD/JqR 32RV7ae7UPJus16ccp5QxM6CU9k46sph7H2Ozgs7S9m2Lej7LG8mZWosvbA22nvRhYpgLdUgkz osr53p3XPsxgWk2iBdw6Qk0PytnAxCC5NOcJ0lXmWo46a4gsLagVIbiGKjjaF694HHfxWqVv4w h7tk4oSONT9m4lA+IhFJsjhbo2f3uimdcrfCuCXGhAGy2Q==; 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:From:References:To:Subject:MIME-version:Date: Message-id:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=W2rMSEX+wn5nTHvzvGu41YsN8yZx28HKGyS+4EJSIm8=; b=efhmsf93iu65r2lheYmzkLo4aW 4GdlGsN/tdJBsBlyLhSVNqeFH2qbVJk+crrWOH0flcEfdFCyvBkYxqZ70G7DhlvhonAnyrUS9+YOY OP+9Pc0qs9ic5+w3Okq2Dr+D77QEwCpfruYpt4saa78sh65Vit7OhiRbjaYGloLuOPkD4eHEj1Hlw YYvrbrXcIR0YHnkzIRWc0NY5bKVNqvdMMFTZg08q35oB9//GIjmO7TI7mH02dR4ES/MHTLWNIJ4xp JsLaW8z28i9GiPv6t4oAZapsOiSUJmff+munsMC5lqFoJG5MiMK8BSIFvp/8gJCmkyJ+HNVFQdIfb XOS59Plg==; Received: from authenticated user by zero.zsh.org with local id 1ogvNr-000KgY-Gc; Fri, 07 Oct 2022 21:59:55 +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]:42933) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1ogvN7-000K0Y-Bw; Fri, 07 Oct 2022 21:59:10 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta04.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RJE0074EJLPEN01@mta04.eastlink.ca> for zsh-users@zsh.org; Fri, 07 Oct 2022 18:59:08 -0300 (ADT) Received: from [192.168.0.4] ([24.207.18.108]) by Eastlink with ESMTPSA id gvN5oGuPzPnGPgvN5oYctG; Fri, 07 Oct 2022 18:59:08 -0300 X-Authority-Analysis: v=2.4 cv=Cu96zl0D c=1 sm=1 tr=0 ts=6340a12c a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=_vriJxUElik_ufQdVZQA:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeikedgtdehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepiedtjeffvefgtdehgefgteekueeggeeitedutddvvdduteetffdvveelgfeukedunecukfhppedvgedrvddtjedrudekrddutdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrddukedruddtkedphhgvlhhopegludelvddrudeikedrtddrgegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: <7731f988-7537-3a64-0fef-87848d656ca8@eastlink.ca> Date: Fri, 7 Oct 2022 14:59:07 -0700 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: unexpected unmodified variable Content-language: en-US To: zsh-users@zsh.org References: <1774a1bc-c353-4e16-80a2-0082457de6e0@eastlink.ca> <3bf17a2cc56cbc65fc0ba855fe9c7d2d2f63befb.camel@ntlworld.com> <8b1497ca-5d26-3e23-47c7-1c85b7c4fa73@eastlink.ca> <0bc658a2-3941-82f5-2433-d105f31db09a@eastlink.ca> <24710fd4-bf5f-889d-4cca-8b922823cb86@eastlink.ca> From: Ray Andrews In-reply-to: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 28200 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 2022-10-07 13:00, Bart Schaefer wrote: > ... which might just be the most impenetrable bit of computer > bafflegab I've ever read, I can't get past the first sentence. > Seriously? This is all using phrases that refer to concepts appearing > elsewhere throughout the zsh manual. True ... which makes the manual hard to understand.  It's a language unto itself.   What would be helpful is some sort of introduction to zsh-speak.  Mind, I expect all the shells have about the same jargon.  But believe me, when you don't know the lingo it's impenetrable. > > Oh. Given the way you wrote func2, if you remove the return statement > there are NO math expressions in func2 at all, so $(( func2() )) is > [except for side-effects] a no-op, and the assignment in var=$(( > func2() )) is just skipped, leaving the previous value of $var > unchanged. Ah! ... yes, why would it change? nothing has touched it.  I was expecting func2 to somehow cough up a null value setting 'var=0' but it's not illogical that it coughs up ... nothing ... therefore there is no assignment and 'var' does not change.  I get it. > "Local" text substitution is what ordinary $param references are for > ... $(...) specifically means to use processes and pipes. That said, > a still-missing feature in zsh is the ability to tie a function to a > variable so that referencing the variable as $foo invokes the function > that's tied to it, to produce the effect you're asking for. Ksh has a > syntax for that. > Well you'd know.  Anyway as usual the functionality I was looking for is there even if it didn't look like I expected.  By now I should have a permanent understanding of this stuff not keep relapsing.