unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: arne_bab@web.de
Cc: guile-devel@gnu.org
Subject: Re: Docstring as only form in a function
Date: Thu, 27 Feb 2014 01:41:39 -0500	[thread overview]
Message-ID: <87y50xoy58.fsf@yeeloong.lan> (raw)
In-Reply-To: <877g8pk9dv.wl%arne_bab@web.de> (Arne Babenhauserheide's message of "Thu, 20 Feb 2014 17:59:40 +0100")

Hi Arne,

Arne Babenhauserheide <arne_bab@web.de> writes:
> I think it would be more consistent to have the first form of the body
> double as a docstring if it is a string.

I agree with others that this is a very bad idea, and would encourage
you to change your habits.  However, for the sake of showing how easy it
is to modify 'define' to act the way you prefer in your own modules:

(define-syntax define
  (with-syntax ((guile-define #'(@ (guile) define)))
    (lambda (form)
      (syntax-case form ()
        ((define (name . args) str)
         (string? (syntax->datum #'str))
         #'(guile-define (name . args) str str))
        ((define . rest)
         #'(guile-define . rest))))))

     Mark



      parent reply	other threads:[~2014-02-27  6:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-20 16:59 Docstring as only form in a function Arne Babenhauserheide
2014-02-20 17:38 ` Neil Jerram
2014-02-20 17:40 ` Panicz Maciej Godek
2014-02-20 20:22 ` Taylan Ulrich Bayırlı/Kammer
2014-02-27  6:41 ` Mark H Weaver [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y50xoy58.fsf@yeeloong.lan \
    --to=mhw@netris.org \
    --cc=arne_bab@web.de \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).