Skip to content

Instantly share code, notes, and snippets.

@alphapapa
Forked from vermiculus/oref-start.el
Created September 3, 2017 23:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alphapapa/6ccd77485523d4d2bf73b7bf70731212 to your computer and use it in GitHub Desktop.
Save alphapapa/6ccd77485523d4d2bf73b7bf70731212 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