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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21155 invoked from network); 30 Nov 2023 00:16:11 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Nov 2023 00:16:11 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1701303371; b=o1tJr3eSJFKN18bvlZwS94c0vJqXhkW2EQVQw8nHRZphCkt7XTZVAgxqTePQ8mXSxKxbGcyGKg LuE+/S6tHiympek/tbwEQuBIrO4AQsplyqmi6FIrzNpzoNUJjvW8gFY+41HiZ38y9o+lnCS5gq IUVBOffzi2eFrE0v4aidrsH76OulMx9836Ai2IhCmoGviZ0CxaISjMWwYIB52jkfZFeYiFSBsP GV9vr7RywWWd6Zp5a9+I6ZIW94C7nwQkANfDpYlWqOL3hUjvwoR8EXdOEaAcBqp6B1xoBEEkf1 mI99fOfyc4G5Y6cXNQE6CHSuXGgnfNCNvGt092OSppjYNA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f47.google.com) smtp.remote-ip=209.85.218.47; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 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-20210803; t=1701303371; bh=zeHDpWs2FbSaVlR2tx6Xe5KhnZL2VJGSsrrHHJSJ5X0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=pZXOGKZO8xo59xpB8mEVAqd76gn/ObeKdMZBW8l+iblc9M6I5H6glyJClKXmMg6AzJAOOsei0y jNCPDx/3+DaiGN+FUsy0USgJyfp5z4L1Nfz90CsbawHF04ikziGx1Le+NVkTUhKyH+tf5uM630 dHupCLm/4Vh1L1AQ94T/cvrD2lk6PUar1q7buS3b5jIS7A7oMaiUJbs6Tc9teA6Jmo8bS68G4n XABUnXPPw1l4r/JGD4fTiv3jS2DE18PQF2YhmB6wfqi5mehCZFZu/x/4oJkC+XjWbZXi/Sqb0P FTsnWF+7rvWlRdzyWm+UsalM8C8vqRRmTIFK/iT/LI8pbg==; 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:To:Subject:Message-ID: Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=y8F6KuRnIqi4mQHa6sdtLf1pbN8/gVBO+Cek2tgJcUc=; b=ox1jUJoEtF9nqEUVIeyYPSReF/ o/m1XMKuREGwDUglMbw4t7hO39ROBenptOpUdKX+zjZN/L+ElUDjRilBWifDEnJUf4Dc0doF+O3v5 g0HoyRxITzZtzlMCsZlwVmr/rvz+OY+yU+oohgzKw4MsacTsL4aYietR0S0E4c3Z+hFCjqHB/uGQA fXplsWa4oK/oSc0bMmjPVSX3FFflp3KAozEvt9I/s7kg1qGxtV2AZR1v8IyYS7fDYtYa3gfBZVbXM R54g4fmzkuPkdyTzRkn5FYDnukUxFW9hURIZVDi4S+rEAUqlMJQGTHm57cG/H1hQhHfUbHQ2VKm9r 3JTv8PEw==; Received: by zero.zsh.org with local id 1r8Uix-000MMG-LL; Thu, 30 Nov 2023 00:16:11 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f47.google.com) smtp.remote-ip=209.85.218.47; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f47.google.com ([209.85.218.47]:51490) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1r8Uih-000M1r-1O; Thu, 30 Nov 2023 00:15:55 +0000 Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a00a9c6f1e9so45741766b.3 for ; Wed, 29 Nov 2023 16:15:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1701303354; x=1701908154; darn=zsh.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=y8F6KuRnIqi4mQHa6sdtLf1pbN8/gVBO+Cek2tgJcUc=; b=VBhA+WU+pOkU3J8yE4Fdu73ZArPfRFSXwqOi6oGmyZEc3whJTpier0dhTf1OC2+p6Y DRWS1mDObDm8pmsW5AWqxBGKAYKUBxt1y0Ezhp5sg2GqLx+4nZl+y9qD/krmXZgvjeGt 8q9bv7+Bp9awnBebeUCvCNtd7FpyxvW7R2i2koY5xb4D67M6GtLABylONHEcJ8MVzpde iZ5yFrBRFb5a9To4KFNraflua5R/CfjFwShG6jERBI/67LLc79oRhMWBMfDVfZiTm3pX VdunUCE6U/a0UWApvmugfvx4LZylYHjipWlPKpe0JNtiokVOe2ap5hNsSLVnbH9O2fRy GqZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701303354; x=1701908154; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=y8F6KuRnIqi4mQHa6sdtLf1pbN8/gVBO+Cek2tgJcUc=; b=QkbSog+ZgDtg0dKKgWMnZMEztKj6bKVcchMjkv+511fo7zLYgrbKlw+WFwf7Q8LWZV j0Xw8qP5yw9YimIT0wEFusNbMwnmzLycna8SE4CcvkKMct+ZUDMkX91HIJidkr5j5VNq FsU1nUictwvnOGBqLsYCxkh0oSaMxxVe02T4/WrX3bpUHnUuaZphN7vgYsIu87d1V1Ou iS4hiXIxXNbrLkGdePn5Nia2EsC6jkr3WUnz8hi+RITljROOlzmPwfKuCmeF6b05aCGU 7+bpO7y/+G2bkUqtMuvlB5SpJokcO7PcC0CuOEuHUAlctLqzO8D9Cyxn5l/V560+d6oM CLSA== X-Gm-Message-State: AOJu0YyXM+ErXN5pyyeP8gCZ2NAYrWGceSSn4u0G5I0hp6h7N/f91LMl 3hZLby26z0XxpwE6gpPPHSQ1ASYrBcgwi/k7k9lWHsBb2NphYc/ys7o= X-Google-Smtp-Source: AGHT+IGpUaZAiZDeFp6745QwmELVmOspFFW1gDJuYeZs9xHs+6p43u2QqSA9UHdeKFBK8L7Pysv9MrbR3qC9URm/9jk= X-Received: by 2002:a17:906:209c:b0:a17:80d6:2d2c with SMTP id 28-20020a170906209c00b00a1780d62d2cmr2533510ejq.7.1701303354432; Wed, 29 Nov 2023 16:15:54 -0800 (PST) MIME-Version: 1.0 From: Bart Schaefer Date: Wed, 29 Nov 2023 16:15:43 -0800 Message-ID: Subject: Ksh emulation and function names To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 52340 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: I hadn't put this particular set of ramifications together before, but function names in ksh have to conform to parameter name syntax, which means they can't begin with a "." unless referencing a namespace, and if not referencing a namespace, they can't contain a "." unless what follows it is a valid discipline function name for the variable.** (If a function name both begins with and contains a dot, it refers to a function inside a namespace, not a discipline, unless there are two dots, in which case it's a discipline of a parameter in a namespace. Urk.) Ksh of course won't allow reference to namespaces that haven't been declared, so that further limits function naming. Zsh currently has neither declared namespaces nor disciplines, so from that standpoint it's not inconsistent that zsh allows function names that start with and contain dots, but should this be mentioned somewhere? (E.g., ksh differences in the FAQ?) Or not worth the effort? The ksh93 "functions" builtin prints all functions that are in namespaces, unlike "typeset" which defaults to skipping parameters in namespaces (except see below). So, also not inconsistent that zsh "functions" includes names beginning with a dot. Related curiosity: In my (Ubuntu) install of ksh93, "typeset" output includes readonly .sh This is somewhat odd because it's the only "variable name" starting with a dot that is included in this output, and also because there's no restriction on (for example) creating new functions in the ".sh" namespace, so except (I guess) that you can't "unset .sh" (whatever that would mean), it doesn't behave as though it's read-only. ** Declaring a compound type allows creating additional disciplines.