From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: Docstring as only form in a function Date: Thu, 20 Feb 2014 17:38:22 +0000 Message-ID: References: <877g8pk9dv.wl%arne_bab@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1392917922 22303 80.91.229.3 (20 Feb 2014 17:38:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 20 Feb 2014 17:38:42 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Feb 20 18:38:49 2014 Return-path: Envelope-to: guile-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 1WGXaB-0004Je-JS for guile-devel@m.gmane.org; Thu, 20 Feb 2014 18:38:47 +0100 Original-Received: from localhost ([::1]:39908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGXaB-0007qt-7O for guile-devel@m.gmane.org; Thu, 20 Feb 2014 12:38:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGXZy-0007pL-VS for guile-devel@gnu.org; Thu, 20 Feb 2014 12:38:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGXZr-0005jT-MK for guile-devel@gnu.org; Thu, 20 Feb 2014 12:38:34 -0500 Original-Received: from out1.ip06ir2.opaltelecom.net ([62.24.128.242]:12690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGXZr-0005j3-Fv for guile-devel@gnu.org; Thu, 20 Feb 2014 12:38:27 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArEMAF48BlNOlX8Z/2dsb2JhbABZgwaEEboGgwEDAoEPF3SCJQEBBSMPAQUeMwQEAxgCAiYCAiwNHiGIAa0YoRwXFoETh3mFSRaCWYFJBJgwkiSDLTw X-IPAS-Result: ArEMAF48BlNOlX8Z/2dsb2JhbABZgwaEEboGgwEDAoEPF3SCJQEBBSMPAQUeMwQEAxgCAiYCAiwNHiGIAa0YoRwXFoETh3mFSRaCWYFJBJgwkiSDLTw X-IronPort-AV: E=Sophos;i="4.97,513,1389744000"; d="scan'208";a="601699779" Original-Received: from host-78-149-127-25.as13285.net (HELO arudy) ([78.149.127.25]) by out1.ip06ir2.opaltelecom.net with ESMTP; 20 Feb 2014 17:38:24 +0000 Original-Received: by arudy (Postfix, from userid 33) id 557D73803F; Thu, 20 Feb 2014 17:38:23 +0000 (GMT) X-PHP-Originating-Script: 0:rcmail.php In-Reply-To: <877g8pk9dv.wl%arne_bab@web.de> X-Sender: neil@ossau.homelinux.net User-Agent: Roundcube Webmail/0.9.5 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 62.24.128.242 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16898 Archived-At: On 2014-02-20 16:59, Arne Babenhauserheide wrote: > Hi, > > I recently experimented with docstrings, and I stumbled over not being > able to define a function which only has a docstring as body: > > > (define (foo) > "bar") > > (procedure-documentation foo) > ⇒ #f > > > Adding a form makes the string act as docstring: > > > (define (foo) > "bar" > #f) > > (procedure-documentation foo) > ⇒ "bar" > > > I feel that this is inconsistent, which hurts even more, because it > breaks for the simplest showcase of docstrings. > > > My use case for using docstrings like this is that when I start writing > a function, I begin with the docstring. There I explain what I want to > do. Then I commit. Then I implement the function. How does calling 'procedure-documentation' fit into this use case? Surely the most natural way, of reminding yourself what a not-yet-implemented function is supposed to do, is simply to look at its source code? Regards, Neil