From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Constructed docstrings for closures Date: Fri, 16 Jan 2015 17:46:19 +0100 Message-ID: <87oapyd678.fsf@fencepost.gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1421426794 4762 80.91.229.3 (16 Jan 2015 16:46:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Jan 2015 16:46:34 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 16 17:46:34 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 1YCA2Z-0005oM-QN for ged-emacs-devel@m.gmane.org; Fri, 16 Jan 2015 17:46:31 +0100 Original-Received: from localhost ([::1]:56434 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCA2Z-0002OQ-2H for ged-emacs-devel@m.gmane.org; Fri, 16 Jan 2015 11:46:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCA2R-0002OK-0G for emacs-devel@gnu.org; Fri, 16 Jan 2015 11:46:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YCA2P-0007i3-0n for emacs-devel@gnu.org; Fri, 16 Jan 2015 11:46:22 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCA2O-0007hz-TU for emacs-devel@gnu.org; Fri, 16 Jan 2015 11:46:20 -0500 Original-Received: from localhost ([127.0.0.1]:55001 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCA2O-0003z6-Fq; Fri, 16 Jan 2015 11:46:20 -0500 Original-Received: by lola (Postfix, from userid 1000) id ECD94E05F5; Fri, 16 Jan 2015 17:46:19 +0100 (CET) In-Reply-To: (Stefan Monnier's message of "Fri, 16 Jan 2015 11:18:26 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e 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:181335 Archived-At: Stefan Monnier writes: > When converting backquoted lambdas to closures, I've often bumped into > the following problem: > > `(lambda (foo bar) > ,(concat "Toto is very " blabla ".") > (code using foo and bar (and ',blabla as well))) > > So code-wise, this can be replaced by a closure just fine, but doc-wise > we don't have a way to construct a different docstring for > every closure. > > I'd like to lift this restriction by offering a new feature that lets us > do something like: > > (lambda (foo bar) > > (code using foo and bar (and blabla as well))) > > and get the closure we want with the docstring we want. > > Does anyone have an idea of what the > could/should be? 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)))) -- David Kastrup