emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Should records be able to mimic primitive types?


From: Stefan Monnier
Subject: Re: Should records be able to mimic primitive types?
Date: Sun, 24 Sep 2017 12:44:42 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]