Created
January 16, 2012 13:54
-
-
Save adh/1620982 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Remove role list from list of class options | |
(set! class-opts (plist-remove-keys class-opts '(:roles))) | |
;; Evaluate list of roles in outer context | |
(set! roles (eval-list roles (%macro-expansion-environment))) | |
;; Extend used slot and options lists by matching lists in used roles | |
;; Also remove roles that conflict with superclass roles | |
(set! roles (map* (lambda (role-object) | |
(let ((role (assert-instance role-object <role>))) | |
(set! slots (append slots | |
(role-slots role))) | |
(set! class-opts (append class-opts | |
(role-options role))) | |
role)) | |
roles)) | |
;; put evaluated list of roles back | |
(set! class-opts (nconc `(:roles ',roles) | |
class-opts)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment