ebpa / elisp-weak-ref

Weak references for Emacs Lisp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Emacs Lisp Weak References

This package provides two functions:

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

See it in action:

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

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

About

Weak references for Emacs Lisp

License:The Unlicense


Languages

Language:Emacs Lisp 100.0%