From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Lars Magne Ingebrigtsen <larsi@gnus.org>, David Kastrup <dak@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Constructed docstrings for closures
Date: Fri, 16 Jan 2015 15:54:24 -0500 [thread overview]
Message-ID: <jwvtwzq1mm9.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m3mw5i4qip.fsf@gnus.org> (Lars Magne Ingebrigtsen's message of "Fri, 16 Jan 2015 17:52:14 +0100")
Lars suggests:
> (declare (comment (format "This is a comment about %s" bla)))
> would be a natural syntax, I think?
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))))
There are various issues around this:
1- the code that constructs the docstring should be visible to the compiler
(so the compiler can tell it where to find the value of the lexically
scoped `blabla' variable).
2- it shouldn't slow down normal evaluation
3- it should be implementable without too much effort.
From that point of view I guess David's approach is promising on
the first two points, but I'm not sure what the 3rd point would
look like.
Lars's suggestion seems problematic w.r.t point #2 since `lambda' would
now have to check for a `declare'.
I considered using a special property on the docstring as well, but
that's problematic w.r.t point #1.
So please keep sending ideas.
Stefan
next prev parent reply other threads:[~2015-01-16 20:54 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 [this message]
2015-01-16 23:07 ` Artur Malabarba
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvtwzq1mm9.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=dak@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.