unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Vitalie Spinu <spinuvit@gmail.com>
Cc: 20420@debbugs.gnu.org
Subject: bug#20420: 25.0.50; eieio methods with optional arguments now fail
Date: Sat, 25 Apr 2015 10:41:40 -0400	[thread overview]
Message-ID: <jwv1tj8e0pl.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <878udhp0ay.fsf@gmail.com> (Vitalie Spinu's message of "Sat, 25 Apr 2015 01:35:17 +0200")

>> Hmmm... I think this really only worked by accident and wasn't
>> explicitly supported by Emacs-24's doc.  And adding support for such
>> degenerate methods might not be straightforward in eieio-compat.el, so
>> I'm wondering where you've seen such use, to see how important it is to
>> provide that level of backward compatibility.
> I was using function xx that, when called with no arguments, dispatched
> methods with the same name on a local object in the current buffer.

That tells me *how* you used it, not *where*.

> As we are on this topic how about allowing for implicit dispatch on the
> arbitrary context? I mean something along the following lines:

Quoting from cl-generic.el:

   ;; TODO:
   [...]
   ;; - A way to dispatch on the context (e.g. the major-mode, some global
   ;;   variable, you name it).
   [...]
   ;;; Just for kicks: dispatch on major-mode
   ;;
   ;; Here's how you'd use it:
   ;;   (cl-defmethod foo ((x (major-mode text-mode)) y z) ...)
   ;; And then
   ;;     (foo 'major-mode toto titi)
   ;;
   ;; FIXME: Better would be to do that via dispatch on an "implicit argument".
   ;; E.g. (cl-defmethod foo (y z &context (major-mode text-mode)) ...)

IOW, patch welcome.


        Stefan





  reply	other threads:[~2015-04-25 14:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-24 19:28 bug#20420: 25.0.50; eieio methods with optional arguments now fail Vitalie Spinu
2015-04-24 20:42 ` Stefan Monnier
2015-04-24 23:35   ` Vitalie Spinu
2015-04-25 14:41     ` Stefan Monnier [this message]
2015-04-25 18:25       ` Vitalie Spinu
2015-04-26  4:02         ` Stefan Monnier
2015-04-26 12:00           ` Vitalie Spinu
2015-04-27  4:43             ` Stefan Monnier
2015-05-12  4:19           ` Stefan Monnier
2015-05-12 14:23             ` Vitalie Spinu
2016-05-14 23:01               ` Dmitry Gutov
2016-05-15  1:55                 ` Stefan Monnier

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=jwv1tj8e0pl.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=20420@debbugs.gnu.org \
    --cc=spinuvit@gmail.com \
    /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).