Skip to content

Instantly share code, notes, and snippets.

@vermiculus
Created May 8, 2017 04:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vermiculus/89d6f18c60915dd75044b7d6190217cd to your computer and use it in GitHub Desktop.
Save vermiculus/89d6f18c60915dd75044b7d6190217cd to your computer and use it in GitHub Desktop.
;;; Neat convenience function for working with Elisp's EIEIO objects
(defmacro oref* (object &rest slots)
"Like `oref', but each slot in SLOTS is applied in sequence.
For example,
\(oref* obj :inner :property)
is equivalent to
\(oref \(oref obj :inner) :property)"
(while slots
(setq object (list 'oref object (car slots))
slots (cdr slots)))
object)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment