Pregunta:
He ejecutado accidentalmente lo siguiente:
(unintern variable)
donde el valor de la variable
era nil
.
¿Cómo puedo recuperar nil
sin reiniciar Emacs?
Respuesta:
(defconst nil ())
parece tener el efecto correcto; tenga en cuenta que nil
y una lista vacía son indistinguibles en Emacs Lisp.
Miré lread.c:4034
para ver cómo se crea nil
en un obarray
.
Tenga en cuenta el comentario en la línea 3896 en lread.c
:
/* There are plenty of other symbols which will screw up the Emacs
session if we unintern them, as well as even more ways to use
`setq' or `fset' or whatnot to make the Emacs session
unusable. Let's not go down this silly road. --Stef */
/* if (EQ (tem, Qnil) || EQ (tem, Qt))
error ("Attempt to unintern t or nil"); */
Esto explica por qué Emacs no protege contra (unintern nil)
y (unintern t)
.