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: Proper namespaces in Elisp Date: Tue, 5 May 2020 10:38:38 +0100 Message-ID: References: <237fe643-c14d-5406-b35d-a30dcd42c5ed@gmail.com> <87v9lb1irk.fsf@t510.orion.oneofus.la> <87sggf193f.fsf@t510.orion.oneofus.la> 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="71010"; mail-complaints-to="usenet@ciao.gmane.io" Cc: nic@ferrier.me.uk, =?UTF-8?Q?Cl=C3=A9ment_Pit=2DClaudel?= , emacs-devel To: Vladimir Sedach Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 05 11:39:27 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 1jVu2w-000IJ4-3v for ged-emacs-devel@m.gmane-mx.org; Tue, 05 May 2020 11:39:26 +0200 Original-Received: from localhost ([::1]:36318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVu2v-0004Ea-5r for ged-emacs-devel@m.gmane-mx.org; Tue, 05 May 2020 05:39:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50440) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVu2P-0003b1-N5 for emacs-devel@gnu.org; Tue, 05 May 2020 05:38:53 -0400 Original-Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]:40800) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVu2O-000118-QN for emacs-devel@gnu.org; Tue, 05 May 2020 05:38:53 -0400 Original-Received: by mail-io1-xd2a.google.com with SMTP id c2so1254182iow.7 for ; Tue, 05 May 2020 02:38:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=rp7CS8TobNxJsLGurfC9iAbAJBPLTzfWaJElE6QBHKk=; b=OULjn9dNsApZYBjH9VYgbLTCfvRkhupBM7nxDqUFG0fknzlfr8KiLElVo/5taLTfjI GeehkcnBPYSSGbdLAbXvQYryRwW+GlXHPVJmxmZZblyqf+Joux6HC0NBCeDKjKJhGn6D tdc7KfjZDVSOI2W+Z0ic14yRck8+aXOXV3071McG+KbDgTWUkBsiSRFm6Si+igiz/Mf7 yIlnf26OmALi35gfouiEYLzmQ/ZkIdm8KRcR+WD0SmPniomcjrLPNH2sZ4LOx5AmH4M3 dehCFsYnvpzNkpJeSVzHBNJqzj0/Nj6+y7PyJ3NQBgLdFM3EFislxDopiJiP66ie/xM2 oouA== 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:content-transfer-encoding; bh=rp7CS8TobNxJsLGurfC9iAbAJBPLTzfWaJElE6QBHKk=; b=W9xyzAoISkcksAX3AHnVaK2ttoOVvs1owiadHqmNPYcnpBj4884hdmt0FlyWX1PGTO 3AudzsxlHGKx8TB4emxAlnxqx2ieSBNp5aoIntSIO9YBEZFqoFhfK/heHxqKgvx8xdry z5xbpHbnjUmSnt9qg+zdzTIdyCr9RjA04r1ErEAZNKknMhxMZHs8ET7LlOQdb1GjqIOk zye8geLv8351XNbEul62KYdzje1gzGOvhw4CtIcF0PeJwoZm36wv7j5tOxjG+Zp+lFNg +WfnvXPccbArsl4juZQuhnx0eNqGH4ZHv7C5htwpbIBKu63uvr+DVXOOKmPW1cYGGkDQ rocQ== X-Gm-Message-State: AGi0PuYefzxaYrqMDHuBThZcaTc2V8bbA4c8PWc7VNiDbu2Mj72k68Ey 9uODyzW+rY/DGfQXocxC30aCHHPGrq8aQQF9EWg= X-Google-Smtp-Source: APiQypJ1JR9/458g0YkLHTZW65/32kNBtGmNkowicl7iMTeVQZUBQq5pygpQjHKOlynFEhqA9i10dDVDE4WQp8+Gm4M= X-Received: by 2002:a6b:8dc2:: with SMTP id p185mr2513317iod.138.1588671531719; Tue, 05 May 2020 02:38:51 -0700 (PDT) In-Reply-To: <87sggf193f.fsf@t510.orion.oneofus.la> Received-SPF: pass client-ip=2607:f8b0:4864:20::d2a; envelope-from=joaotavora@gmail.com; helo=mail-io1-xd2a.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:248957 Archived-At: On Tue, May 5, 2020 at 2:22 AM Vladimir Sedach wrote: > Jo=C3=A3o T=C3=A1vora writes: > > I liked that your example tried to bring a real-life problem > > to the table, but I can't make sense of it. > > Let me try a different way: > > 1. Library ABC version 1 does not define or export FUNC1. > 2. Package XYZ :uses ABC, importing all of ABC's exported symbols. > 3. Package XYZ defines FUNC1 for internal use. There is no problem. > 4. Library ABC version 1.1 defines and exports FUNC1. > 5. When XYZ is loaded with ABC version 1.1, XYZ unintentionally > overrides the definition of FUNC1 for all users of ABC. In which implementation of CL? In the ones I know, step 5 will get you an error, exactly describing the conflict, which you handle interactively or automhatically. You can choose to shadow import the symbol, unintern the conflicting symbol, or give up loading XYZ in its current form. You can reconsider :use for that new version of the library or rename FUNC1 (which is for internal use anyway) That's quite different of saying that :use is dangerous or anything. It's what it is if you know what it does, which is saying "I want all of that API's symbols accessible here without special qualification". It's like in primary school: remember those times when they merged two classes and some kid in the other class had the same first name as you? Same deal, basically. BTW, what you described as dangerous is exactly what happens in Elisp, _not_ Common Lisp. > Perhaps that makes it more clear. Nope. > >> Common Lisp does not do a good job of this, because whether or not a > >> symbol's package prefix is printed depends on the current package you > >> are in when printing. > > How is that a flaw? > You just pointed it out: I fail to see where. I think you'll agree that a Vlamidir in emacs-devel is not the same as a Vladimir somewhere else. To communicate to someone that I really do mean you, I wither print the full qualifying name or I have to agree beforehand on a common frame of reference. In CL, that's *PACKAGE*. Again, if you only have one namespace you don't have that problem. But then you don't have namespaces, right? :-) Jo=C3=A3o