From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Namespace macros (was: Generators (iterators) for Gnu Emacs) Date: Sun, 07 Dec 2014 18:40:19 +0100 Message-ID: References: <877fy77zhp.fsf@web.de> <87k326d4ww.fsf@gmail.com> <877fy6rp2o.fsf@web.de> <548230FB.40307@dancol.org> <5482C872.5010304@dancol.org> <5483C537.3010707@dancol.org> <54840719.5080209@dancol.org> <87a92zmnv4.fsf@lifelogs.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1417974068 7182 80.91.229.3 (7 Dec 2014 17:41:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Dec 2014 17:41:08 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 07 18:41:03 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XxfpO-0004SS-Gu for ged-emacs-devel@m.gmane.org; Sun, 07 Dec 2014 18:41:02 +0100 Original-Received: from localhost ([::1]:58699 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxfpN-0001YQ-W2 for ged-emacs-devel@m.gmane.org; Sun, 07 Dec 2014 12:41:02 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xxfp3-0001YF-8n for emacs-devel@gnu.org; Sun, 07 Dec 2014 12:40:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xxfow-0001VF-BS for emacs-devel@gnu.org; Sun, 07 Dec 2014 12:40:41 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:55166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xxfow-0001V9-0A for emacs-devel@gnu.org; Sun, 07 Dec 2014 12:40:34 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xxfot-0004C5-U2 for emacs-devel@gnu.org; Sun, 07 Dec 2014 18:40:32 +0100 Original-Received: from 212.46.172.140 ([212.46.172.140]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 07 Dec 2014 18:40:31 +0100 Original-Received: from eller.helmut by 212.46.172.140 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 07 Dec 2014 18:40:31 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 29 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 212.46.172.140 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:EKkkrvtvunVaRRbhmNdAFwNclmE= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:179283 Archived-At: On Sun, Dec 07 2014, Ted Zlatanov wrote: > I don't know Stefan's motives, but would love to see actual namespaces > in Emacs Lisp. The closest thing I've seen is > https://github.com/Bruce-Connor/names which can be installed from the > GNU ELPA. Perhaps that's an actual problem we keep ignoring because > it's easy to hack around it "just that once." Thanks for the pointer. I also wrote a namespace macro: https://github.com/ellerh/namespace.el Another one I know is: https://github.com/chrisbarrett/elisp-namespaces The experience with my own namespace macro was that it works fairly well when writing a library from scratch, in particular when the code consists mostly of functions and almost no quoted symbols. If it works well, then the code looks a lot neater with namespaces. But it was also rather useless when I tried it to use it with the SLIME codebase. The existing code uses prefixes in inconsistent ways and quoted symbols are needed surprisingly often. This may also be a bit of a chicken-and-egg problem: if the existing code can't be used with those namespace macros than nobody will use namespaces, but as soon as some important libraries can be used with namespaces it pays of to use namespaces and we get more usable libraries. Helmut