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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19165 invoked from network); 6 Jan 2024 00:24:15 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Jan 2024 00:24:15 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1704500655; b=rJ8x7wyBzfa7QjDaXSpKnh/W27NAFS8AEVNfWf9liAL1wKuUI87LIu8kD+6tqyZdRt1k4zUjCS i+sU5aAaeEf4zHMJ57aLjre0/oTo6BkAucda8cNx0iXsoLwOyEEb8x2rwPjObf8Ap36Mh/uV0X memUMwOU+edkugOI6WmLytFZTdXxMBtZns80He9Ep0GFi1XssyY9mD3ilCRxS6zdhnwK4s2Vxc hr+TNZV00m1NYs/up1xTrdtFzMl8IASAnp0mVH4HaeO1COVkPoAlx1Iz/3L2HxB4Dm9sEqHPvU 8MQKXb+ELHQDUFkzuoQT6fiI/W2B+ALv5yb3f2l2XG+scA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wm1-f42.google.com) smtp.remote-ip=209.85.128.42; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 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-20210803; t=1704500655; bh=TDZsXOiO9N7Vo6dTtgajgmBYKu/acn8jIAEQQRR9Ajs=; 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=isVAAYxu3vcuGyWpVH3g/QukK8CbaHtFIB0U35LdEkvaCqnXISnxolzjd6FbAT9K6VfJta+Nfr ULQFvcr6VitsBYfoPJ2tJ7gUyqbl6VX3NAnM4Z2OKCrpipZTQjYL5V1Vwl3F21BJJwP5TkEvZl n4/0XGAjdVZzaT8NemWtOCaoJtMlU/cuzXfpQ9uL8PNfIJmN39FkbEDoeSv2+zeWccmLShPF1p ErYxzvCiB81SEmooarPX8Fp8pADPah/dUJOvJYXOqlNAXzwhbZZBwE58Izn7SJASzavL9B22by cQZQ/ADypJnYB8eU+tgqeFKhSpXWaivM65z7DK70TxUOdA==; 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: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=QpotoBM9IPIRP7oaVhZ4ew2CCKNl1KRP13u+Ts5EbRo=; b=kjv1gvA3fKGJ8iXDcnk5NxUsuW rFw/0Sbvwd1ewsLGn+B8GyoEQxLosKS1zsj0qdXYlii0n6Kk/Rse48294nd4v/LR2jS7PY8Lq0fJF VkxE8L+t+myDSKH9yK2p1juPzGGdb077u1K5LllqQHuUth35VAVxwBkIYSJGQpcPo+S4fJN92Z6ce PA+pIuQ3Mh5IEvpuDaLhtlSBoNszvKenbeqDcCuOMjG3w4F8EXWhiIV613GD1DEGpK0PepqNNQM5d RMHpz1BLfixehxkTbTS2LClW+jPJrIDJ1R5on6nEXRFldJRajglgXCXH+2eIP5BESyI1v6wxBoG+V RMJRejxw==; Received: by zero.zsh.org with local id 1rLuU3-000BUv-3M; Sat, 06 Jan 2024 00:24:15 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wm1-f42.google.com) smtp.remote-ip=209.85.128.42; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-wm1-f42.google.com ([209.85.128.42]:47265) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rLuTM-000Amv-Rh; Sat, 06 Jan 2024 00:23:35 +0000 Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-40d8909a6feso1220495e9.2 for ; Fri, 05 Jan 2024 16:23:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1704500612; x=1705105412; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=QpotoBM9IPIRP7oaVhZ4ew2CCKNl1KRP13u+Ts5EbRo=; b=QBwSR9DFl92VYW33JISwXEY+rlYqkbHWCH8H8L6kngrP0MEsljauHg5QCMIgylIYbd Pr9YUOhNu7sCL/UZuny0raBJqS8X4cLrhkVzvRgp/YGt+/zG4ipyE/XJT6NEc3qRgx9+ uCa284jC1PQxZf7fbK/9tFpsYSCaSsX41pTwDKhfKs9qBpa97XkBt3aoAJIZIzQBSeHD Pk6Bwdhos8yly4QbmHHBglziI7/R1Ll1pFZTOUZayuiLN9MJ+esfwBu5xqbvtiLIsQD7 Dxn3dSXSbUEf2e+BGy2dL2FjjfpXLG1iA46EVX7mvLTgiY5+KRWTIeM6SllgwwSsaR50 0Bew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704500612; x=1705105412; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QpotoBM9IPIRP7oaVhZ4ew2CCKNl1KRP13u+Ts5EbRo=; b=JCZSL6boxCN5ZOCCzgsde15kGBflterW6QPBntboxOKMfr+ooRdv3LJ0006F7ay1jA f2Sy37WFLCjx6t940r+3qqyZdUFwPW+KN/79s4nbQ/rP0lgyXKDzy8pzTRr0RxwHPatU RRbqsFAM7vzG2/a0stXVFmRF58T40XubzckLy4XTx575Z18f3ai9nCQQ29NyqMAD0eIR AzcF02aw/2da+CW/FDICRYYf86oMdgSus+bFOawpc6x9VXroKa9c+mskwIk0wLaEBwti DgudX7bvLAmqBqSsLYyI636eB1kjdKziyk2rglKV6wACaMt8EjEor9ocZ9oTGk8Te8JB xa1g== X-Gm-Message-State: AOJu0Yy9R+FD0+/0n4bqxz221d80Y2JTLkFHC/D11iqsoLsb4GHY0/ZP XecEGLQLfmQ0jQiyZaSveoz80nBOhHRuQnAosbGatreZJQ0SRys7v+NutRs= X-Google-Smtp-Source: AGHT+IFcHetwEP7ZGX5UMMIkDCTMOb1Nom1PFTjm8CarqJ0YoGFJ+tOBtK1lHBrh+solCWhdo7yX7vXYH2EWjjTYIoU= X-Received: by 2002:a05:600c:9a6:b0:40d:4ee8:6c74 with SMTP id w38-20020a05600c09a600b0040d4ee86c74mr93341wmp.222.1704500612146; Fri, 05 Jan 2024 16:23:32 -0800 (PST) MIME-Version: 1.0 References: <625e7ef5-be1f-4b5d-bb2a-f71634d151cf@eastlink.ca> <3fb34197-be9a-4323-87e0-7052cecf33ea@app.fastmail.com> <3adba5e1-18b6-495e-bcbc-09a554465029@app.fastmail.com> In-Reply-To: From: Bart Schaefer Date: Fri, 5 Jan 2024 16:23:20 -0800 Message-ID: Subject: Re: tilde syntax To: Ray Andrews Cc: zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 29429 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 Fri, Jan 5, 2024 at 3:47=E2=80=AFPM Ray Andrews = wrote: > > On 2024-01-05 15:27, Bart Schaefer wrote: > > On Fri, Jan 5, 2024 at 2:50=E2=80=AFPM Ray Andrews wrote: > > There really isn't any "parsing" per se -- internally, an "active" > pattern character is represented differently than its literal > counterpart. > > No way to see that unfold? I don't even know what that would mean. It's like asking to see strcpy() "unfold." The only difference is that when say a "*" is in in the input, a different byte is put into the "active" output. Instrumenting that for casual observability would be stupidly slow in the normal use case. > I'd advocate for clear and *visible* ways of coding one or the other. But that's just it: The base case in zsh is that if you CAN see it (and you don't see quotes around it) then it IS active, and if you CAN'T see it (or you do see quotes) then it's literal. The only time you need to get fancy is when you've deliberately hidden something ("inside" a parameter) and you need to expose it. In most shells other than zsh the patterns are active whether you can see them or not, unless you see quotes, which means you see a lot of quotes. The corollary to the base case is that parameter references expand in double quotes but not in single quotes, but expanding does not mean making the contents active. > "One of the endless problems with zsh -- or any other shell -- is that th= ere are places where entered characters are presumed to be literal -- but c= an be forced to indicate some action or command -- and other places where e= ntered characters are presumed to be actions -- but can be forced to become= literal characters." That's close to a complete mischaracterization. Or conversely, it's true of every programming language, just with differences of syntax.