From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-return-43739-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id dda2f4af for ; Sun, 28 Oct 2018 21:13:25 +0000 (UTC) Received: (qmail 18105 invoked by alias); 28 Oct 2018 21:13:08 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 43739 Received: (qmail 469 invoked by uid 1010); 28 Oct 2018 21:13:08 -0000 X-Qmail-Scanner-Diagnostics: from mail-lf1-f45.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.167.45):SA:0(-1.9/5.0):. Processed in 2.587404 secs); 28 Oct 2018 21:13:08 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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; bh=ZUje6uMEdQi6l+wSN2MRUWhJTrWAIyKfBzXjlkJXqMM=; b=BHp+GYljBDl4UvuqNiSlGhwtxaSpNyF3LfkrdHJ4k0S1X7do0OeWXwPiLcpRCm8rJ6 J1ByvshCjQu5ZCCh3tsn3GIJ/pUWUWIkc/Rg9q8/C28D5p017VQiaTH/gJt+HZ2L/PNU Gh3KSPYYda5aIw51OmCo9y0D6S/pKTX7uqBI4lm9aYhM/W3Hv5qA4Jj6MSiG8PYzDvmg 23+vVrV1BN4rjVPuwqx4P0Mgghe6Mxq5SmAeQSaPnQ2RIu4gof7PhFoGxekJFwFfDzE4 o4hhBzXuZ3rraHlg4NKHNeq8RCtb3T5BogqQ3uM+jYoFPTyAPv6N66CW/vRWe0gsOjOU mINw== 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; bh=ZUje6uMEdQi6l+wSN2MRUWhJTrWAIyKfBzXjlkJXqMM=; b=cG6pc9nZCIg1l8IzSkVrsQyd/ak8dv6zbMXL6q6OobLt/1aQUelcZNq6C0Tr67+D0m YJnS3FcRiGrHMz5VMlN/LS0w+5X6TjLK+HRi1CERIeykAV/sNY/WksgBH/WgMIWHYPZI x/+knMqloRAq1TwQHX+423uvkQ4qTCw5XFJsdZfAinl9naC3pC2SBdh5/vvwsKb3DMLR Wbg/Lh00e3r7d8qKDlhGu1ufRFTRpIZYZ4NnvAlo0QNBl6YxXQlqZ6m+n0qLtLKfxsHX KgWjDgPa026oh4WNHGdMM6AoQ/4BCL+mwN5GfGi/plQqIcVstNH5Bn14SH+WXVLW+GGc KUfA== X-Gm-Message-State: AGRZ1gI+zjNPxoIuTBGsnVQMYRk1QqFRQ8vJx1UX8hkQDSW3Rp3hG/Wv XrFIQB5wXcoOO9ymbjGMo6VvTFI+Lnofd131j6OJiw== X-Google-Smtp-Source: AJdET5efx7+S80BDa886myfugj7lUk5Cxu88NZwI0u7zjHvN5mcOzn2z+MBmk38pcm1IUT9QurD4nenn9TvZl8Mh+rI= X-Received: by 2002:a19:2b54:: with SMTP id r81mr6906062lfr.34.1540761181363; Sun, 28 Oct 2018 14:13:01 -0700 (PDT) MIME-Version: 1.0 References: <1BE52C46-161F-412B-A539-4B0EA87A2FCE@dana.is> In-Reply-To: From: Bart Schaefer Date: Sun, 28 Oct 2018 14:12:49 -0700 Message-ID: Subject: Re: Inconsistencies in "-quoting and @-splitting, could someone elaborate? To: Sebastian Gniazdowski Cc: "zsh-workers@zsh.org" Content-Type: text/plain; charset="UTF-8" On Sun, Oct 28, 2018 at 4:54 AM Sebastian Gniazdowski wrote: > > @ is refered to as "@ -- double-quoted splitting of scalars" in > completion. Well, that's incorrect, Oliver should not have put it that way. @ has nothing to do with splitting of scalars; it would more correctly say "prevent double-quoted joining of arrays". (In general you should assume the manual is correct when it conflicts with a completion description, because the latter are often radically abbreviated for short lines.) > I understand it as: for quoted expression, regenerate > array-form by doing splitting. No, it regenerates nothing. It just preserves the array form that already existed. If there was no array form in the first place, it has no effect. > So one can obtain always-array behavior with @. Also wrong, which is why the (A) flag was extended to mean "treat single-element arrays as arrays instead of as scalars". The description in _brace_parameter has not yet been updated for this (another example of why you should believe the manual rather than the completion descriptions). > % array=( "foo" ) > % print "${#${(@)array}}" > 1 > > Despite array is single element, @ splits it into array type. Again, no. See my previous message. ${${array}} is special because $array is a parameter name. ${${(s: :)scalar}} remains scalar if there is no space to split on. If you want the result of (s::) to always be an array, use (As::).