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 222022019D for ; Mon, 1 Apr 2024 18:41:00 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1711989660; b=BEDSqZjOb3zTLk+NcPwN9NRmI23CqdTsXJCKQf2BX6wC4j2DXysLTas5h4iJKaRL4PaKUH2i// hBMMm6KqkBksIyPY9i+AoLTdEYgnn80GHTo/czK1gq2w2eKg2NBqPREDYwiRy64l1KfmjbBitf pDFHtPnckCwqVV/16r2QgcNnUyYjJTWvGkZZhfXaDqcsq1Lr5lO2ssAJm6EalSHM1Ur5r9N+WP coEISA0YvI+1ylbNEQ/jEO7tFT262tjUwgwu3mlLPSbo32C7jSMWGi0Ho6x19bJfewuhCDduEY JItG3CzoPWX/jkWOQCrb5XUWT+mXRYsvNa4iEmoDKPw9vg==; 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=1711989660; bh=7ek5kxsywEDhcwtiAz6PzB4o26wwxfJnwvywbcwYWOI=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Content-Type:DKIM-Signature; b=CPhIMCDUyNmgSZZ6izERHAVnNRbZZbhMNFAOU1lFCXTOeZCyNGDuXd7cvny/dy9HwkwwM7K/+T T91JJmsp8rw+IU1Z1QpehfDX9zVNyKNWRN5zh3JCjxttdF0Ap0PwPaYrD/GD1UjJBZaZ4Svr/b QiD+9KoxnWfhnCQMG3vgbWvleNEhKbp2RNPTvMTWwerjr7C8sDRwNv/ZD/NOC0DDxTQ87mYAXI hyUpmDLU7RhFX+v+ThQqwqeY8yHHt4h0sEvBx4pHoYxriI6yO+tNptZsooY0S6NenTRIxmpcDC tuL08Sw8R6tmWVLVnosG6sqLKLY8VGAjHSqiEzTjbhLf3Q==; 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:In-reply-to:From:References:To: Subject: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; bh=LfZ4UunuIDIjvi/cL4J60+87NGBTxChwIjZXrt1EVaA=; b=beO9DJDd8CWJeAb5KtZbtimakZ 31r0WbAEruUarmG7EbxtmygOOHR6LuiCJeReHjy1aIKyydOu3DzYn90DrJJvw6Th6GJM4Ki+BTlXd 2Y35LVmoMCvg9bYBO4UXLVKiuXn/+X54CbNdc2jK2+MByj/Nsm7QlXzBtwTATPUhyYe1HL6w344Uh JMGPolVeatvY2hBuVJxZty5G6vdVE6BxnR+zjOKWtU3W4ExDteCWBVThfnpObQ9SY6ggNRigNFxln vCjxaKyHzf/hzZ+L454Wi521hd11fQU3RTnQ4xKjGXr4Ix/ohKbFyB9vPi+uynvFfr//Xk9U4FKW+ AESYWwjw==; Received: by zero.zsh.org with local id 1rrKiS-000IUs-Ip; Mon, 01 Apr 2024 16:41:00 +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]:43091) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rrKhq-000Hl2-J5; Mon, 01 Apr 2024 16:40:23 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta03.eastlink.ca ([24.224.136.9]) with ESMTPS id <0SB902N9BVAPL690@mta03.eastlink.ca> for zsh-users@zsh.org; Mon, 01 Apr 2024 13:40:04 -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 rKhXr0YXMAimnrKhXruI2I (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Mon, 01 Apr 2024 13:40:04 -0300 X-Authority-Analysis: v=2.4 cv=Q8Rx4J2a c=1 sm=1 tr=0 ts=660ae364 a=e7T7DzMKK1R988ZCg0wLyw==:117 a=e7T7DzMKK1R988ZCg0wLyw==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=W2J0Ub0yY9Yc_YnRXlwA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=pGLkceISAAAA:8 a=CRbEgvipjYKXe8R4GIAA:9 a=tq3icuNIbEHSnWXf:21 a=_W_S_7VecoQA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeftddguddtgecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpegtkfffgggfuffvfhfhjgesrgdtreertddvjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhephfettefhveeguedvleeggfdvvedufeeuudffvdfgledvvdfgtdeigeeuueelieefnecukfhppedvgedrvddtjedrudelrddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrudelrddufedphhgvlhhopegludelvddrudeikedrtddruddungdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdpnhgspghrtghpthhtohepvddprhgtphhtthhopeerredprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhgpdhgvghtqdgkihhprfgrshhsfigupehtrhhuvg X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Content-type: multipart/alternative; boundary="------------TLqyj5mVz2inLQ0WHmjn1B50" Message-id: <4de03717-ebcb-4b85-bc1b-14be0d2cc8c3@eastlink.ca> Date: Mon, 1 Apr 2024 09:40:03 -0700 MIME-version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: unshift To: zsh-users@zsh.org References: Content-language: en-US From: Ray Andrews In-reply-to: X-Seq: 29756 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. --------------TLqyj5mVz2inLQ0WHmjn1B50 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024-04-01 09:20, Roman Perepelitsa wrote: > It doesn't seem super useful to be honest. The semantics are odd, too. > What should this do? > > shift > set blah > unshift > > Or this? > > foo=(42) > shift foo > integer foo > unshift > > There is no obvious answer, only options with pros and cons. The path > from a special-purpose hack to a general solution is long and arduous. > Sure, that's what I expected to here.  Come to that, I've never used shift for anything other than the positionals which is all I'm considering, but if there was an unshift it would obviously have to be globally useful not, as you say, some single use hack.  And since the hack is easy, your way or Stephane's, the functionality is already there. --------------TLqyj5mVz2inLQ0WHmjn1B50 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

On 2024-04-01 09:20, Roman Perepelitsa wrote:
It doesn't seem super useful to be honest. The semantics are odd, too.
What should this do?

    shift
    set blah
    unshift

Or this?

    foo=(42)
    shift foo
    integer foo
    unshift

There is no obvious answer, only options with pros and cons. The path
from a special-purpose hack to a general solution is long and arduous.

Sure, that's what I expected to here.  Come to that, I've never used shift for anything other than the positionals which is all I'm considering, but if there was an unshift it would obviously have to be globally useful not, as you say, some single use hack.  And since the hack is easy, your way or Stephane's, the functionality is already there.







--------------TLqyj5mVz2inLQ0WHmjn1B50--