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.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 80922238D6 for ; Sat, 4 May 2024 21:36:54 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1714851414; b=m52U2cal1Cl6x+i3+7GrQ4gJdENQWGbfUYM2LwY1gi3YI/rVLfbn55ePFpVlmDOA4yrW/XPmK1 +yEVkMX9s88I0Unnypa+fQa8bnHVM/qJx1LsxF5GHrmcaRYHHVHOl/yaaadT5l3Bs1UmXYDITk ddPioi/QYXFq4iUZ1OAJ+7oxPC1qRA2X7q+aheXHM9IkKLDlhBHaBa3NmQdatiGLswIFis6+Jh ydnzAeY2NFwwDJxgMUmffzkzi9r3L8cwvb5qiX2COsVDQyeCXS9DZuPed2y0vJxLDH0mZapryH rDLZi4Dmn99NY5vjvGURCHC2VbBMAmgZrmiKgpBt6l75bQ==; 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=1714851414; bh=zUw9eihh/AoLZBigrxF3my7pMHaoZzLxZOTPMfGjns4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Subject:From:To:MIME-Version:Date:Message-ID:Content-Type: DKIM-Signature; b=lJDpR8GVvuoLwe4jlYSXZYrHH1UNmiiHGSfGAPjY+UGBmisFdFCslSI0qwJ8QNZpwhn0i/viGM 3JbQc73vaLO6qCeP/yXRfcu5d4fHC38BBQYVP77T60gip0oSS6mjG21ge//Sf1ppWLHmaQ3HtB uWZMSqhYus+k7Krl+jxMj8PlaJqgVhgjy9zuVJJ0vkku68BHsAlBwj452tm7+rV5jIWHLGvrs8 yHZ8BbUIv5p7Z2UdM2drdabdjgZ8pjrRfeXJv6xEHnX9vGIhwEkF4ITPSmmCy5uttS/1YybQGi PCFAKeNt80hgwT4RKojh86YTe07jAYD/NW2hzhKB1R1jow==; 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:Subject:From:To: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:In-Reply-To:References; bh=TtmDsemgTx8knLOwC19GomztAJdYpiDZyevOxHi0BWc=; b=K27uUGYdyDZEuRnMfiRdtl4VYk jW7PX6GEK+E74k9v1j1oJehtprcsIa6YGtGIKoOQh+Vi5eTdGj9ODLvQS2KyEdXLBKWB2al3D5GRK 5vJQpH+W9dSFqzKMeahvatzhu5KfxlxElRxhGUAV0M8Rf+9n1XesIqeRGGrOj1l/ljGoA9Q7z9i3f PtbUFYHpw56tvQjXcOYUHFVepU68bwN/KN/J1OxDoaCQTxT/e2VqkiTaj7sGuYZS/2TWCPAQGsrO1 2wMPKyJ7YpRLonHvBJ7F1ORVrPAGdlHEKDhzX17fPd0UBvMS1n2xxMX4cST9mb4cmjAjAt8QJ367p xLh8LhTA==; Received: by zero.zsh.org with local id 1s3LBl-0005oN-Ox; Sat, 04 May 2024 19:36:53 +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]:49637) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1s3LAy-00056d-NX; Sat, 04 May 2024 19:36:05 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta03.eastlink.ca ([24.224.136.9]) with ESMTPS id <0SCZ0HZR57S0X9Q0@mta03.eastlink.ca> for zsh-users@zsh.org; Sat, 04 May 2024 16:36:03 -0300 (ADT) Received: from [192.168.0.11] (host-24-207-19-13.public.eastlink.ca [24.207.19.13]) by csp01.eastlink.ca ([71.7.199.166]) with ESMTPSA id 3LAwskY4G98ni3LAxsoIgD (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Sat, 04 May 2024 16:36:03 -0300 X-Authority-Analysis: v=2.4 cv=C75KyhP+ c=1 sm=1 tr=0 ts=66368e23 a=e7T7DzMKK1R988ZCg0wLyw==:117 a=e7T7DzMKK1R988ZCg0wLyw==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=R6d4K5PNVwgtHBKo8v0A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=4Irt9es1Fxlo1fSYVkIA:9 a=fZmmfColh-e3Tpdn:21 a=_W_S_7VecoQA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddvvddgudegudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurheptgfkffggfgfvhffusegrtderredtvdejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpeeffeeivddtkedvgfetkeevudfhtdeltdegtedttdekieffhfeuhfekheegtdevteenucfkphepvdegrddvtdejrdduledrudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrdduledrudefpdhhvghloheplgduledvrdduieekrddtrdduudgnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: -100 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Content-type: multipart/alternative; boundary="------------8iJvJ7f6WNMlZRCtcKq9WMtk" Message-id: Date: Sat, 4 May 2024 12:36:01 -0700 MIME-version: 1.0 User-Agent: Mozilla Thunderbird Content-language: en-US To: Zsh Users From: Ray Andrews Subject: nesting issue X-Seq: 29886 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. --------------8iJvJ7f6WNMlZRCtcKq9WMtk Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Getting more comfortable with nesting things: #1: local in=($1,*(N)) #2: local sorted=$(print -l "${(n)in[@]}") #3: sorted=( "${(f)sorted}" )     ... works fine, now I do an  exact verbatim nesting of line two into line three: local sorted=( "${(f)$(print -l "${(n)in[@]}") }" )     "bad substitution".  Ok, that could be because we can't nest quotes so: local sorted=( "${(f)$(print -l "${(n)in[@]}") }" ) local sorted=( "${(f)$(print -l \"${(n)in[@]}\") }" ) local sorted=( "${(f)$(print -l ${(n)in[@]}) }" ) local sorted=( ${(f)$(print -l ${(n)in[@]}) } )     .... none of those work.  Is this something were a literal substitution of one block of characters can't work?  It hardly matters in practice, I prefer the three steps above, it's easier to digest, but purely as a theoretical question, can I nest line two and three, or even all three lines?  I'd like to understand why the parser doesn't like my efforts.  I can see that the 'no nested quotes' rule could make some literal substitutions logically impossible. But maybe there is a way.  If so, seeing how will be instructive. --------------8iJvJ7f6WNMlZRCtcKq9WMtk Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Getting more comfortable with nesting things:

#1:
local in=($1,*(N))
#2:
local sorted=$(print -l "${(n)in[@]}")
#3:
sorted=( "${(f)sorted}" )

    ... works fine, now I do an  exact verbatim nesting of line two into line three:

local sorted=( "${(f)$(print -l "${(n)in[@]}") }" )

    "bad substitution".  Ok, that could be because we can't nest quotes so:

local sorted=( "${(f)$(print -l "${(n)in[@]}") }" )
local sorted=( "${(f)$(print -l \"${(n)in[@]}\") }" )
local sorted=( "${(f)$(print -l ${(n)in[@]}) }" )
local sorted=( ${(f)$(print -l ${(n)in[@]}) } )

    .... none of those work.  Is this something were a literal substitution of one block of characters can't work?  It hardly matters in practice, I prefer the three steps above, it's easier to digest, but purely as a theoretical question, can I nest line two and three, or even all three lines?  I'd like to understand why the parser doesn't like my efforts.  I can see that the 'no nested quotes' rule could make some literal substitutions logically impossible. But maybe there is a way.  If so, seeing how will be instructive.



--------------8iJvJ7f6WNMlZRCtcKq9WMtk--