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: Mon, 12 Jun 2017 13:15:35 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

> If some usage is unequivocally wrong, can never support legitimate use
> cases, and the defenses are not too expensive, then I think this could
> be okay.  But we need to be careful not to disallow legitimate, though
> perhaps somewhat dangerous practices.  Emacs's tradition is to trust
> the Lisp programmers not to shoot themselves in the foot, so we
> generally prefer to err on that side of the line, when in doubt.
> Punishing the innocent on behalf of possibly guilty is something I
> think we should try to avoid.

I think the kind of added checks he's thinking of are "safe" in
this respect.

The reason why I disagree with them is because they are too costly
compared to the likelihood they'll ever help catch a bug (either because
they'd virtually never trigger except maybe during experimentation, and
in the unlikely event that they do trigger, the problem they discover
would quickly lead to lots of other problems anyway).

We generally don't check every imaginable meaningless circumstance, but
only those that we've found to occur often enough to warrant the runtime
and maintenance cost of an extra test.
E.g. the byte-compiler doesn't emit a warning when you try to compile
an expression like (+ 'b x).


        Stefan




reply via email to

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