Skip to content

skeeto/elisp-weak-ref

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emacs Lisp Weak References

This package provides two functions:

  • weak-ref : Creates a weak reference to an object
  • weak-ref-deref : Access the object behind a weak reference

See it in action:

(setq ref (weak-ref (list 1 2 3)))
(weak-ref-deref ref) ; => (1 2 3)
(garbage-collect)
(weak-ref-deref ref) ; => nil

It's build on top of the weak references provided by hash tables.