From: Bruno H. <br...@cl...> - 2017-08-03 01:37:13
|
Hi Sam, > In clos-method2.lisp and many other places you have this pattern: > > --8<---------------cut here---------------start------------->8--- > (defmacro program-error-reporter (caller) > `#'(lambda (form detail errorstring &rest arguments) > (apply #'sys::lambda-list-error form detail > "~S: ~A" ,caller (apply #'format nil errorstring arguments)))) > --8<---------------cut here---------------end--------------->8--- > > Why not > > --8<---------------cut here---------------start------------->8--- > (defmacro program-error-reporter (caller) > `#'(lambda (form detail errorstring &rest arguments) > (apply #'sys::lambda-list-error form detail > "~S: ~?" ,caller errorstring arguments))) > --8<---------------cut here---------------end--------------->8--- Both are equivalent. I find the first one easier to understand, because ~S, ~A, and APPLY are very familiar to everyone, whereas I wouldn't remember how ~? works exactly - there are two cases - without looking up CLHS 22.3.7.6. The other possible explanation is that FORMATTER of ~? was not completely implemented when I wrote clos-method2.lisp, and I dared to use ~? only after it was efficient enough. Bruno |