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, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5013 invoked from network); 1 Sep 2021 17:00:20 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Sep 2021 17:00:20 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1630515620; b=LuZExu8lnuo+GzQg8stOL8NKosZyJlFEk2ob60cMKQr3YtFpDt/JRtuY1ar3J2snH8H5x7AZ7J WYshj8hk74lM8ME9+6MveJZDIv3EFd8AoB+XcdMaMOGqD9pGORIlXwWBfkzU0qvX5yGoonS8qK Us1yTKHGAkvfUjYHvy8UrKAXWjZHpLy7D4PlIQidGck3TQ5i9aK2NWdm0llx5Nr7QqfqhF6O2U g7OgmOyBIhNKCcfsoh9ysI6C1OanTJJpx6hTIhS2MnOuyZ7woSIBGvv8jFFvmQczVbwsACNG32 dcnAXvt3h9Y2cu1fqAR7eRSuROJwZ1CbADOqKgH0MfRqdQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-vs1-f41.google.com) smtp.remote-ip=209.85.217.41; 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=1630515620; bh=oVHLUp/b4gPe6I0IKaKSHnyPHpkWN0PD/twHZSwd3Vk=; 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:References: In-Reply-To:MIME-Version:DKIM-Signature:DKIM-Signature; b=n7To3jvhfHNO5/8w5z6VSZjwHIm5efhLQQqX/0//8igeDmNipPHONyZ1Mf3MBUoHy834Wo0BzU 3EjG6yMo0h5SL3+QA1igzAduG3fNn/cdixirBEYrYQDCN4ToDhTiamUwfUWROnUbAeDIHVQv4b ijZnFZf0cxYfsDKyJ9BQ/O8m4WgVE+rWdUukYS7tx71VDh/w/eDDnDVZ4ibOuxgupOH5tm/Pgx JIbGXa7sAxBAwBbl164zxSFXhlNujYHUcChQIjSPvU92Hf2rxFBIy+ZkeEElaqflZ9zJZ3q3kc NUf82Edicu4O28zjFPxOQPgMBFLmOBYamLd4HGoX9CiS1Q==; 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:References:In-Reply-To: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=Mofn9QYNLFmqmDT7QaJOx5aQ/e5v+eqBtAN79b+6u9s=; b=G5/IV7ojOun31mo1Ui5Ce5sVv4 YzXU27dBWHEB7UsiYUy5bENxp0c30MOdTtxcJDdpnOZ9HiHCkFKOcBTUdvFqZkVb6L8nyDuqKqbi0 LUcx4yRq3xRNHAA229GZEmcJKP+l2QI3zthcHb8WdvQKWw18yr84hZ3z7x+W8fh5G/PUNyXF6on2a 3Urln4B7LJMtBkWL/ykvYauZYNpdZwk7dZ64HlndKAiI/hkKdbfrJBp/R1eqaXAmI2J/ZStG+jZLZ PBQkwaocqYsEv2ybgKW/9MFBYydRHPlFvpjKuuErVHT4q8edCEc9QYTTC6ak+f6IWqwF9Szrkp6aQ zVV/q3NQ==; Received: from authenticated user by zero.zsh.org with local id 1mLTb1-0008ay-D9; Wed, 01 Sep 2021 17:00:19 +0000 Authentication-Results: zsh.org; iprev=pass (mail-vs1-f41.google.com) smtp.remote-ip=209.85.217.41; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-vs1-f41.google.com ([209.85.217.41]:46898) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1mLTal-0008Jy-1N; Wed, 01 Sep 2021 17:00:03 +0000 Received: by mail-vs1-f41.google.com with SMTP id s15so345029vst.13 for ; Wed, 01 Sep 2021 10:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Mofn9QYNLFmqmDT7QaJOx5aQ/e5v+eqBtAN79b+6u9s=; b=gLW9k0r4KZ6ILokWDdFtDBPU4coO3Kx/FgRBTGftjRxvMSsgCrIKCnnrVlrHDbHVXH n5TqtdZOqYuzDnFTda5jZh1A7iD9ChzFEuU1693nuE0eqii29NKkXy1EolF1+IUoY8B3 3YSq4O6Pd21tQN0RLklkJItASO9IhNXwAa6ZLchAdCk4fOtCzm+RnAWcPZhDuVY4F73O rO0vxWc3/U24CkKGImHpOXDCwqtpOkbE/jhQXosMH9z4zrBbexayzX2FFwdJiMdpsL8X mqJPKaAx5PJTt4bX69CEmseNwLdSqhLpjjlgsR1TYMqOvTzOBDmEEPY2Ryxj2+wM5fgE ac7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Mofn9QYNLFmqmDT7QaJOx5aQ/e5v+eqBtAN79b+6u9s=; b=HYyPbOh/jyUcpg3oq7MgdvxjjB556QJLbqrmjwYhA9K40Qro4si+x9n168SXHNwKsU MtETVbmS+JdPSqG5DUMGGExv5QqdC9ax9VjdDQ0sIqACUD+jLqPa15RBrAZl8+JC8BL2 7OqqDXzjCNlajPgCW5bR6CHy6U4d2w9IGO+J82cHxdeunAsZihLlOII6rMkgsw7lPW+0 yh+1uOjG71IHx1nIdwTWTB3k4B6ieQE7OeKn2fvAysaqIRcZz/5/IMwWzo+dRWCk5Udo yhao4/eKJCLYD47/GqaZF763xdYGhHFFJiRxr0rCYc7psnMgaG8Mz51Ed3JAiCG06s4L LbbA== X-Gm-Message-State: AOAM53134GpsAEGb8+WOb3JKT4zmFgGx9Y6ZRIzWZbZamMb1jj/udLhm 12zGnDoTrCQ5o01ugiEI8HHyZzD8RPJZmJ0q8x0= X-Google-Smtp-Source: ABdhPJz4Wpb/cTUyQSISUoWpkURQsW3Dzk46cS7tSE8v8edEKTeVY2DxQqLwHYtP2my874E6VlOfwV1QR9GHJ05SPH8= X-Received: by 2002:a67:df8d:: with SMTP id x13mr237982vsk.29.1630515601993; Wed, 01 Sep 2021 10:00:01 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:60b2:0:0:0:0:0 with HTTP; Wed, 1 Sep 2021 10:00:01 -0700 (PDT) In-Reply-To: References: From: Mikael Magnusson Date: Wed, 1 Sep 2021 19:00:01 +0200 Message-ID: Subject: Re: [BUG] zsh/param/private scoping error To: Marlon Richert Cc: Bart Schaefer , Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 49357 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On 9/1/21, Marlon Richert wrote: > On Wed, Sep 1, 2021 at 7:03 PM Mikael Magnusson wrote: >> If private parameters >> are only compatible with code that runs without warnings under setopt >> WARN_CREATE_GLOBAL, then we should document this. > > That would largely defeat the purpose of private variables, wouldn't it? :) Ah, I misinterpreted one of the examples, I thought that this would work as you expect: () { private foo; () { typeset -g foo=bar } } (while this wouldn't: () { private foo; () { foo=bar } } ) But in both cases it is an error (although only the latter prints a message and aborts execution), and foo is not set globally. In fact a typeset -g is needed on the global level before the function using private is called, which seems impossible for the innermost function to enforce. -- Mikael Magnusson