From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Samuel Wales Newsgroups: gmane.emacs.help Subject: curious why private variables are rare Date: Sat, 19 Nov 2022 19:07:40 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38440"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 20 03:08:26 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1owZkv-0009js-SJ for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Nov 2022 03:08:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owZkK-0000Xy-M2; Sat, 19 Nov 2022 21:07:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owZkJ-0000Xp-22 for help-gnu-emacs@gnu.org; Sat, 19 Nov 2022 21:07:47 -0500 Original-Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1owZkH-00031Z-B9 for help-gnu-emacs@gnu.org; Sat, 19 Nov 2022 21:07:46 -0500 Original-Received: by mail-lj1-x236.google.com with SMTP id a15so11065741ljb.7 for ; Sat, 19 Nov 2022 18:07:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=QbX52haYw3SL7ouLwgFLc7QyEvOB89llGztHgVEaMlU=; b=ElN+9GH0sTgbP6OCdSqMS2cfcTe7k+YLaCrHVsucMvbDTs7qU17/TdzS+hkoenOvzh RYDeq3owYFKM4/oFR8rzcl0Gp75FwLsN3vaooXxWZBi+PLdLHtA6dkKi0vOUE5m6Zv0I n8VYFdR54zOLa6XZ/e+M77sWlgGmnKCMVrC2nOKS3HoLLhfZoc0U2EVmNf3Kc6YyDxx2 Pv0PmVsPpz2aohTJFwvLidHQUELejUkN9zbd1aBPt/gLOoY/BieNBikEbzgkNydx/FNo SN4avQB0ypaSbASfIsEKmeI5+hE3xyIMjlCuQkKEaLHvs5vObOAC53n1pWkbaevkSScK wLew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=QbX52haYw3SL7ouLwgFLc7QyEvOB89llGztHgVEaMlU=; b=Jdb9g8wDNgtUhKjQPHeZiLnJLQ4g5Qc9dWCoIfn6rElP1NgfeRzzNAOWo15R/v3FWv wwkrHB6AwL3Ek4pVwRmGERgPvG4U72tfPAqPvg1PUgTpstRbzP2X0whEyAmgkOp93+Zd f4H507Gjqv8IOtd+EQp8FDRu4SeM85j9nFH56T0dei2yGRoRugAnIGBMLPCHtuhobVAT Sny9ob4OKk5/HEvgDrA+NG6ad8bufeDJnb34lWLxe/WfySs6OYbJseVqnONssNVmgiLV g712q7cdnLddkZSYfEx716zuAXynIAP1RNG5kLRG34x85S5KDX5wZBUIbXMD+SIVvYWH t4YQ== X-Gm-Message-State: ANoB5pltA0zitM/eaLoovsha8y6TdIBFPKnJPQ3OBWmcOi92ucRvu7pG KGThjJII6HV7JImjNz+EZUJIS7ri3hu0lMTct+5GbBj8eeduhrFh X-Google-Smtp-Source: AA0mqf4wx7EpthreEp3cig60W/znOfMtAeNDvxzXzJt7AH4JXhCIrYP1zf62JlOmfLD2LJNYT9EFbrgd/9AS8AFN3TQ= X-Received: by 2002:a05:651c:1692:b0:278:ec8c:7923 with SMTP id bd18-20020a05651c169200b00278ec8c7923mr3900308ljb.185.1668910061944; Sat, 19 Nov 2022 18:07:41 -0800 (PST) Original-Received: by 2002:a05:6520:4e:b0:22e:6caf:6e93 with HTTP; Sat, 19 Nov 2022 18:07:40 -0800 (PST) Received-SPF: pass client-ip=2a00:1450:4864:20::236; envelope-from=samologist@gmail.com; helo=mail-lj1-x236.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:141061 Archived-At: the usual thing is: (defvar var ...) (defun fun ...) even when var is only used by fun. but you could do: (let ((var ...)) (defun fun ...)) [at least, i /think/ you can do this with similar results from the perspective of the function, and it wfm. however, i know that there are multiple interpretations of lexical binding, at least at top level, and those considerations might apply.] the most obvious drawback of the latter would probably be convenience in debugging/inspectability/discoverability. re-using a variable name could be confusing. other than that and extra indentation, i'm not sure if there are big drawbacks. it would limit scope so you don't pollute completion, apropos, etc. you can eliminate prefix. no stomp on vars. so i am just curious why the usual thing is usual. is it the above reasons? or am i missing some bigger things? -- The Kafka Pandemic A blog about science, health, human rights, and misopathy: https://thekafkapandemic.blogspot.com