From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id C08D5235C7 for ; Sun, 4 Feb 2024 17:10:26 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1707063026; b=F5Bhy/NItfsRY/tfIPM3HQwXM27nNhyUjf8eislc8afd96plXdF6L5kHWINj9bUODJyqfM/H90 vhzQiCfA/k5HSuin6N0s9wMxoZ7UBKFGeJqYG1XTDtZbTArCbdPNYHoObaiOi8whxynrOrbwGp JluYtbq6LXwIkR8qyuBinlrp/JRTkpfHht1HE1gkb5OkPY+W+RpaENjO+ShdFeT/geYu0FqY5v cXRCy/VVNwrhif6oPlgWd4xLh1zQ7COd4vPeQURZzKlV6i4WK9GMcRGZHt7qSfjBHZS2ClZWQx lDDwHiG6L+g+KpE4U8ywYQuRubyl3Yl27yjOTneNgxqzHQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta03.eastlink.ca) smtp.remote-ip=24.224.136.9; 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=1707063026; bh=ihRZ1hglqTLbCxa/R7+QgN1SafDlqQXrIUAXyN1Pe1w=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Content-Type:DKIM-Signature; b=jeAmVK0RK6JGR0KioH0AjpDiE+wr/knVOk2TaCdC423TX7IVriZIsomSu1yub7omb3EMqfq6Ig 6XCL05ZuKWG7IK+PI56q63UkDLAX1SqFtIx0W8Hlv9V1FUnKOaTUatE7t/M00KpREN+djQWjeh ccPtCMuz9vcF2rB8kvS0Dw5xLiX0/B/iEYTMZfsoZaaBG1BIVwK6XVTGkRIDw4mxCXb6VSFmjX GZr3WihVURc6AcliFTpK2N+CoQYlrKm9TyJqWVuzJFXPaEThTUY9sXUUvw0bs+6vbbWE92p5Ob hLO+fUxF+/2wUox1PWdB+hpN/tghtgn6DIn1ogJ0NVw5RQ==; 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:From:References:To: Subject:MIME-version:Date:Message-id:Content-type:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=GRjYKI9McTlVJxh5HDihizQZRegQfnx6bm3wqAFwzq0=; b=VdPBmRWKmk3Oo325T1dFsuNGCT xhbZRfD9qmcem+5csGPm7WMzEQJLzEjby6jIf/tyHZMzCl/ataVF2NQXrEef97M2qFzJ+lWp4jPAR 8DHGWSbaUon6d32UM7967QT4K2a8kebsYRNwRkpkAVEmwtN6/VOk1GCMsiCIWsWl7rddkgH0CW9/m DRA4xAcgvoo8B3H5zwvSLpVNr95jsykTABXFbc+6P1LoPrGFpzx55omdxjdufNjzsqtrajhjxqn0H UKy6iaSi2xHi/UGS1ElsrHyViENZv+TCIcZE/bphN20lkenE65SrywGy0XLDgtELt3Pr67Xp1B/Ua 5eniln7g==; Received: by zero.zsh.org with local id 1rWf4c-000Itp-6F; Sun, 04 Feb 2024 16:10:26 +0000 Authentication-Results: zsh.org; iprev=pass (mta03.eastlink.ca) smtp.remote-ip=24.224.136.9; dmarc=none header.from=eastlink.ca; arc=none Received: from mta03.eastlink.ca ([24.224.136.9]:45619) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rWf38-000I9Z-9N; Sun, 04 Feb 2024 16:08:54 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta03.eastlink.ca ([24.224.136.9]) with ESMTPS id <0S8C2FKQUA6PNTN0@mta03.eastlink.ca> for zsh-users@zsh.org; Sun, 04 Feb 2024 12:08:53 -0400 (AST) Received: from [192.168.0.11] (host-24-207-19-13.public.eastlink.ca [24.207.19.13]) by csp02.eastlink.ca ([71.7.199.167]) with ESMTPSA id Wf36rMm26mZzJWf36rh2mv (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Sun, 04 Feb 2024 12:08:53 -0400 X-Authority-Analysis: v=2.4 cv=Ie8kWnqa c=1 sm=1 tr=0 ts=65bfb695 a=e7T7DzMKK1R988ZCg0wLyw==:117 a=e7T7DzMKK1R988ZCg0wLyw==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=jyHo15l6B26N1WFxjhIA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=pGLkceISAAAA:8 a=YU2b36km_XDB2HDY-lsA:9 a=faK0Xwi9cdm8ahWx:21 a=_W_S_7VecoQA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrfedukedgkeehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurheptgfkffggfgfuvfhfhfgjsegrtderredtvdejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpefhteethfevgeeuvdelgefgvdevudefueduffdvgfelvddvgfdtieegueeuleeifeenucfkphepvdegrddvtdejrdduledrudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrdduledrudefpdhhvghloheplgduledvrdduieekrddtrdduudgnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Content-type: multipart/alternative; boundary="------------D0zb8y7lzTs7zv8LQXGLyzf0" Message-id: <52b86cf0-d60a-438b-a32f-656c769fb672@eastlink.ca> Date: Sun, 4 Feb 2024 08:08:52 -0800 MIME-version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: for loop 'bad math expression' Content-language: en-US To: zsh-users@zsh.org References: <4c14e191-0605-4492-9f67-9a5b35ef132b@eastlink.ca> <4da0eeb4-4589-4c5d-9b89-a1a22209e18e@eastlink.ca> <7ccf5b82-a37d-47b5-a700-fb1096ab495c@eastlink.ca> <0875ffd7-e3a4-4ddc-9c4b-47e2c593ea4c@eastlink.ca> From: Ray Andrews In-reply-to: X-Seq: 29627 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: This is a multi-part message in MIME format. --------------D0zb8y7lzTs7zv8LQXGLyzf0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024-02-03 20:20, Bart Schaefer wrote: > Note that var has NOT acquired the "-i" (integer) attribute, despite > having been assigned a number value. I noticed that myself.  I expect that all this goes back to ancient history -- arithmetic would have been an add-on at some point and integers were never robustly typed, just scalars subject to special processing, so  ' $(( )) ' says: "treat me mathematically, even tho I'm otherwise just a scalar".  But in my previous post it would seem that 'abc' IS an integer because it increments like one, but even then typeset -p shows it as scalar. It starts as a string assigned to 'var' but it would seem it gets 'promoted' to an integer variable. > --------------D0zb8y7lzTs7zv8LQXGLyzf0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

On 2024-02-03 20:20, Bart Schaefer wrote:
Note that var has NOT acquired the "-i" (integer) attribute, despite
having been assigned a number value.
I noticed that myself.  I expect that all this goes back to ancient history -- arithmetic would have been an add-on at some point and integers were never robustly typed, just scalars subject to special processing, so  ' $(( )) ' says: "treat me mathematically, even tho I'm otherwise just a scalar".  But in my previous post it would seem that 'abc' IS an integer because it increments like one, but even then typeset -p shows it as scalar. It starts as a string assigned to 'var' but it would seem it gets 'promoted' to an integer variable.  
 


--------------D0zb8y7lzTs7zv8LQXGLyzf0--