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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12331 invoked from network); 12 Nov 2020 19:26:52 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Nov 2020 19:26:52 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1605209212; b=TMfZALiWQ/9YwJp/lUkq2xLkUQ0YX1pmTnD5bripLNYmpSwW+C+ChrlpmjNgUh2I7Pm880burR Ic3ftluqiDBMJgqFAFHcMQB1W9yAVDHezjSm26hp4UrhX4jk6VQs4qY/BY6/nUZAB9qFbN4G7d 3A19albkpza2xUf8VsxPtNrnkoEElt7dDDMiSDU4djAHKXVpmKmCVMBrDLbnF1FLK0wnR3HiUp sUA8pWiqBdjxdnUNjF/eOpM6Y2J8nNgknGmiJ0p45pjo5HKDn3fNhGui95EAE9nIdyVqWAUPVw oUz5zR3Q6lXCF96TcNviPTGL6NNxAaX5Q2lkjMnRE3GzUQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ot1-f44.google.com) smtp.remote-ip=209.85.210.44; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 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-20200801; t=1605209212; bh=Nv1OOwBaAUW1aHTCA0abLlAywtN3CHjXg174u+HvX8c=; 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=v2GDQYdnVdk7cNi9qqXgBFe68p8SCIuBSndBfi2oSdfZJ02B2f7MlKA3063KZ2zF0nqy2EKqgk ckjxbaBbpuNSHkwlos6cozWmtEBKb/dSYuG5i+blW3yrr0cHTcjdovohN/H3ExgGV3QStz291v S4neYmn22C5nFUAQvvaKrB+L1gv+xJQ3eN5EeK5+hKsw6DTLZC5rbGmEDYv1lNES6IQTV6tEY3 lwzacnYWZpsYqZbAz+Ctht1g0UHzn8h4FC74hsyrToEvfomnZvabk9D+SModcm/gjY+HlepfhU t8WXrmpV/VywDV9tJkNLRJcil+nqzbkOmRNfAnkEq9Rc7w==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; 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=38tFD+CTDAYp/heSXwd4NdFVaILM3se6ylmt+mPD+BY=; b=bCZdxO9hLpBEpyuhZ+ShgWq+9T QAhFunWZkPVRs36OVhkngGl90Z3FyfiDCChZXtQk5mXEVAKnz6kgRpqvQBKlun1IjA6oU6x0eBJ34 dyGc5AnamP073fnp02qitxRlMHckat075kJM9XKhMupaw20+22OrYZUABwiJPwq2SR1qTDsf3aqYw +E2WmWCumR6Xksb2KetmlbF0ShKBm5Ht82EkPyGgFRjZUHu4UMSkOLTjRtoVewLmeootu+E4PWcSy DX9SOGp3i4Yp5pxw8GCI2LS1wyYXbf27cIkRhnHW/hx4vpBjk3R4/KCveIkg1chbbD/ygwc0yQTxf jfbh0ROg==; Received: from authenticated user by zero.zsh.org with local id 1kdIF7-0000PR-Oi; Thu, 12 Nov 2020 19:26:49 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ot1-f44.google.com) smtp.remote-ip=209.85.210.44; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ot1-f44.google.com ([209.85.210.44]:41524) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kdIEy-0000Hd-BW; Thu, 12 Nov 2020 19:26:41 +0000 Received: by mail-ot1-f44.google.com with SMTP id n15so6707893otl.8 for ; Thu, 12 Nov 2020 11:26:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=38tFD+CTDAYp/heSXwd4NdFVaILM3se6ylmt+mPD+BY=; b=s7f4clL56HfUgWlgmFJOxLkp7R/BXOx4KCwK8DRK9l38MOoFc+Q/Il+scifBKWKN1e TyDwCLMyuf81OJ66lqfdKWFomNlnSogk7K04XBvlgv7Fm/2OQtUzug80HPl/bfTAgUK0 QHcwdAdsHPgVGtV3H37oidPsmAtBjTJK8BpGqq5oFoN5ctnG5rZRo2tmjTqyrJe1IAo/ s/x5BU7EIm4X2v6mxkCxnoYUO8HB4wLG68YV1QZi0lHpPf2zezNXkrfjZASxmyuKJQyK uKlo6Ovc64M2zrf03RjA3Xf16Fj3cBPLUPgMeIZQDalH9nI8p8BisarkYVvMvMHN3Vky YnMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=38tFD+CTDAYp/heSXwd4NdFVaILM3se6ylmt+mPD+BY=; b=rNYUCAGVmRa0HliaveIHHAcL/D1gteLtvYTyvPXbDVMBL6s4OnE0cz/j8wCAsZW5Pk Q38XD6rmO2sbGWbTiwCyAj1DYwH0ArWp284XUuMVD+UaNvPndkvb1hkRQ8ZNgYpBtrYJ pLzW0zG3SbpGaYtwI1sskmeBrx2Hfo4LubTQ6jRHDFcLMNJkRqzuygJn+Y+scBclWv2t ++VK3gXEPWkb+XOjji920arm4q1lldICZufCUrneFffMR2Rb6AzmowEoVZYkLC0ekiet gUc02qvFsXYqEztu7SIMravXghlX+4mAwcYMvecsXfnVWwjo/oLdaKBkA/RYHTI8zwsR MyvA== X-Gm-Message-State: AOAM533s/AnFZ7AW/GDNTK/tURSH5XNnDzwwwC0Sml+EamAJWJqV0Nm1 G3ETRPq1u1SPyhlCaNDNX0gDdObU1VDUUR+o+m+N7Q== X-Google-Smtp-Source: ABdhPJwmB2BkjBN+xxCIWzt3jmFWorf8yT4c8VHV0gfV1eWCxih3cJLtcO11aSX2ZDq7d8yFb8WGtbQOSUt9vcWOWKE= X-Received: by 2002:a05:6830:1291:: with SMTP id z17mr544868otp.229.1605209199347; Thu, 12 Nov 2020 11:26:39 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Thu, 12 Nov 2020 11:26:28 -0800 Message-ID: Subject: Re: Bug with unset variables To: Felipe Contreras Cc: Roman Perepelitsa , Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 47551 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: Archived-At: On Thu, Nov 12, 2020 at 10:47 AM Felipe Contreras wrote: > > No. Zsh is not consistent. I did not type /typeset var=''/, I typed > /typeset var/. At the global level you cannot write VAR to create a variable named "VAR". VAR= both creates a variable and assigns it empty string. So now we have to decide what to do when with local variables. They can either have a totally new semantic, or we can follow the semantic for globals. Guess which one makes more sense when you are adding local scope to a language which previously had only two possible conceptions of variables (exist and are empty, or do not exist at all). That said ... > Adding a setopt option for the new behavior doesn't break a lot of > existing zsh code. It probably wouldn't break any _scripts_ even to modify the behavior of KSH_TYPESET for this. Whether we can cleanly perform an implicit unset in the C code structure, and (if not) whether cobbling this in is worthwhile, I haven't investigated or formed an opinion.