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: Constructed docstrings for closures Date: Fri, 16 Jan 2015 21:07:35 -0200 Message-ID: References: Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1421449670 22421 80.91.229.3 (16 Jan 2015 23:07:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Jan 2015 23:07:50 +0000 (UTC) Cc: Lars Magne Ingebrigtsen , David Kastrup , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 17 00:07:44 2015 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 1YCFzS-0007Q1-TR for ged-emacs-devel@m.gmane.org; Sat, 17 Jan 2015 00:07:43 +0100 Original-Received: from localhost ([::1]:57766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCFzS-00045i-5H for ged-emacs-devel@m.gmane.org; Fri, 16 Jan 2015 18:07:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56602) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCFzO-00045d-CL for emacs-devel@gnu.org; Fri, 16 Jan 2015 18:07:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YCFzN-00031Z-Hn for emacs-devel@gnu.org; Fri, 16 Jan 2015 18:07:38 -0500 Original-Received: from mail-oi0-x22c.google.com ([2607:f8b0:4003:c06::22c]:34533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCFzM-00031I-AM; Fri, 16 Jan 2015 18:07:36 -0500 Original-Received: by mail-oi0-f44.google.com with SMTP id a141so19657124oig.3; Fri, 16 Jan 2015 15:07:35 -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=ibsOqJ8pgLueomgVGICYKnSG0qpn90iBK9BI1EZxwlE=; b=OF5Jrw6UdXGvgRmKpyNV0RtbiM15wSOnVZn6LU17YrJcqZS0YOCM/cp5t3z4EYByqE wrZreFrBkVGFDEtWSJqaiCSzJl+kBrSOOdUocVPzMujG/9tFS9UWp95lPgvF2FXEvMW/ xdWljkCf5fWtoxPfQXjGGY1H5Ko5XLD7ZtZWdxEh/MdhmDfK7/d1LVMhQrM+YzA7w2jF uSfgh32lq2d/bAk1+nDHXMWTgpW30a0VRz24fb9szTuwokcddbyRkhJKkOIU8uKjYEX/ CtvRXZni8R52mb9sDMUD8h+qKZ++a9CeEaKHfzM0r1i1e4U9OSzzgL5OFdoxP6W2Steb 7OUA== X-Received: by 10.182.231.230 with SMTP id tj6mr11278804obc.58.1421449655424; Fri, 16 Jan 2015 15:07:35 -0800 (PST) Original-Received: by 10.76.125.1 with HTTP; Fri, 16 Jan 2015 15:07:35 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: RPDF5pMvPG1tVZ06Hm8_jTKm2OU X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c06::22c 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:181353 Archived-At: > Lars suggests: > > (declare (comment (format "This is a comment about %s" bla))) > > would be a natural syntax, I think? I agree this would be the most natural, but if it does slow down evaluation (which I think it would), then it isn't worth the cost. OTOH, it might be interesting to apply this logic to `defun's, since they already handle `declare' forms anyway. > David prefers: > > Doing it the other way round seems much cleaner: > > (with-doc-string > > (concat "Toto is very " blabla ".") > > (lambda (foo bar) > > (code using foo and bar (and blabla as well)))) If this is chosen, I would find the following form more natural: (lambda-with-doc-string (foo bar) ;; First body form is evaluated at compile time and must return a string. (concat "Toto is very " blabla ".") ;; Everything else is a regular lambda. (code using foo and bar (and blabla as well)))