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 28716 invoked from network); 3 Dec 2020 21:20:24 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 3 Dec 2020 21:20:24 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1607030424; b=Cg2hjhCD59taCbldpzx92L1ydFhMRo665MiJKGpz2E1vTZiYaC2t9G3idEyzde0o+9rmuz9uXG 2699q6k5nVUqH0nMz6jv59fOmQECCpmN/De1aZ/P9At1/XPYOEEqV4c8pQqJLboG8ybSpnQXGk vwxIiB8t+bGvJuuyJ5S+TfFqScxH+3osZUtpgl2g8p5ohnxP61SgQfLt77PN7wkh3U21XLutdO kb9uuLVFVfXK7/lwM8NsgNzzssfHG7BYKiv/93VEOV+96X4bUz0pbL53D/72/uoyfNwX01A8mQ hsWGswJzHUIddpUTBeX4Dg4O+civAvkOaQEe/R7E6hDFwQ==; 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=1607030424; bh=7PXsUNVX8yH4cLfcMrN2T3YNsvahYMnKEYZa6LGm1NE=; 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=wypB2d/9jiM+VMUWUQziCwj5mUCY6xZ151NH+OkzE+6J9AhqBjRVTw1yM8nDsj2eqc7Ai1Ibos fBxDc8+vE6HoqIq86YFneU2iPZoa8yZJ3ElOiio+xG+y6t8jg/GpM3TrtxwZirpu2xSp0P8c6x dUXmQybpQXnofegl2q9yiO21LNduxVdug6kfXUHo6ah49hcQtQNRmvDlaZAqhjgElxzsvp87dI Y5SgaGVCnHwWuB+1kPcSw3uturE7IBcYCCWEhQ7MaEsEvd/sw8PGbDVkKkW0Jc4/WcY2lAAV7E mWzN/Vf4aQtI04UqiNSpoEDAwlEP2B7Zf8jtr1avokaWnA==; 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=dqGVgsiZLlvQcXd9vBLN0cA76VwJIglDH2yBdzDP6GE=; b=cDewMqs1G04QIkQVyEBRCU00Rw uZEioRin8JewZMXPre5lPJ4JzZBvcobTS1yDIj+sqdXhHBCayYWsGXhRwHvq4Rb5unmFNpnkekdfJ 4bzkoyIkwaVjE7XP2G9UiwTmW8FBgPQsK3oh4zd7+OuLSSXx3/qy9WQ07NdYT2xk6oWprtofGxJHk k1owwm3bp95PCzm+IdJLQtQKtwP4HmDH2mIgKVe+BH0/z47xYcCRa2gqK2UW9DEX7wOPYkYsB+uJj 2rFdJI8AiWq0gFYpo6uZAQjSUPLSKPOHoLjaz2xgubFd2UZ9/XzPHv/WwQZWA0sbhtnzGEqtXfIcm 8oBI/Nvg==; Received: from authenticated user by zero.zsh.org with local id 1kkw1Q-00078A-Kc; Thu, 03 Dec 2020 21:20:16 +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]:41176) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kkw17-0006yK-5o; Thu, 03 Dec 2020 21:19:58 +0000 Received: by mail-oi1-f172.google.com with SMTP id h3so3780592oie.8 for ; Thu, 03 Dec 2020 13:19:56 -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=dqGVgsiZLlvQcXd9vBLN0cA76VwJIglDH2yBdzDP6GE=; b=rj88wbYwbrfyn2h6wZ8BEQ41AxmK9u4hEMUQ9ISFWTlmsy+ZCGPVNlXxJN1yEoecLb y2oC3Q2fTo9PylXWl7Pbnds7V1StiA7aT4KH4Mt0yij1bw5YI7rHCM14H3HCBH5OMaEu AXzxUMbwBSKsftOFFmP9oDgTHTEBRxyQwDTcsiNNBExMwm8mb5BQXNb7brNT/QIEDqPX U3vT9RA0k8FhjmFextYJWiArvLQ9IYzzau/+gnWAOHja6HXTqe3qZ06Xwsv5IvfSzyRQ 3WcOWSb/o6ITXEyMnO/TKdDrG7/aogjj41RxHHh1oN3iVmMymhz4Cx4tCpODKeMEmrNN 4Tog== 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=dqGVgsiZLlvQcXd9vBLN0cA76VwJIglDH2yBdzDP6GE=; b=sdOugLBzsvpLqm+/0sND1AoG8/0NNRhKD2pDgPB26Xur6rW8GavoGBP7oeexRrbns9 n5OT97vI+OoFrcik2dBoprWHde6nWqEZkckgw6sTUDYmS03D82WlGZHSdndoFhnsNTtS LAuzn1mYpuh1apEyQjo7StXxbnPKBrYhXhRyNePvsh/YTOETgyLxJiyW98X6D2YyPWEg wpBbJS74h47XX31MolcoOkGg0dOPbmfDUmSOfa4GmAV40gknL6AH8Cn1LCWS15wKsbWg dP+7JW7ei7pb/Qt7SRCfAHe+PQd4u5G0UPXuAXqtjClO1P7+YrjDbUtrbQ2tXH63U0s1 2C2g== X-Gm-Message-State: AOAM530B08rUpzmcG3tX4uA3c1JiumlRI2ISRl5Tx19vKrDHtXQPn9cZ WNEKwGiHalxGUHxpVmcUFAwacU95+ufVqmZx7rsM2Va9ngw= X-Google-Smtp-Source: ABdhPJxnYZ+MrzOrb8aYB4QFzJ3cQ3M6NGV0e09NRXyRtSOKX44BdhPXo22Ixm1wqMXV1cXTDWaDtH+pNvpW26K9PBU= X-Received: by 2002:aca:3001:: with SMTP id w1mr795046oiw.84.1607030395125; Thu, 03 Dec 2020 13:19:55 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Thu, 3 Dec 2020 13:19:43 -0800 Message-ID: Subject: Re: One possible answer to typeset vs. unset To: Zsh hackers list Cc: Felipe Contreras Content-Type: text/plain; charset="UTF-8" X-Seq: 47719 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 Tue, Dec 1, 2020 at 12:55 AM Felipe Contreras wrote: > > I don't know what would be the proper solution for tied variables, but > I used this hack to make the tests pass: I looked at this for a while yesterday evening. My conclusion is that tied variables are already a bit of a hack. It would be nice to be able to determine null-ness (however that ends up being defined) in bin_typeset where we are actually examining the "assigns" list of names+values, but the determination of whether a parameter is being localized or is having its type changed in a value-preserving compatible way (e.g., typeset -F SECONDS) is down in typeset_single. And typeset_single is called twice for tied variables, always in the same order no matter which of the pair is being initialized, which is then cleaned up afterward in bin_typeset. So something convoluted has to be done, especially if both parts of the pair are supposed to appear "null" when neither is given an initial value. Consequently I don't know if your patch would cause a different test for unset-ness (that hasn't been written yet) to fail, but something like that patch may be unavoidable.