From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: [PATCH] * etc/NEWS: Document incompatibilities introduced by record types.
Date: Wed, 13 Dec 2017 11:30:38 -0500 [thread overview]
Message-ID: <jwvr2rywqgw.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: lzd13ihbzb.fsf@gnu.org
>>> If programmers are not supposed to do it, let's detect it and report
>>> an error when they try. That way, they will know it's an error as
>>> soon as they try, rather than needing to debug it to find out it's an error.
>> When was the last time you saw a user try to redefine the
>> "integer" type?
>> [ I'll be happy to hear about cases in other languages than Elisp,
>> since otherwise it's going to be depressingly silent I'm afraid. ]
> What's so special about "integer"?
Oh, nothing, feel free to provide examples for other built-in types.
> How many other built-in types does Emacs Lisp have?
(length cl--generic-typeof-types) suggests 35.
> Can you list them all by heart? Can everyone?
Just because you can't name them doesn't mean you're likely to
accidentally use one of them by accident.
> What about many different packages which may redefine each other's
> types?
Thank you for this example: this problem has been with us since Emacs-19
got defstruct. So what you all been doing all these years not trying to
solve this problem?
> Especially since Emacs Lisp does not have the Common Lisp-style
> package system, and it does not enforce the prefix conventions.
It's not enforced, but it's followed reasonably well these days.
> It seems to me that warning on redefining a type (or defining a type
> with a name which already names a type) is a very good idea.
As I said, I'm not opposed to it. But I don't think the problem
deserves such a large blurb in NEWS about some very serious new problem
introduced by `make-record`.
> Emacs Lisp already warns on redefining functions with a different
> signature.
There's warning and there's warning. Elisp doesn't warn when you
redefine with fset/defalias. It only warns when you *compile* the code
that does.
> Why not warn about types?
As long as it's done at compile-time or equivalent (e.g. not in
`make-record`), I don't object (but given how rarely defclass/defstruct
is used I don't see a strong need for it either).
Stefan
next prev parent reply other threads:[~2017-12-13 16:30 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-11 21:37 [PATCH] * etc/NEWS: Document incompatibilities introduced by record types Philipp Stephani
2017-12-11 22:25 ` Clément Pit-Claudel
2017-12-21 16:35 ` Philipp Stephani
2017-12-12 3:21 ` Stefan Monnier
2017-12-12 19:13 ` Clément Pit-Claudel
2017-12-12 20:45 ` Stefan Monnier
2017-12-13 23:00 ` Richard Stallman
2017-12-14 14:08 ` Stefan Monnier
2017-12-14 22:16 ` Richard Stallman
2017-12-14 23:41 ` Stefan Monnier
2017-12-15 21:25 ` Richard Stallman
2017-12-14 22:17 ` Richard Stallman
2017-12-22 10:06 ` Eli Zaretskii
2017-12-21 17:29 ` Philipp Stephani
2017-12-13 23:00 ` Richard Stallman
2017-12-14 14:07 ` Stefan Monnier
2017-12-12 22:06 ` Richard Stallman
2017-12-12 22:20 ` Stefan Monnier
2017-12-13 15:41 ` Sam Steingold
2017-12-13 16:30 ` Stefan Monnier [this message]
2017-12-13 23:03 ` Richard Stallman
2017-12-14 14:13 ` Stefan Monnier
2017-12-13 1:03 ` Stefan Monnier
2017-12-13 1:12 ` Noam Postavsky
2017-12-13 1:29 ` Stefan Monnier
2017-12-13 17:40 ` Stephen Leake
2017-12-13 23:02 ` Richard Stallman
2017-12-14 14:12 ` Stefan Monnier
2017-12-14 22:16 ` Richard Stallman
2017-12-14 22:16 ` Richard Stallman
2017-12-21 17:34 ` Philipp Stephani
2017-12-21 18:43 ` Stefan Monnier
2017-12-22 18:46 ` Richard Stallman
2017-12-22 19:39 ` [SUSPECTED SPAM] " Stefan Monnier
2017-12-23 14:56 ` Richard Stallman
2017-12-23 14:56 ` make-record Richard Stallman
2017-12-23 15:53 ` make-record Stefan Monnier
2017-12-24 20:35 ` make-record Richard Stallman
2017-12-26 2:43 ` make-record Stefan Monnier
2017-12-26 19:41 ` make-record Richard Stallman
2017-12-12 22:05 ` [PATCH] * etc/NEWS: Document incompatibilities introduced by record types Richard Stallman
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=jwvr2rywqgw.fsf-monnier+gmane.emacs.devel@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.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 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).