Advertisement
Guest User

Example macroexansion

a guest
Feb 23rd, 2015
775
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. Macro definition
  2. ================
  3.  
  4. (defmacro updating (widget &body body)
  5. "Protect updating widgets."
  6. `(progn
  7. (begin-update ,widget)
  8. (unwind-protect (progn ,@body)
  9. (end-update ,widget))))
  10.  
  11. Example
  12. =======
  13.  
  14. (updating my-combo-box
  15. (load-data-into my-combo-box)
  16. (setf (selected-index my-combo-box) 0))
  17.  
  18. Macroexpands into:
  19. ==================
  20.  
  21. (progn
  22. (begin-update my-combo-box)
  23. (unwind-protect
  24. (progn
  25. (load-data-into my-combo-box)
  26. (setf (selected-index my-combo-box) 0))
  27. (end-update my-combo-box)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement