all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: Should records be able to mimic primitive types?
Date: Sun, 24 Sep 2017 12:44:42 -0400	[thread overview]
Message-ID: <jwvpoagqcpf.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: CAArVCkTRf0aU7NZV+wOQ7U8MLKA6=vqnf_nOj_MmBUXSL=R-2A@mail.gmail.com

> As mentioned, such invariants can be written conditionally to no `fset'
> calls happening. If `fset' is used, all invariants are trivially broken.

Emacs was designed with the intention to make it easy to change pretty
much any part of its behavior.  `fset` is one of the tools for that, but
it's far from the only one.

We can't list all the ways someone can shoot himself in the foot with
Emacs Lisp, and even less automatically check them.  So we have to limit
ourselves to something more realistic, which is to focus on the problems
which do occur with some reasonable probability.

This said, if you do want to avoid such structs, I won't object (tho
I'll find it a waste of time) as long as the check is done at
compile-time (so it has 0 cost at run-time), e.g. in the
`cl-defstruct` macro.


        Stefan




      reply	other threads:[~2017-09-24 16:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04 22:00 Should records be able to mimic primitive types? Paul Eggert
2017-04-05  1:09 ` Stefan Monnier
2017-04-08 15:09   ` Philipp Stephani
2017-04-08 17:57     ` Stefan Monnier
2017-05-01 11:35       ` Philipp Stephani
2017-05-01 12:03         ` Stefan Monnier
2017-06-10 11:39           ` Philipp Stephani
2017-06-10 12:43             ` Eli Zaretskii
2017-06-12 15:07               ` Philipp Stephani
2017-06-12 17:00                 ` Eli Zaretskii
2017-06-12 17:15                   ` Stefan Monnier
2017-06-12 17:22                     ` Eli Zaretskii
2017-06-12 17:47                       ` Stefan Monnier
2017-06-12 17:40       ` Stefan Monnier
2017-06-16 18:42         ` Philipp Stephani
2017-06-16 19:07           ` Stefan Monnier
2017-09-24 14:47             ` Philipp Stephani
2017-09-24 16:44               ` Stefan Monnier [this message]

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=jwvpoagqcpf.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 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.