emacs-devel
[Top][All Lists]
Advanced

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

Re: Some improvements for cl-flet


From: Richard Stallman
Subject: Re: Some improvements for cl-flet
Date: Tue, 12 Oct 2021 18:43:00 -0400

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > One key category of use is for macros that take a body and want to expose
  > variable-like places to that body. For instance, there is the with-slots 
macro
  > which binds convenience aliases for slots of a CLOS object, so that:

  >    (with-slots (foo bar) object
  >      (setf foo bar))

Is this small convenience worth complicating the basic semantics of Lisp?
We don't use CLOS very much.

If there is no need for asynchronous atomicity,
with-slots can be implemented with a macro that expands into

   (let ((foo (slot-value object 'foo))
         (bar (slot-value object bar)))
     (unwind-protect
          (setf foo bar)
       (setf (slot-value object 'foo) foo)
       (setf (slot-value object 'bar) bar)))

We can tell people, if you're concerned about atomicity,
access slots by hand.

Adding additional features to a language gives a benefit.  But there
is also a benefit in preserving the things you know can't be happening
in a program.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





reply via email to

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