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 14524 invoked from network); 23 Nov 2020 20:26:41 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Nov 2020 20:26:40 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1606163200; b=Zug9as3SQhkG8xiuCwLeiKW3FyxwZESqbn1E2zUmg1Efez6umit2rYpbtHI5WwAEiMbNihDDe/ lVIrV46X840Z3Ead/uJ/NQlgj6X7wq362tpOeMoFcEEiq1pQdrURWRCSvCln3yXmNUy2mjpNW2 SZ/GxUxdmEHzVjH0pU1U+0IvdfEoAE1FMVLTUy0C3t4xSGWQVb87XlaoweHByNxcTgOj/og+6K w4+DPkVlgU7YSl1G291J0rPeb06nL7V5e2oGtMms9GLXm4JBCvhvZieNrqf1KnRU/zeckivPQr /tL8zBNUbAgzElWwpdnaFQRveWlMvsydBlDcvbK1WsLpxg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oi1-f172.google.com) smtp.remote-ip=209.85.167.172; 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=1606163200; bh=yYP5LU65bp2UpCQ3GbhEjnO+r3HYtJmf9c7KfrBdvSI=; 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=cdEuh2Su6vu/KipbWbu8JyxpGWjoyicNQ4QcdPQbAog+WaFSQ5+aPN2DLCix6AaS1no/u7eEce Jjj/RKlAm5Dg0fdzIb6b0xZSxRyc3fRR1se6Pk5M2pNxcaAPTPnv4Q5hFbiJ9P1rj57GlFgcC3 OwqOaIOHeLowRuJDCUwaihCxOw98NS1hWIqFyOZ1CoXlvXyNksfKiWmZyhnvNu4cbr9HBvdiyg HrITea58cjlpRzIALSK3MVhgzrhYPqkonnw1fRy4IK7xjxW+100OQSEteMtZLGd9L71y5vC/Nn mEntxzZT5YxWzxUdSvFJe5kvOcl6xCqHhwzUsUZ0bWxxpA==; 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=o9RQJ5D6vs93YXCsq4y1CGIUypHuWg/EQhtWTTjs9fo=; b=xPzaXwumTkyPIxXNRRDunJS/yu QHxH6bcYrZ7KNPP3H9n/oaMl346DsxHU5xAe8BH6fxzAm584oqNjkjj7SLpLf/vfEVO0rEFazaOJS h7EzBhq7UASK5DTdE4utcxtDKOocEF+UN3xfO5fjSQReKhceU6SgC+xVUhe7+kHug20kbRQ7JM6Ax en7mzzZV23fXVtepOvZOM5Ks8rx+aOCGYUSlMo06ExWpwu42KH6GjjS9ohksOmSb0WAtbPYeEZ+Ox ZE7n6SnxJD00iuPSZy0RRAkxu6n+XJCk4+6rVnRQMjBydyZsfvi7wYPvn0mPewrFSgzf8alQjOgxo 98Ib17IQ==; Received: from authenticated user by zero.zsh.org with local id 1khIQ3-000P33-2b; Mon, 23 Nov 2020 20:26:39 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oi1-f172.google.com) smtp.remote-ip=209.85.167.172; 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-oi1-f172.google.com ([209.85.167.172]:35592) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1khIPj-000Ots-Nl; Mon, 23 Nov 2020 20:26:20 +0000 Received: by mail-oi1-f172.google.com with SMTP id c80so21125135oib.2 for ; Mon, 23 Nov 2020 12:26:19 -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=o9RQJ5D6vs93YXCsq4y1CGIUypHuWg/EQhtWTTjs9fo=; b=MvfaPPzPKmKLrwnj5znOk3PM+86s/nNMJV5sdzmNb/Wm5/2mr2c4igGUiDmtUhRpnZ BrA/zjkD7NV7GosMLWAk70ZqglVYJn8Iq3XFGscLORbHlheg9RLr7gKTnoeTI3EamUth MQDu4U7rJHht9qQNg8z+ZwsvYOZY5n2c45jN+F16WdZwOlQc7XFAXQsuVENjFd605SSb 1gS9zhEvp+NX7B/xr5wpR+mDeCldYhk55GGPfruEHlPcEZ0k18vanAz+HmHFN6UzbekP cnN7KOKqAsQLiSHM8dygyllSSShBHDG1DD/A859bMDJA9GaQygu+NNN5+7X4tD0IOReb vIyQ== 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=o9RQJ5D6vs93YXCsq4y1CGIUypHuWg/EQhtWTTjs9fo=; b=mtMwzclTE+kDnyTKv2Q1IFcQQncdtf5MLejSCythViQAy0nrS+QznuobO9HELIdgst HUIcmmtbfs9EIxPTBWharE2HbwTSwsqY63NNeCwQFnfCUcj+HxA1fAYRg33sQhSjrHBm czWGSM7YOCG0C+Uw9sUole0rsncTt4S4S615JKcfbYE6mn9NvJaqcZwxrq57BPp/bPO/ dY1647ulstmOeLDhOCYst0QI45xGSrTk3PNN7vTjn0WXZFEb/6QJqQURfPa16ldmMRcB nyj2+Gu5gbEjLx3UE4zXrn7bHJ6h3WAmOwWb8fctLDI3/XKt6HpMuuvIEGiS51JZt1DV pSTg== X-Gm-Message-State: AOAM530N2m7nGpq2vmM1SaLA65NX4DEkQS/CnyOcw5VEGAI/NJsMf6K9 5JuTJdDnxw+/U7/v6/mcuWVyBvWssjBC1XfcvjQ2ig== X-Google-Smtp-Source: ABdhPJxXKoy5p7+V1KQjeA9Ya/WOKDBZThC0CdkFKENzpKBkJBXnv3GfEOAnlITtJ4kzSN2OT9tv/bdbrpxAQKuinXQ= X-Received: by 2002:a05:6808:8c8:: with SMTP id k8mr462679oij.84.1606163178330; Mon, 23 Nov 2020 12:26:18 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Mon, 23 Nov 2020 12:26:06 -0800 Message-ID: Subject: Re: Bug with unset variables To: Felipe Contreras Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 47609 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 Sun, Nov 22, 2020 at 11:27 PM Felipe Contreras wrote: > > Nope. I demonstrated how they are functionally the same with plenty of examples. All of your examples are from other languages. > But then you used an historic argument to counter my claim that Zsh > was not consistent. The historic reference was for context. The actual argument is that zsh is consistent because the behavior of variables inside function scope mirrors that of variables at global scope. History is merely why variables behave that way at global scope. Your argument is that zsh was wrong to adopt that interpretation of variables in function scope. That doesn't make it (internally) inconsistent, it just makes it different. But there are plenty of other ways that the shell language is different from pretty much any other language you can name. Korn has spent years and many revisions gradually dragging in concepts from other languages. Zsh has so far (often just for lack of developer time/attention) not attempted to track with all of those. However ... > I argued it makes sense to add a setopt option that turns on the > behavior that a) in my opinion is more consistent, b) is what Bash and > ksh does, and c) is the equivalent of what virtually all languages do. That's where we could have been ten days ago, but you said (of changing the default) ... "Nothing is impossible. It's just harder when you don't even think of trying it." ... so we've been down the rabbit hole of arguing necessary/desirable. To hopefully tie this off, does anyone want to argue for a new option instead of adding this to KSH_TYPESET?