From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Imports / inclusion of s.el into Emacs Date: Wed, 13 May 2020 10:33:22 +0100 Message-ID: <87y2pw5gd9.fsf@gmail.com> References: <0c88192c-3c33-46ed-95cb-b4c6928016e3@default> <87mu6dctgg.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="66944"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux) Cc: emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 13 11:34:04 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jYnm7-000HGG-Nc for ged-emacs-devel@m.gmane-mx.org; Wed, 13 May 2020 11:34:03 +0200 Original-Received: from localhost ([::1]:46330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYnm6-00027J-Pj for ged-emacs-devel@m.gmane-mx.org; Wed, 13 May 2020 05:34:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYnlY-0001X9-B1 for emacs-devel@gnu.org; Wed, 13 May 2020 05:33:28 -0400 Original-Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:39696) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYnlX-0007UO-DB; Wed, 13 May 2020 05:33:28 -0400 Original-Received: by mail-wm1-x344.google.com with SMTP id y24so27713589wma.4; Wed, 13 May 2020 02:33:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=YmwwTLFGutGTU8+2T0OBNasO4J+DIi/pvEBs/NoTDDA=; b=Zp/dP/z8uWVsqXztsvoi3iX6A1z7bQjfizuR1uWWNvd8ERSgurJZH45hck3m7xGmtR xikUVY6BfJeblbrllbueplfxXIM4Svpy5o666exe30RvFqzYg3frlsDrHhBoIOvK39Vj qkIi7zFIJ9agOmCT1ZLo+byONLG8jBvLQpjllUOm5cX3cfcWH7gdQdAoe4HVfL6MDiZZ +qU7nhyUS3py/S5wY9e3fzvUY/LSbKZrYthW3uH17RLPr2i/geUPIyFs05hadufqMY7L JqJ7qbYdv5U6cFehbGhT9UJ8Awgrwawk2zQHqo2NjoXamHC3FQDWlPd9zuy4E+LijTOj Rixw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=YmwwTLFGutGTU8+2T0OBNasO4J+DIi/pvEBs/NoTDDA=; b=SwMt70k+rrRYwuBSU2+tVEajSP0yXJsMzAMINoYrCcJPV9F5/wEg+OsVaku1WigQUL exudwAbb8FXC6HThvbQptkd7EH8QVr4CBsQM0F6z3jD2M62JLelxHWq2aM7x3kkt2DuL 716ETVws30Qzl2CIgrUvaB6A0WshX9bvb1FkBPoaV1i47CDNbafLbcNglcyr3qnQnvBX UU4kIVws5UzPVYrs+Uo8RHjxLSsAzrkKTpOFdb1adstNn5yiZnBVRSXp9EXuXkleAeRH 7CgEu9tZKwYkUQcbv/HP42VAlWZsS/0kjQG54dRH5UiiT2LUOa7EGnwHBdvCa3PiOuF3 QC6g== X-Gm-Message-State: AOAM532LQrXY5XNrrN10H11EgQOdkR3Ceu6i6FTH3qJ2GsqhspcNSQOn UTrLfZ0SzMdzg1fYNmA6VkAJWdK24vE= X-Google-Smtp-Source: ABdhPJyBAZRY6QfEOMhlJga3XOAL4hiy5LbFJVZIuy++rs+VJhbzd2gjnOYnbHx8dcBk9NPDjuQpxw== X-Received: by 2002:a1c:6383:: with SMTP id x125mr4590032wmb.165.1589362404785; Wed, 13 May 2020 02:33:24 -0700 (PDT) Original-Received: from krug ([2001:818:d820:9500:824a:171:15a:2213]) by smtp.gmail.com with ESMTPSA id r3sm11637715wmh.48.2020.05.13.02.33.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2020 02:33:24 -0700 (PDT) In-Reply-To: (Richard Stallman's message of "Tue, 12 May 2020 23:55:23 -0400") Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=joaotavora@gmail.com; helo=mail-wm1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FROM_EXCESS_BASE64=0.979, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:250107 Archived-At: Richard Stallman writes: > [[[ To any NSA and FBI agents reading my email: please consider ]]] > [[[ whether defending the US Constitution against all enemies, ]]] > [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > > This means it's hard to do automatic checking of consistency in namin= g, > > That is an abstract concept, and I can understand it abstractly, > but I don't know concretely what that would do. You're right, it is abstract. So let me explain what I meant with a real-life analogy. A namespace facility is for managing different things with the same name in distinct contexts. At some point you may want to merge two contexts for convenience, much like the way teachers will bring two smaller classes together on a class trip. In those occasions, a better equipped namespacing facility will have the means to detect a possible clash in names, and warn the teachers explicitly that there are now two kids known as "Jimmy". The teachers may elect to: - Rename both Jimmys - Rename just of the Jimmys - Let one of the Jimmy's be "shadowed" by the other (poor Jimmy...) - Evict one of the Jimmy's from the class (harsher still) - Abort the class trip entirely In all of this example, each Jimmy keeps its identity (i.e. renaming him doesn't change who he is). It's these kinds of choices that a good namespacing facility like CL packages give the user. It's easier to implement them there because each namespace is a first-class object: it can be queried and modified programatically. In shorthand.el, as in Elisp, a namespace is just a concept that is managed entirely in the programmer's mind. However, that doesn't mean conflicts can't arise in shorthand.el, because naming conflicts are a hazard that comes with naming itself. Say that you are using the symbol RICHARD-STALLMAN-* symbols from richard-stallman.el happily in your myprogram.el as RMS-*. Then, you realize you need to calculate the "Root Mean Square Error", a mathematical concept, and you load a library mathematical.el where that is done by the RMS-ERROR function. You will have a problem, because if you type RMS-ERROR the system will think you mean RICHARD-STALLMAN-ERROR, a function that may or may not exist, but at any rate is not the one you intended. This is why we probably need special syntax to "escape" the renaming, so that you _can_ call RMS-ERROR from myprogram.el without the aforementioned problem, perhaps by writing it ##RMS-ERROR or something like that. Another option is to give up on RMS-ERROR completely, or convince the authors of mathematical.el to give their symbols another prefix. At any rate, and this was my main point, shorthand.el is _not_ designed to warn you about these conflicts: it is just a very dumb renaming system, and lets you shoot yourself in the foot. However, the argument can be made that Elisp _already_ lets you shoot yourself in the foot with names, and Elisp programmers will presumably know to take precautions anyway. The opponents of CL packages will probably also argue that the CL package facility has too broad an array of choices which confuses the beginner programmer. > > However, if people are looking for other constructs to manage > > namespaces, it very much possible to develop shorthand.el so that you > > can have: > > > (shorthand-in-namespace FOO :as "f") > > What would that do? I see values as argunments but what do they mean? This enacts the shorhand rule "^f-" -> "foo-" for the following forms: (f-bar) ;; this really does mean (f= -bar) (shorthand-in-namespace foo :as "f") (f-bar) ;; but this means (foo-bar) (shorthand-in-namespace foo :as "heyhey") (heyhey-bar) ;; this also means (foo-bar) (f-bar) ;; this again means (f-bar) Jo=C3=A3o