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,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30006 invoked from network); 22 Jan 2023 22:03:44 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 22 Jan 2023 22:03:44 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1674425024; b=ikV5OAWMWO93hyMDvTsO1KjKihS22SxQjNh4EBD2pU+q8+bMGZopjOsIjGSxuNFRF3avjql3dE Wi/qEErmL5N57HkG/E67vIODlRHkaKXnQtOe1iAGok0x73/lT79hw7jo+OGrzYtuHOKpfLZ3se /PeAakurAdiK8jGpk6xBOjxQ41tXNpdSrhw4ZHw1wgKXmFN6bEIWSNX5B4Jw45h+gfRnzA/V5R Bip4xUzJTGEXKqTOGw5XOYuCkBvehYGbSxBXp2wtVwiVjnRRCzPp4C/UucPAcCB0Z3mOZK56WJ 8xAzmZevTMfeXcpoRNPLTtOE8W1D4XVAtYBW6HKEA0DiHA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f180.google.com) smtp.remote-ip=209.85.208.180; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1674425024; bh=2Fhf0ucDSV+UfANsZX1LlHkdSar7CzBs4uX12BG3va0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=PP5QAyLA7FBubX5/VxoTMAw1Vm9RjSalEDyL0x/C24CVwlh+wuoNbzX54VI4kpdRRTufwBI8UC e5Y+2QKqL00/Vkefon01TLY7KU78JVO2o/+7mJDlvsafHVG6yZKS7emtuiSO5scwhtjg1e1lcT Gbf950YJEiKVS6iOiCJVCONXngP7aQaca3sd1tibectLrnNjLteHVw80CDNNyCd9VakJq3HTzn uzqwukrRMhcNBqe2Fq0IqalUcxgk2YBQ7qv+DDOctEByWgcEY8f5ZFfmSiII1inznwdF6Ho4Ec tLn4LKi3tFPaRYr/q3fYUtXjEAEy3/cI3YeialvmTmmfmQ==; 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-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=fYfFj7X2hPrJQCFKffouWh/XaXaRoMAj3hbWq4PpsAo=; b=dIvLMmOfphac0F+imtwzkR+BvG E/uTxhIPP3xlasCvJIPyTnquUiWzXzGrf19O00ibe9+HoAupFPjm+EBZK7ryX0S3+8iSfYz9jvSAI vvoIEUq4Yi75p3dwbi9PSvAGe9EYx+twAhSXb8dSkaqJqCA8oSN5JZyZNJSD1esTHst/uzENV049h lFTt42qdgy23/bVhYrw1O6vxHbY97vPBePryuohND6w6iAGrYklUHGkFJzlHNNfqzFq5fr09MeuGX VfJM1uObhobnlyRIZBAL4/IR51BQbjsmXRV3QbrXzB9agMPJk2XGXyaUI3lWdMbehd6Ql8qhEL6yK uqkogSrQ==; Received: by zero.zsh.org with local id 1pJiRD-0002gj-J2; Sun, 22 Jan 2023 22:03:43 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f180.google.com) smtp.remote-ip=209.85.208.180; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f180.google.com ([209.85.208.180]:35367) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pJiQf-0001wY-MG; Sun, 22 Jan 2023 22:03:10 +0000 Received: by mail-lj1-f180.google.com with SMTP id y9so7617066lji.2 for ; Sun, 22 Jan 2023 14:03:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=fYfFj7X2hPrJQCFKffouWh/XaXaRoMAj3hbWq4PpsAo=; b=JmMhMb4jVWgX+Bc+cgTz+yq4TPwfVi6+b1duRahkE2Wjh/cfIZcoVbzYYfgO3p4SUc 9WsTvVA6NLavzbsGrpxG/Aa6PgOyptqY2RyaIqE0XC/j+kiWEkqsMmsSil9rQI9NEu6D t2L+hJ9rCQ8/n/ucuIEBGjiN6yDMhZbNmsrOpwjUPN4S77JRzvcZeAv1GaAwwYrhGa/6 D4i+zuA5V7X3JMQMwbKmn4JVzPkKeN3kJyf5RyBWxL1h5TbjFxiJyD7XOkeNg65Fmy3q blIwHccSOc6uZhyd/2hjLIWBwEVhGHseW7X9kxzaAgxw9kKsx/7zfWcgcgsvBgRwhO3S Dp8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=fYfFj7X2hPrJQCFKffouWh/XaXaRoMAj3hbWq4PpsAo=; b=kUczFmAOfHptTvP68TBqxDikfDbofS9NxiSuXSqAgneDbgev9CJQor/w/HtHH8JydK 10gLTUoYPg6fFQziVkHM7xKRyGQg/LOtXowNQCiwHknB2AXUE2n49kmCqqLfLFrIb+/H qscHrgdOHigRmbO8lMztSlxJWIS79egYF1ajQ+egXaJFxo5BhBvH4jWzeW9kjQbp02/H qF7pGFHsWmFcE1I8VqPSJxBqhTzHvtBiTSsjW3R7f6k7nVtt8u5O21MMR1eXFTfDKI2m 4/DUwNpP493gTqtqO3Eb9IQnx25sxeD7v0dxCvTWOGCjX/J5tzApTWKhDtNonyPlyh9X Ehgg== X-Gm-Message-State: AFqh2kqAFmY/rmllJLsnT/Q/a68wPZSVY9AUGijjWhN+fhZ5GpU+cs3j /iD/wGLKpHiXgX/UpSIuTEOT/6lO5jK7uD6ofsN9U6GB X-Google-Smtp-Source: AMrXdXtsjrtT4zU7lCbp24axTjlMK2ZSPZfS1cbH7Ly+xpOErWwGhpHIJBlRb5gTog7r37t//x0ZxkAyO3ht56EvnW4= X-Received: by 2002:a2e:9e0d:0:b0:28b:88da:35b with SMTP id e13-20020a2e9e0d000000b0028b88da035bmr1961622ljk.364.1674424988454; Sun, 22 Jan 2023 14:03:08 -0800 (PST) MIME-Version: 1.0 References: <0dc71450-d082-93da-52f8-d4e6b97199af@eastlink.ca> <378fcf6a-edb0-885b-3d08-9ebee33bb911@eastlink.ca> <3885c637-c56f-2bb7-9a89-02009254ed75@eastlink.ca> <3b93f68e-d090-15c0-c15e-a3d09d702f76@eastlink.ca> <07323898-9985-4e9f-8b54-c08fd8510fe8@app.fastmail.com> <08102bc6-b331-504f-fcd5-28fa3cdb0e2f@eastlink.ca> In-Reply-To: From: Roman Perepelitsa Date: Sun, 22 Jan 2023 23:02:56 +0100 Message-ID: Subject: Re: path PATH To: Bart Schaefer Cc: zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 28724 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 Sun, Jan 22, 2023 at 10:57 PM Bart Schaefer wrote: > > On Sun, Jan 22, 2023 at 12:03 PM Bart Schaefer > wrote: > > > > % describe-params 0 > > scalar-special 0=describe-params > > > > Would it be better to use POSIX_ARGZERO to reveal the name of the > > shell itself? There's no way from inside a function to grab $0 from > > the caller unless the caller itself asserts NO_FUNCTION_ARGZERO. > > Similar silliness that it may not be possible to fix, so maybe the > above isn't worth considering: > > % describe-params '(#i)arg*' \? > integer-readonly-special '!'=0 > integer-readonly-special '#'=10 > array-readonly-special '*'=( '*' - '?' @ _ '$' 0 ARGC argv ) > scalar-readonly-special -=569XZfims > integer-readonly-special '?'=1 > array-readonly-special @=( @ _ '$' 0 ARGC argv ) > scalar-special _=_ > integer-readonly-special '$'=394907 > scalar-special 0=describe-params > integer-readonly-special ARGC=2 > array-special argv=( argv ) > > In case not obvious what I mean, $* and $@ and $argv should all have > the same elements, and $# and $ARGC should be equal to one another and > to the number of elements in the first three, but this can't be > preserved while using ARGC and shift to walk the names. Also, $? is > nonzero because of the "if" test, and $_ is _ because that's the last > word of the command that prints the value of $_. It's like trying to > examine quantum superposition. I think it would be better for this function to pretend that those function-scoped parameters don't exist. If it were a builtin, it could describe parameters such as `ARGC` or `1` in a way that makes sense, but here the caller can only get confused if any answer is returned for them at all. Roman.