unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "Basil L. Contovounesios" <basil@contovou.net>,
	Andrea Corallo <acorallo@gnu.org>, Eli Zaretskii <eliz@gnu.org>
Cc: 69739@debbugs.gnu.org
Subject: bug#69739: 30.0.50; `type-of` is not precise enough
Date: Fri, 15 Mar 2024 10:09:11 -0400	[thread overview]
Message-ID: <jwvjzm3k4gf.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <877ci3stzu.fsf@epfl.ch> (Basil L. Contovounesios's message of "Fri, 15 Mar 2024 10:51:33 +0100")

Basil L. Contovounesios [2024-03-15 10:51:33] wrote:
> No objections here, just one question: did you consider extending
> type-of with an optional argument instead of introducing cl-type-of?
> Or would that be too messy?

I did.  I decided to introduce a new function for the following reasons:

- The main use for the new function is in the dispatch code of
  `cl-generic` where it's on the critical path, so one less argument is
  better than one more argument.  Not sure how much impact it would
  really have, tho, so it's not a very strong argument.
- I don't know of a good reason to prefer the `type-of` behavior other
  than backward compatibility, and requiring a non-nil arg to get the
  "good" behavior would make it difficult to get rid of the
  legacy behavior.


Andrea Corallo [2024-03-15 06:54:36] wrote:
> FWIW: I think this is a good change and agree `cl-type-of` is a good
> name for the new function.  I'm just wondering if we should have some
> test to cover this.

Are you suggesting that my code can be anything else than perfect?
More seriously, I couldn't think of a good test, but I'll try harder.

Eli Zaretskii [2024-03-15 13:50:56] wrote:
> Should we document this new function in the ELisp manual?

I was thinking that we should do that only when/if we demote `type-of`
(`(cl-)type-of` is an operation that's used very rarely, so I think it's
best to keep it to a minimum in the manual),
Of course, the name also begs the question whether it should be in the
ELisp manual or in the CL manual.

In a previous version of the patch I had it documented alongside
`type-of`, so I can easily dig that up if you think it's best.


        Stefan






  reply	other threads:[~2024-03-15 14:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11 23:19 bug#69739: 30.0.50; `type-of` is not precise enough Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-12 13:37 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-12 14:40   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-12 16:07     ` Rudolf Schlatte
2024-03-13 22:10       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-12 13:58 ` Eli Zaretskii
2024-03-12 14:43   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-12 15:02     ` Eli Zaretskii
2024-03-12 15:39       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-13 11:55         ` Eli Zaretskii
2024-03-14 16:56           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-15  9:42             ` Andrea Corallo
2024-03-15 10:54               ` Andrea Corallo
2024-03-15  9:51             ` Basil L. Contovounesios
2024-03-15 14:09               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-03-15 15:18                 ` Eli Zaretskii
2024-03-17 22:29                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-18 12:56                     ` Eli Zaretskii
2024-03-18 13:33                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-15 11:50             ` Eli Zaretskii

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=jwvjzm3k4gf.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=69739@debbugs.gnu.org \
    --cc=acorallo@gnu.org \
    --cc=basil@contovou.net \
    --cc=eliz@gnu.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).