From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel Subject: Re: Namespace macros (was: Generators (iterators) for Gnu Emacs) Date: Mon, 8 Dec 2014 00:11:01 +0000 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> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e013d202401cb670509a943d5 X-Trace: ger.gmane.org 1417997482 26426 80.91.229.3 (8 Dec 2014 00:11:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Dec 2014 00:11:22 +0000 (UTC) Cc: emacs-devel To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 08 01:11:17 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 1Xxlv0-0000yG-VR for ged-emacs-devel@m.gmane.org; Mon, 08 Dec 2014 01:11:15 +0100 Original-Received: from localhost ([::1]:59599 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xxlv0-0004hc-GJ for ged-emacs-devel@m.gmane.org; Sun, 07 Dec 2014 19:11:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xxluw-0004hV-Lb for emacs-devel@gnu.org; Sun, 07 Dec 2014 19:11:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xxlus-0005Qt-6n for emacs-devel@gnu.org; Sun, 07 Dec 2014 19:11:07 -0500 Original-Received: from mail-la0-x230.google.com ([2a00:1450:4010:c03::230]:64926) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xxlur-0005Qh-Ps for emacs-devel@gnu.org; Sun, 07 Dec 2014 19:11:06 -0500 Original-Received: by mail-la0-f48.google.com with SMTP id gf13so3077688lab.7 for ; Sun, 07 Dec 2014 16:11:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=OAOH8/uTseLpd6AMFoi8WCfZaV31nR9X4k7sLXkdRco=; b=xT+Wng9gci0LX9HU8dYh9Ze5dt24M7p9xNn2Bq6l1gNJA5ak4chjq4Khi19PRbCjuf nwZ6Kl6G0VNw+DuG401qn1sRPL67lWLcLl6mKCtIDPuMsDJ4qdnE4GjJPB6e0clHScc7 UyhpLpydKrueLniniiC1EGDyg0bWTZfxSOlz2F53iD3ugA0Q1kPcC5fu+sv62iFtOTgs IbDcUaO9K5uOb6XuUHhmhDB2GtCeN6ALprfH5ewxs4N+pChWa3Uedd++vox7574lbEm7 p/WfArwuZP4ye34JnmJDsq743Tqs/N/swjhXPkcdXkDZ1Ger+BwVp780aw0ha86Rwfp+ 3RsA== X-Received: by 10.152.21.9 with SMTP id r9mr13899074lae.76.1417997461865; Sun, 07 Dec 2014 16:11:01 -0800 (PST) Original-Received: by 10.112.53.137 with HTTP; Sun, 7 Dec 2014 16:11:01 -0800 (PST) Original-Received: by 10.112.53.137 with HTTP; Sun, 7 Dec 2014 16:11:01 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: 9e7kh_XYKxl4iLjkLjydtwVQZLk X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::230 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:179331 Archived-At: --089e013d202401cb670509a943d5 Content-Type: text/plain; charset=UTF-8 On 7 Dec 2014 15:40, "Helmut Eller" wrote: > > 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. Names.el partially solves that by namespacing sharp-quoted symbols as function names (you have to use the sharp-quote on function names for this to work, but that's good practice anyway). This catches the majority of the uses of quotes for me. Quoted variable names are impossible to identify with certainty, so Names doesn't try to namespace them by default. But but it does offer the option to namespace regular quoted symbols as variable names. --089e013d202401cb670509a943d5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 7 Dec 2014 15:40, "Helmut Eller" <eller.helmut@gmail.com> wrote:
>
> On Sun, Dec 07 2014, Ted Zlatanov wrote:
>
> > I don't know Stefan's motives, but would love to see actu= al namespaces
> > in Emacs Lisp.=C2=A0 The closest thing I've seen is
> > https://github.= com/Bruce-Connor/names which can be installed from the
> > GNU ELPA.=C2=A0 Perhaps that's an actual problem we keep igno= ring 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 we= ll
> when writing a library from scratch, in particular when the code
> consists mostly of functions and almost no quoted symbols.=C2=A0 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 SLIM= E
> codebase.=C2=A0 The existing code uses prefixes in inconsistent ways a= nd
> quoted symbols are needed surprisingly often.

Names.el partially solves that by namespacing sharp-quoted s= ymbols as function names (you have to use the sharp-quote on function names= for this to work, but that's good practice anyway). This catches the m= ajority of the uses of quotes for me.

Quoted variable names are impossible to identify with certai= nty, so Names doesn't try to namespace them by default. But but it does= offer the option to namespace regular quoted symbols as variable names. --089e013d202401cb670509a943d5--