[slime-devel] [PATCH] macro indentation fix

My previous patch fixed the arglist code, but the function that returns macro indention was still broken. (In more ways than one, actually--it didn't treat &body and &rest equivalently. That problem turned out to be the actual problem with the indentation macro that led me on this adventure in the first place. Go figure.) This patch fixes that quite nicely, I believe. Chris Capel *** /home/chris/lisp-libs/slime/swank.lisp.temp 2004-11-24 04:58:59.724472328 -0600 --- /home/chris/lisp-libs/slime/swank.lisp 2004-11-24 05:01:38.509333360 -0600 *************** *** 3405,3411 **** (defun macro-indentation (arglist) (if (well-formed-list-p arglist) ! (position '&body (remove '&whole arglist)) nil)) (defun well-formed-list-p (list) --- 3405,3415 ---- (defun macro-indentation (arglist) (if (well-formed-list-p arglist) ! (let ((indent-list (remove-whole-from-arglist ! (remove-aux-from-arglist ! arglist)))) ! (or (position '&body indent-list) ! (position '&rest indent-list))) nil)) (defun well-formed-list-p (list)

On Wed, Nov 24, 2004 at 05:09:08AM -0600, Chris Capel wrote:
My previous patch fixed the arglist code, but the function that returns macro indention was still broken. (In more ways than one, actually--it didn't treat &body and &rest equivalently. That problem turned out to be the actual problem with the indentation macro that led me on this adventure in the first place. Go figure.) This patch fixes that quite nicely, I believe.
I believe that only indenting &body as code was intentional. Even the Hyperspec hints that it should be used that way (as opposed to &rest) in 3.4.4: &body is identical in function to &rest, but it can be used to inform certain output-formatting and editing functions that the remainder of the form is treated as a body, and should be indented accordingly. I would think that any user code that used &rest where a body was expected was the broken code. I think I agree in spirit with the removal of &aux and &whole for the reasons you gave, but it should be an option (perhaps default, but an option nonetheless). -bcd -- *** Brian Downing <bdowning at lavos dot net>

Brian Downing wrote:
On Wed, Nov 24, 2004 at 05:09:08AM -0600, Chris Capel wrote:
My previous patch fixed the arglist code, but the function that returns macro indention was still broken. (In more ways than one, actually--it didn't treat &body and &rest equivalently. That problem turned out to be the actual problem with the indentation macro that led me on this adventure in the first place. Go figure.) This patch fixes that quite nicely, I believe.
I believe that only indenting &body as code was intentional. Even the Hyperspec hints that it should be used that way (as opposed to &rest) in 3.4.4:
&body is identical in function to &rest, but it can be used to inform certain output-formatting and editing functions that the remainder of the form is treated as a body, and should be indented accordingly.
I would think that any user code that used &rest where a body was expected was the broken code.
I see. This certainly makes sense. I'll inform the maintainer of the macro :-).
I think I agree in spirit with the removal of &aux and &whole for the reasons you gave, but it should be an option (perhaps default, but an option nonetheless).
I suppose it wouldn't be too difficult to arrange, but ... why? I really can't see a situation in the current slime where that would be useful. I put the code to remove those parts of the arglist as high up as I could, so that their effect would be localized to 1) the macro indentation function, and 2) "Print the list ARGLIST for display in the echo area." Any other code is unaffected by these changes.

On Wed, Nov 24, 2004 at 08:42:18AM -0600, Chris Capel wrote:
I think I agree in spirit with the removal of &aux and &whole for the reasons you gave, but it should be an option (perhaps default, but an option nonetheless).
I suppose it wouldn't be too difficult to arrange, but ... why? I really can't see a situation in the current slime where that would be useful. I put the code to remove those parts of the arglist as high up as I could, so that their effect would be localized to 1) the macro indentation function, and 2) "Print the list ARGLIST for display in the echo area." Any other code is unaffected by these changes.
Mostly I'm being pedantic. &aux and &whole are technically still parts of the lambda list, even if they are not useful to callers, and "magically" disposing of them could be seen as surprising. Also, on a more whimsical note: Perhaps having them show up in the Slime arglist will be a social pressure to not use them. :) -bcd -- *** Brian Downing <bdowning at lavos dot net>
participants (2)
-
Brian Downing
-
Chris Capel