From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: acorallo@gnu.org, basil@contovou.net, 69739-done@debbugs.gnu.org
Subject: bug#69739: 30.0.50; `type-of` is not precise enough
Date: Mon, 18 Mar 2024 09:33:58 -0400 [thread overview]
Message-ID: <jwv34snd680.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <86r0g74s11.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 18 Mar 2024 14:56:58 +0200")
>> +@example
>> +(object-type 1)
>> + @result{} fixnum
>> +@group
>> +(object-type 'nil)
>> + @result{} null
>> +(object-type (record 'foo))
>> + @result{} foo
>
> "object-type"?
Oops! thanks.
>> DEFUN ("type-of", Ftype_of, Stype_of, 1, 1, 0,
>> doc: /* Return a symbol representing the type of OBJECT.
>> The symbol returned names the object's basic type;
>> -for example, (type-of 1) returns `integer'. */)
>> +for example, (type-of 1) returns `integer'.
>> +Contrary to `cl-type-of' the returned type is not always the most
> ^^
> I think we want a comma there.
>> +DEFUN ("cl-type-of", Fcl_type_of, Scl_type_of, 1, 1, 0,
>> + doc: /* Return a symbol representing the type of OBJECT.
>> +The symbol returned names the most specific possible type of the object.
> ^^^^^^^^^^^^^^^^^^^
> I think "The returned symbol" is better here, as it prevents a
> possible confusion (whether "returned" alludes to "symbol" or to
> "names").
Agreed.
>> +for example, (object-type nil) returns `null'.
> ^^^^^^^^^^^
> "object-type"?
As you can see I had used `object-type` instead of `cl-type-of` in some
prior version of the code :-)
>> (defsubst subr-primitive-p (object)
>> - "Return t if OBJECT is a built-in primitive function."
>> + "Return t if OBJECT is a built-in primitive written in C."
>> (declare (side-effect-free error-free))
>> (and (subrp object)
>> (not (subr-native-elisp-p object))))
>>
>> +(defsubst primitive-function-p (object)
>> + "Return t if OBJECT is a built-in primitive function."
>> + (declare (side-effect-free error-free))
>> + (and (subrp object)
>> + (not (or (subr-native-elisp-p object)
>> + (eq (cdr (subr-arity object)) 'unevalled)))))
>
> Should these doc strings mention the special case of special form,
> which each one of them treats differently?
OK.
Pushed, thanks,
Stefan
next prev parent reply other threads:[~2024-03-18 13:33 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
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 [this message]
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=jwv34snd680.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=69739-done@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).