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.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,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 DA7ED20CB3 for ; Mon, 1 Apr 2024 18:12:04 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1711987924; b=ij+0zXtMIs2KAulwaFbgwwRbYgxK8YSZhEztFSpIgeO8K+u404fw9XnIBhtRVsxf2Ct3GGJPH4 fwdHgvn/oZP+1SWv9AzXfEPUPZDELfy5bNPUJVpo5Ei07uDC6DRoCX9kgXSK3pgWBQWqG1T3oV StMzyr1mfsaGnJ4J68S/uvHxO5H7Xr0TulOdzdaG003F3wG9s/YDzCIm/rGNXXiSa/vIhkrR33 0DCbzydJyotCg0wfFWmnekouRHigS2t6ojhL5T1ArmfcnmeU7QXYmFdnia1UqAFwT395IV9QMW ZPjeWfDZbFvWIdjsAPsasNltXDDebqwSRfbh6yVMhXCFkQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta02.eastlink.ca) smtp.remote-ip=24.224.136.13; 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=1711987924; bh=GEzxweCFvb1ITYcG+wn/nhyKSVwF1NC5K63TCugQhYM=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature; b=OevUX5QzRveanz1DUPRMDjElB9Yd5CeKZKYwUQkQstwlSzMZDJLIbIYsrmq7fmgeU9ohDBfSfW f1iUNr0tvyFnYhs42hq6wrtc4grTZEPCQmyqIssyTWnj2Je5w6yva81Ox5niXfrYv0/mlykKxI fsvzjk2b/FlKwAVr6JsV0isVYlNrx15FP9Zp+DcGbWskvLLuMn7sYAQw8GqXsoP6POD0RsUdNh j1mZSVrxzYvobkTPBsYl/XfyFOjbik7MZ2xJPi2DDvMdAdoVn3aKPkqI4eBs9JGPNkjTW3Hbct PwsyzQT4mfxKK8K6PBU+jLrIOvCKPfV+7fgQ6MJh8hZpXg==; 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:In-reply-to:From:References:To:Subject:MIME-version:Date: Message-id:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=+Fydd9QTm/zgVkMdTyTPhtld/opQuH1SQdxfOGKzt/Q=; b=Bge0tw2ppo9lOvCJUMtsJgjy4+ YMjB1iygeb0gNnz9lkcpsZ+N+JIzH99RYVtRfx/rUkfxG+MLwVp3xtgMSoJycDNlFT12bnZtMLpy8 0o12Z+jRpmodLKxJ68V5Vcj9RO3uy8SgyVH6FS2/1doLcPUgu+bTfAd/ZZMhRf4F0yHDhFg+PCsmR ZNF1amJJ/gzxI1IYcqIjcGoXE66GSWXL3TSn3LR+WY+Y3jjpFoYTfBp9R+bY/QLAkhyn1KwL5mohm Bi86oE845Q7PRo7MF21KJjXt81NyxkESQ+KGZ1tBKhzK7K+cOzlHB+ebQP9oYjY1799dayalSuzxo s0I4QNKA==; Received: by zero.zsh.org with local id 1rrKGR-000ER3-WC; Mon, 01 Apr 2024 16:12:04 +0000 Authentication-Results: zsh.org; iprev=pass (mta02.eastlink.ca) smtp.remote-ip=24.224.136.13; dmarc=none header.from=eastlink.ca; arc=none Received: from mta02.eastlink.ca ([24.224.136.13]:50779) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rrKFr-000Dii-Nv; Mon, 01 Apr 2024 16:11:28 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta02.eastlink.ca ([24.224.136.13]) with ESMTPS id <0SB901ORPU5WDMM0@mta02.eastlink.ca> for zsh-users@zsh.org; Mon, 01 Apr 2024 13:11:26 -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 rKFpr0URRAimnrKFqruGuw (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Mon, 01 Apr 2024 13:11:26 -0300 X-Authority-Analysis: v=2.4 cv=Q8Rx4J2a c=1 sm=1 tr=0 ts=660adcae a=e7T7DzMKK1R988ZCg0wLyw==:117 a=e7T7DzMKK1R988ZCg0wLyw==:17 a=IkcTkHD0fZMA:10 a=gir0-LH0AAAA:8 a=sqIWkbFpm1C8dZJRRVsA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=aLewGyoHDmJ4ULJHWpSz:22 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeftddgleekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttddvjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepteffhffgvdeffeelveelhfegudevkeduhfehheevhfekhfevieehjeejheefvefgnecukfhppedvgedrvddtjedrudelrddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrudelrddufedphhgvlhhopegludelvddrudeikedrtddruddungdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdpnhgspghrtghpthhtohepvddprhgtphhtthhopeerredprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhgpdhgvghtqdgkihhprfgrshhsfigupehtrhhuvg X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: Date: Mon, 1 Apr 2024 09:11:25 -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: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 29753 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 2024-04-01 07:38, Roman Perepelitsa wrote: > On Mon, Apr 1, 2024 at 3:52 PM Ray Andrews wrote: >> Can we unshift the positional params? > That's an interesting challenge. A start: Very interesting!  Could it be official?  Maybe not worth it's weight but ... ================================= > > alias shift='emulate zsh -o typeset_silent -c "local -a _shift_a _shift_n" > _shift_a+=("$@") > _shift_n+=(-$#) > shift' > > alias unshift='set -- "${(@)_shift_a[_shift_n[-1],-1]}" > _shift_a[_shift_n[-1],-1]=() > _shift_n[-1]=()' > > unshift undoes the last call to `shift [ -p ] [ n ]`. I think (not > entirely sure) that it works with all options. Unfortunately, it does > not work for `shift [ -p ] [ n ] name ...`. > > Roman. >