Skip to content

Instantly share code, notes, and snippets.

@bowbow99
Created November 26, 2010 01:13
Show Gist options
  • Select an option

  • Save bowbow99/716148 to your computer and use it in GitHub Desktop.

Select an option

Save bowbow99/716148 to your computer and use it in GitHub Desktop.
継続とマクロでお手軽ブレークポイント - athosの日記 http://d.hatena.ne.jp/athos/20091226/p1 を #xyzzy + condition-restart で
(require "condition-restart")
(define-condition breakpoint (condition)
(name places)
(:report (lambda (bp stream)
(format stream "ぶれーく! ~S" (breakpoint-name bp)))))
(defmacro bp (name &rest places)
`(tagbody breakpoint
(restart-case
(signal 'breakpoint :name ',name :places '(,@places))
(continue () :report "続行")
,@(mapcar (lambda (place)
`(,(intern (format nil "|~S|" place)) (#1=#:value)
:report (lambda (stream)
(format stream "~S => ~S を変更する"
',place ,place))
:interactive (lambda ()
(list (condition-restart::read-value-for ',place)))
(setf ,place #1#)
(go breakpoint)))
places))))
@bowbow99
Copy link
Author

Common Lisp には break http://www.lispworks.com/documentation/HyperSpec/Body/f_break.htm があるのでいらない...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment