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 24850 invoked from network); 29 Nov 2021 17:52:58 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 29 Nov 2021 17:52:58 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1638208378; b=ArY43rLqbN2gxPzG1PZ7BnFOGhZvnEWO1rhPW5j8u73gQUuzxFJuoGny9uBicFBwQxKKqEGZdc L6+D00FYEXlmaCOjx+3BbsvDZLpcSdKA9chPzU+A/K6wdhBStN/IkiCNoIx3FD+8MsH3fzeExF w599QkIhIZ25JwEN84vlvA2HhT7ZmavEBIIr9cQfdpndkI/m5Lt5KkLPa6fpgw8EvNhiBaoXFC J0qCetF02NDXj768Km9grA0Swqr4u1mMWnBrwBT0YNpNP78D3f5eeQhefYFLTn88hoAYM6Cz68 YBpLxmDtC1Qo/R3RnJCq+qBXGnF3L7hPOkLJKENsJHwZtA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=luffy.cx header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=pass header.from=luffy.cx; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1638208378; bh=1S4gut/J7aVsYbcoBDgeCtTg3dGG55hBIUtaLaDEAJU=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=L+NzGSz68bySWTwukBh2ARk6lw2SBJFdTESqej868bdHz6lGBHFB2VwE9+x9jAbbUTH1WK4cUh ZX1z7uJjl2RPeL5xoR2zsZupU+hdObEvxbdT+cCQ1RcroT7piFJDm3iKNAYZLIfZE3EuoUO+ps r0jU2LZlO1HRdAaPQQjo1Gucqjo0aFC55v7RVKDhfubwZ3sxn84u5NTDoDWPl/zfg5r8qMw5B1 tkmrsWbxUYIeXHJQfBLGzt8lDNDPtCvesPVL8A1SSU828qu/gchMDoUqVAnEzMLcHzBNk5eGRW lMQBMWf5niEClpg6B/Ta73PKjuIGEYTGzVwaA5Dm1UxEyA==; 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:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=rzdnpgjm4hrZGkpmXGouYRj1zzIZyLZD9GxJr60u9Dk=; b=VFQW0SAbVWJsrLlkscGcnp8KFE Cp0b/P9c0ptTx/a474pOm3CRXMYoUnm+3xKfwlgdAqfS9CH6jLeI+jBDig5VzLZQWhMFg9GFc+uJF h32LWvw52ezJA6c0y+E2odpVYaS6s3/PBSFEvW+pzQ7xfOcOooJN6KBZFO1aSYRQsLD2rrSmAQIrO 89EovH5ALfqfvudF8dqUhMvdpU96YosiRCe28eUEwhbdmdZvaC/W6FXb4YHYzjUCW04OJidYW7ng5 cXRYs99HX8SLEmZMXYBucjblfvbsFjhoENYjT4tNsLq9MLP3wUx7lQWYnD3DKXB+XPD1memN9mL9J 5Y2H4C1Q==; Received: from authenticated user by zero.zsh.org with local id 1mrkpm-0007tO-02; Mon, 29 Nov 2021 17:52:58 +0000 Authentication-Results: zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=luffy.cx header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=pass header.from=luffy.cx; arc=none Received: from out2-smtp.messagingengine.com ([66.111.4.26]:37477) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1mrkhQ-00063S-N7; Mon, 29 Nov 2021 17:44:21 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id F3F995C01BB; Mon, 29 Nov 2021 12:44:19 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 29 Nov 2021 12:44:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=luffy.cx; h=from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type:content-transfer-encoding; s=fm2; bh= rzdnpgjm4hrZGkpmXGouYRj1zzIZyLZD9GxJr60u9Dk=; b=m3HwEuxgCY2ODHrq zGsm4J0ZmsTJ9v88fF5q2IyaEhJa6wHMlYTkxIBijV2HcUxgQMAJtYBuWL2k90y3 ag1JqyVW5pCF17M/yYG6/Zcko3u0n+0dgnIFVlx6zcFiLkUmddS0Rg9EjJRwlNWr S8GCWOxbYoWKhKzSn86uYHK4nkJtP638Q3cHJkYoMxS8R6q3vNt0VB0X98cy9ev/ SIhm2kp2gw3tNYmYrdfkOQDaZ8m+lUKmEuFCznBeT9fTUk0VVYo4ouPy9r5EhpWe f+p54lcA5OyHuZ8DkaAc9lW/x7caPYMLcdHLZ/BchKX/+XLNQvo7HUKprN8TebfE FUHtDA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=rzdnpgjm4hrZGkpmXGouYRj1zzIZyLZD9GxJr60u9 Dk=; b=BhqQamiC9Cw+DSIjBIlwXKlxWC+01U81jepIe+VxuWAtYB8qcNcjgIxbG Or5RHt7cWdMNhdb8xEDs4uWFhUsjJ3FmJAhXUHhKJWOI1q9oaktIM4Fg9RN0ZhOA Ahdj082CUTuvwxp8s31KniOSThO9kcginZwg6k9XdfQHec4qThwxbgUokcjFVGU+ +bUxFZda+JDB+MWU50hdFQq/jNz3Br1y8nWvOpLvIHdRdxWEduG1PXZCtiYaVSBZ 6kijWj0zTMb+KXNinouiQiCePmLISuA8FkQhGOcK8LjwrzoCU8rURfdkbmz0BWOR 8kmoT3TeiYkSsmsrTqKDT2cwfUAiw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrheelgddutdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufhfffgjkfgfgggtgfesthekredttderjeenucfhrhhomhepgghinhgt vghnthcuuegvrhhnrghtuceosggvrhhnrghtsehluhhffhihrdgtgieqnecuggftrfgrth htvghrnhepueevjefgfefggfeigfejtddtffehtedvleeivdeufeehlefgjeevffekfeel gfefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepsg gvrhhnrghtsehluhhffhihrdgtgi X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 29 Nov 2021 12:44:19 -0500 (EST) Received: by neo.luffy.cx (Postfix, from userid 500) id 9A80F1041; Mon, 29 Nov 2021 18:44:18 +0100 (CET) From: Vincent Bernat To: Roman Perepelitsa Cc: Zsh Users Subject: Re: (z) expansion flag do not always return an array References: Date: Mon, 29 Nov 2021 18:44:18 +0100 In-Reply-To: (Roman Perepelitsa's message of "Mon, 29 Nov 2021 17:34:14 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Seq: 27388 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: ❦ 29 November 2021 17:34 +01, Roman Perepelitsa: >> Is there an easy way to know if something is an array or a string? >> I am using subscripting for that but maybe there are better ways. > > If you had a parameter, you could use ${(t)foo} or $parameters[foo] to > find its type. However, if you had a parameter you wouldn't have this > problem to begin with. Thanks for the tips! > foo=(${(z)...}) > > Here foo is always an array. Yes, that's what I have done. -- Let the machine do the dirty work. - The Elements of Programming Style (Kernighan & Plauger)