Skip to content

Instantly share code, notes, and snippets.

@scymtym
Created September 26, 2022 13:43
Show Gist options
  • Save scymtym/c82fa4831e0f47d956205e796b6fd774 to your computer and use it in GitHub Desktop.
Save scymtym/c82fa4831e0f47d956205e796b6fd774 to your computer and use it in GitHub Desktop.
:map example
;; for (defclass … (:default-initargs :foo 5 :bar 6))
CL-USER> (defvar *ast*
(bp:with-builder ('list)
(bp:node* (:defclass)
(1 (:default-initarg . (:map . :name)) (bp:node* (:initform :value 5)) :name :foo)
(1 (:default-initarg . (:map . :name)) (bp:node* (:initform :value 6)) :name :bar))))
*AST*
CL-USER> (architecture.builder-protocol.print-tree:print-tree 'list *ast* *standard-output*)
DEFCLASS
├─DEFAULT-INITARG[:FOO]: INITFORM
│ VALUE: 5
└─DEFAULT-INITARG[:BAR]: INITFORM
VALUE: 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment