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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1759 invoked from network); 28 Jan 2023 22:52:09 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Jan 2023 22:52:09 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1674946329; b=AxlLQGuKDZ9TGnMbTdlm4Na648xUneyydD2nO3/hmaQ2G+9OmLm4HMN+tFTmZwwRNaEIxho1d6 CiC9jlxCuQyCo8I+qds/UuB//x7VVT59sBGxT1BpZHHPKtSBDrwJ8PU47MJpm4lfseODnri/qF HUCzcmcGEijIPHS3hQrsRs3OAwvFiFjWbP5DiNEEQaGa1UjO+DvCDjI2FAHLHp5yuH/KHewbPj nIeQmK9MLE0dmkY0eMHD9L8lQl5aE9QdpxIMfAWaOx3vxHqxcrSDgYCRPV634jG5LbHTmWMtg5 cf06ULbF7Oa6AhZOsRyCj5f4/zf40YBPfs0m4nZxDHgIiQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f46.google.com) smtp.remote-ip=209.85.218.46; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 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=1674946329; bh=yCMODAIDHnVt5NfyYK7cDQ0wYmM5PPTsqDsHcqbZa8w=; 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=NIfNuGvDSi//F8Nuu8L52X3lg/SoSF9yXujrybbniO9kSPHCiNB3bn+DeYxFI//zZBzt4JNbZQ vnUIxYo8CBdiTJ8MQcqzBQajs/ymeyaxfc+VlwsSOJgEZtC+KkZNJDX4AR0z7MdqPy+aJOAFm4 VG6A86tAs94e7kpJw2YhAiRxv6efZZAE4JGohl7tSaMlSUjdIUqQBq3Hw1diPCgtXt42YIWveQ caNt1iETEoVsNBq+Z/HuTG9qBh3r5gU+nR7ZpqjhICsE225ROaKMpOdj+Qjcyl00XIUovrwRFf E5xbTIepryaXp5AvoumSPyP4YvYe0l5ne+4FG/IudYs8hg==; 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=zLJknvsaZvQozb+MEy2bn4a8okQNnTniLvElzWeqRp4=; b=YkPQUkaLDe51vg5UOTlHgo+YUp UUhFRpM7FY3mh7rnzE5u7FeQ9VtzycBR2YPr3KQbu2M9Ve3PKODYyxXaCtpcAcp0PL2WtclfGORyj 2lrqH73oIf/lgRzPyO8kjxB5L0NiLyLG5mPmOV3WvtNghp2EdHbZWRr2sJp60AbXcgU35TGBZJ+Kr MqJTwmofun2tEpTCyBwjSvxjMPAsb+/9u6qgFvJZhf6txCrZQ1GjrSfMonr9E3C8GQskiZFYlcAyB ifxFZUsIwIZmvcEur3GriYwh1qBVkXfuzwdIN513e357986d6r6WSfwDUVoKkdjdZFxRhnSIX8eV8 yfl0SgLQ==; Received: by zero.zsh.org with local id 1pLu3L-0005ZO-01; Sat, 28 Jan 2023 22:52:07 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f46.google.com) smtp.remote-ip=209.85.218.46; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f46.google.com ([209.85.218.46]:37645) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pLu2U-0004tT-MJ; Sat, 28 Jan 2023 22:51:15 +0000 Received: by mail-ej1-f46.google.com with SMTP id ud5so22614051ejc.4 for ; Sat, 28 Jan 2023 14:51:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.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=zLJknvsaZvQozb+MEy2bn4a8okQNnTniLvElzWeqRp4=; b=Kagl1luN5OxDaujBIRklxMidrAu851N90jOnviAm1EvMMST2qOaH1H4K1ITUZE19n2 FvnHQjo+83l07hbBAwEHucmx8w55HmiP1XS9v+C6iSZ4TdQRlJh/KDSM7Y6GbYhWH7nH cATJ6acXuZ54VX3uYj0chc2j2wB0AD8kSGVLjjSmltbGjzTKhmeDsmXnhSZl3bUcGqbL cO0XBxlpLXK2GACEyMRy+ipfvnB6TAI/sXMNPzC9efZFoymomSavurfVq8UNAdNsK+Hl Gmcla9BOOr67QhGQO/VUbN2YUWNaChTgPkyoSPuBBFnYRxEjlMPgS7M33wI2qz+/5xt/ 4nZQ== 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=zLJknvsaZvQozb+MEy2bn4a8okQNnTniLvElzWeqRp4=; b=eHmB4dJVXnkiD6gNAlM1pEeaATnovvmPd7V6Gqqb6/QscepescVAan2SQ/s+cpsyvs g7mJbSZ0xIhmdOTElWsblRQ4BX/aVz2lg5pJD9dijRsXdkReOczD0/mNDfku92SmKm4u SY5bMBvwtOnqgq5OqbHF98PvrR2wd0FerGvPDFuS+cBwDi4ZC2h2ZmSNiCPfhtkkmacn mPJCHEL9omah0z6OxPa6WYc3wspXsBBfSPlGRt/prJRjbLqfvWJ1UTutUXnfCWrwBC2E +oKfqaMiYR/yXBZ9PatKcaD92pB/xJbqS9MAaZK5JXeDrwUDKlOpY5RM97/1HLRgbVTQ NvdA== X-Gm-Message-State: AO0yUKX2jmk/s7xXeEg//zR0ciWFheZgVVOVK/LkdsXXtU6A3HlN1DeJ jb1XSJRhS6gu0BpJSAQEJj7VYZTLtyyo9OcBMlhJYg== X-Google-Smtp-Source: AK7set+XQJXoKnrMzrKgAlTUcOYTLke1vjRultwTk8/QrB+nFm50/SxvnMM78sO/9AGAcSsZiuys1z6vLKk7990Ce+M= X-Received: by 2002:a17:906:e24f:b0:878:4a5e:3a58 with SMTP id gq15-20020a170906e24f00b008784a5e3a58mr3670090ejb.38.1674946274015; Sat, 28 Jan 2023 14:51:14 -0800 (PST) MIME-Version: 1.0 References: <0dc71450-d082-93da-52f8-d4e6b97199af@eastlink.ca> <2f2c3ae4-ca4e-8101-5934-9eb493ff61cd@eastlink.ca> <30292878-d596-75cb-8dc3-f64f9b82a44d@eastlink.ca> <3ea702de-f818-adbb-c55b-e585f8deb10f@eastlink.ca> <1a232406-ad76-b661-496b-974ddf8e67fe@ckhb.org> <8f626e62-312f-06fa-d073-5910d1aba3ad@eastlink.ca> In-Reply-To: <8f626e62-312f-06fa-d073-5910d1aba3ad@eastlink.ca> From: Bart Schaefer Date: Sat, 28 Jan 2023 14:51:01 -0800 Message-ID: Subject: Re: path PATH To: Ray Andrews Cc: zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 28840 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 Sat, Jan 28, 2023 at 8:42 AM Ray Andrews wrote: > > Could give 'em names unlikely to be used elsewhere. I've seen that sort > of thing. Or is there a better way? Given the branching and switches, > I can't think how to do it in one string of pipes w.o. intermediate > variables. And variables to hold the switches. You're already resorting to a subshell for > line+=$( typeset -m -- ${(b)1} ) So why not get rid of "line", go back to printing everything to stdout, and (if you still need to) put the entire function call in $(...) ? Instead of forking for each parameter, fork once for the whole main body of the function. As far as I can tell, "case" is the only bit that matters to finding the parameter names (although you could do hidden/not without piping to grep). So your $case is for example ${~${1:#*C*}:-'(#i)'} which you can feed into the arguments of dp. Take a look at the way the "untie" function I posted elsewhere takes care of managing the list of typeset switches needed to preserve the attributes of the parameter that's left behind after untying. > Anyway the whole exercise is just a 'cry for help' -- typeset -p (or > typeset -P) should give us full disclosure. You're the first person in 30+ years to ask for this, so it's not surprising that it hasn't been done so far. I still don't really grasp why this is helpful to you (especially when what you do with is it squash it down to a bunch of cryptic one-letter abbreviations). > And the doc should discuss *all* the attributes in one place. They are all discussed in the documentation for "typeset", they're just not all laid out in a table.