From: Artur Malabarba <bruce.connor.am@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Lars Magne Ingebrigtsen <larsi@gnus.org>,
David Kastrup <dak@gnu.org>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Constructed docstrings for closures
Date: Fri, 16 Jan 2015 21:07:35 -0200 [thread overview]
Message-ID: <CAAdUY-JUSNhEH68G2-pY2WP7eZu1P+94SotAnjhSAov-juAYCg@mail.gmail.com> (raw)
In-Reply-To: <jwvtwzq1mm9.fsf-monnier+emacs@gnu.org>
> 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)))
next prev parent reply other threads:[~2015-01-16 23:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-16 16:18 Constructed docstrings for closures Stefan Monnier
2015-01-16 16:46 ` David Kastrup
2015-01-16 16:51 ` Lars Magne Ingebrigtsen
2015-01-16 16:52 ` Lars Magne Ingebrigtsen
2015-01-16 20:54 ` Stefan Monnier
2015-01-16 23:07 ` Artur Malabarba [this message]
2015-01-18 12:04 ` Ted Zlatanov
2015-01-18 12:19 ` David Kastrup
2015-01-18 18:15 ` Ted Zlatanov
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/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAAdUY-JUSNhEH68G2-pY2WP7eZu1P+94SotAnjhSAov-juAYCg@mail.gmail.com \
--to=bruce.connor.am@gmail.com \
--cc=dak@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.org \
--cc=monnier@iro.umontreal.ca \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).