From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Eric Abrahamsen <eric@ericabrahamsen.net>
Cc: 25294@debbugs.gnu.org
Subject: bug#25294: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer
Date: Tue, 12 Dec 2017 18:58:32 -0500 [thread overview]
Message-ID: <87lgi7cxcn.fsf@users.sourceforge.net> (raw)
In-Reply-To: <87d13kqz70.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Mon, 11 Dec 2017 21:42:43 -0800")
Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> +Generic functions provide a new argument-list keyword,
The way you phrased this might lead me to think that the &context
keyword should go in the cl-defgeneric form (maybe it's not so bad when
seeing in context under cl-defmethod, in patch form it's a bit
disconnected).
> +@code{&context}, which can be used to introduce extra specializers
> +that test the general environment in which the method is run. This
> +keyword should appear after the list of required arguments, but before
> +any @code{&rest} or @code{&optional} keywords.
I wonder if it would be clearer to add this to the @defmac header?
@defmac cl-defmethod name [qualifier] arguments [&context (expr spec)@dots{}] &rest [docstring] body
Hmm, maybe that ends up being too long.
> The @code{&context}
> +specializers look much like regular argument
> +specializers---(@var{expr} @var{spec})---except that @var{expr} is an
> +expression to be evaluated in the current context, and the @var{spec}
> +is a value to compare against. For example, @code{&context
> +(overwrite-mode (eql t))} will make the method applicable only when
> +@code{overwrite-mode} is turned on. The @code{&context} keyword can
> +be followed by any number of context specializers. Because the
> +context specializers are not part of the generic function's required
> +argument signature, they may be omitted in methods that don't require
> +them.
Otherwise looks fine.
next prev parent reply other threads:[~2017-12-12 23:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-29 19:13 bug#25294: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer Eric Abrahamsen
2016-12-30 4:35 ` npostavs
2017-12-11 23:57 ` Eric Abrahamsen
2017-12-12 0:08 ` Noam Postavsky
2017-12-12 1:39 ` Noam Postavsky
2017-12-12 1:43 ` Noam Postavsky
2017-12-12 5:42 ` Eric Abrahamsen
2017-12-12 23:58 ` Noam Postavsky [this message]
2017-12-14 0:06 ` Eric Abrahamsen
2017-12-14 21:01 ` Eric Abrahamsen
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=87lgi7cxcn.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=25294@debbugs.gnu.org \
--cc=eric@ericabrahamsen.net \
/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.