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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30169 invoked from network); 31 May 2021 04:24:54 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 31 May 2021 04:24:54 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1622435094; b=q++rYGwDz5D+SaWHWgV4eVRvOvW14XuGy70qFraty8jW9DcKVSrywh9HqqgoMchhnYi1RFb+yP dFKK3hIw7fnGXVx4NLlXDQvFXS6o+qERtmaOXNCvH7NYX71t7bnnB1rKrYgqMuH41cYCHxpiCm 4mkR46dmj6Hjt9ajFFirnhtJOdFR+h0tO3QAx9YA06fw0teLgGIBzeK6BpWZQcinbFKUqSkudP TSr4TA2sCYBYnPqtbsjxY4srxgnnCKgAdF7ewP8dhBFnS1pLgDUXvqszj4E1QL4g53oUtPskvB NpOTlmDRAoeyPJG4yKWw59GptoBWHmbMVcZ3I1EilahQwg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oo1-f41.google.com) smtp.remote-ip=209.85.161.41; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1622435094; bh=V5mE5xbKnsBQzmzQqzvj4r9ThkZafRIPR1fypmN6HIk=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=Gp5QRWItnoIgexX//gP0Te5Zim+taD3xPrEbfnLPp3Aqs0JYsEjR7lB4fQSujbBTw7LkJluCaO X6aSAxlG6P14/PrkyMFLPjKoja4EdcswEQmhD9yxvn0YXwaD/4CZTIf0O1A1Coe/Izpm3gCUsS yKc0QGhqEnNEJ55G3LsmDP+xpKgFlcW2ywQrHLkZfrzWBK7u8ckwsq+4HcAjwOp87Xg8EiSGt2 YM2ezqh7Mb0QdSW5BqgL0xxajIIQvBK+MAHlFAgEEs4Ju9rxVvhNhH1O2Y5cKeXziuaMwfdIKF wc/NPg6QH/Bn0tRGmQIQWRn5F98vaarbLeC6yYzy3MLUbA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=V5mE5xbKnsBQzmzQqzvj4r9ThkZafRIPR1fypmN6HIk=; b=L82ust+RENe+HNCFqtXbfFVEAw 3l7fHwKwDL+9Xjc3NHEQ2mx5apwPPLwqs7ijP7QFOm/Z5k6TGOKvJpg8w9AMXK45WmbS4GUQu1gfF P9Dw7sdEL0X/YeIu3r5rHpJL1Ge5GsARi63y57SBr5gxom2d1S8TJMiLpRFegnJ71KIHnemRm6ttX VR0gjMm4J2AoiA31tYVO/H9Dsb8mn1TZmU9IheA35UL9cSznsRAOQLV0DnrLLwvDQhEjvSDrSoxHV kk+YdvaRsJzvKzrKJhEUacOeCy75q6UmZt9CXvCKYm/0Zq2y/L/gfoHShPb0wTbQ8nlzQErQBCuH8 dxcQpTeg==; Received: from authenticated user by zero.zsh.org with local id 1lnZTx-0005fC-Ms; Mon, 31 May 2021 04:24:53 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oo1-f41.google.com) smtp.remote-ip=209.85.161.41; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-oo1-f41.google.com ([209.85.161.41]:33742) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lnZTQ-0004vM-4o; Mon, 31 May 2021 04:24:20 +0000 Received: by mail-oo1-f41.google.com with SMTP id j17-20020a4ad6d10000b02901fef5280522so2515163oot.0 for ; Sun, 30 May 2021 21:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=V5mE5xbKnsBQzmzQqzvj4r9ThkZafRIPR1fypmN6HIk=; b=iapAbsGkdmAUhVF1PTn5znlOxR5SlOGdnDThYFRmR9umUfnmd+xruB6lYcHgdrqgUn 2h4ThBd+Dn9X8FsRCAeubu4qGX5a6MTCzW59I8CsbRbVqLP/dWjN40h7JXaNw/yR/bI8 TdLK4aQkp9cNaPGzMvV7kUCpti4dl3GvoE7VHNloNB4C/KMfhtmhzsvrMIMhVq6VkuBM bB0T1mFe5zaw2pHf5eawgoaN99ml8SLbTz06q5dmYW4KZ0H0EVenky81LBPAojEtPIWO +60vbxm7rf7ZPfNoHgrwYt+n//fbaIWF5yQg5K8imGAhtZ5b1rt+8YipHEvQv66IfQRE AiJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=V5mE5xbKnsBQzmzQqzvj4r9ThkZafRIPR1fypmN6HIk=; b=hx7A+TgiNV8t0ibfDWkY6kUeN0sWqseigBZmD1birIVpW7/pHdyxJFfXuKGssZXNBi ULNr/uk+ORLTElP3zz3p3knubHicusmJOr0hwPGMkCLSVIVmjjmZPcoy47A1vX1uA964 schaa6dRf2GR4IFB6YsNMsmobPq756tiJJKs+O/hyOJAorn4ug7ohywHija7DPkZqbCb jCYkasFWPDaCSrOa69/bDBohtyDKN9jGKoGyeE6NLBePyaYFb1NZDPo+cpjnkomHjZFw VsH6ehzQD/UEZyt588QtdP6YNz/zJOYaMD2tYL/rqAMT++p+V3tHr/7UNStHsmESCcGA ZKow== X-Gm-Message-State: AOAM531v/tTEvlCYAZf/uaUk2Dgxc+3RqGjkHg6yoL+x879BxvMddtpW 0n+Ptndcxqz4skXX/TI6EoMqpqrB1CyDBHyBUzHpsg== X-Google-Smtp-Source: ABdhPJxSHAB/Tbg7ZUdXISp3ohtuj1WJ3H2POWCfVxW+fGYPdI3zROfyVOu22PK8re5UcZAvHFK30HvNBxZwRbuI1gw= X-Received: by 2002:a4a:b98e:: with SMTP id e14mr15109252oop.82.1622435059010; Sun, 30 May 2021 21:24:19 -0700 (PDT) MIME-Version: 1.0 References: <26fc6ecd-4a05-e562-7274-ba045df536bf@necoro.eu> In-Reply-To: From: Bart Schaefer Date: Sun, 30 May 2021 21:24:08 -0700 Message-ID: Subject: Re: [Review Request] Arrays and their usage To: =?UTF-8?Q?Ren=C3=A9_Neumann?= Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 26750 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 5/31/21, Ren=C3=A9 Neumann wrote: > > > > Question: Is this the correct/zshonic way of doing this? Using arrays, rather than repeatedly building strings that must be split on spaces, is definitely the "zshonic" idiom. > > I personally find the change of behavior by adding ( ) too easy to > > overlook. Is there an alternative with ${(...)}? I'm uncertain which change of behavior you mean? On Sun, May 30, 2021 at 5:28 PM Mikael Magnusson wrote: > > I would probably have written it like this > > local pkgs=3D( ${(f)"$(makepkg --blabla | sed blabla)"} ) > sudo pacman -S $DATABASE/$^pkgs Of course it's possible to do this without the "pkgs" array: sudo pacman -S $DATABASE/${^${(f)"$(makepkg --blabla | sed blabla)"}} But you should do whichever you'll be able to understand when you come back to it later.