From: Samium G. <_de...@fe...> - 2010-01-18 14:40:27
|
Good day folks, git://git.feelingofgreen.ru/sbcl has a patch (also attached below), which adds a separate condition for the &optional-and-&key style warning. regards, Samium Gromoff -- _deepfire-at-feelingofgreen.ru O< ascii ribbon campaign - stop html mail - www.asciiribbon.org --- commit 53fdf6356077a5abdc43fbef0277b53e005785bb Author: Samium Gromoff <_de...@fe...> Date: Mon Jan 18 16:16:21 2010 +0300 &OPTIONAL-AND-&KEY-IN-LAMBDA-LIST condition for finer grain muffling. diff --git a/src/code/condition.lisp b/src/code/condition.lisp index f9909cb..88c9531 100644 --- a/src/code/condition.lisp +++ b/src/code/condition.lisp @@ -966,6 +966,13 @@ (format stream "~@<Implicitly creating new generic function ~S.~:@>" (implicit-generic-function-name condition))))) +(define-condition &optional-and-&key-in-lambda-list (style-warning) + ((list :initarg :list :reader style-warning-lambda-list)) + (:report + (lambda (condition stream) + (format stream "~@<&OPTIONAL and &KEY found in the same lambda list: ~S.~:@>" + (style-warning-lambda-list condition))))) + (define-condition extension-failure (reference-condition simple-error) ()) diff --git a/src/compiler/parse-lambda-list.lisp b/src/compiler/parse-lambda-list.lisp index affb94d..9cbc7af 100644 --- a/src/compiler/parse-lambda-list.lisp +++ b/src/compiler/parse-lambda-list.lisp @@ -87,8 +87,8 @@ #-sb-xc-host (when (optional) (unless silent - (compiler-style-warn - "&OPTIONAL and &KEY found in the same lambda list: ~S" list))) + (compiler-style-warn 'sb!kernel::&optional-and-&key-in-lambda-list + :list list))) (setq keyp t state :key)) (&allow-other-keys |
From: Tobias C. R. <tc...@fr...> - 2010-01-18 19:34:46
|
Samium Gromoff <_de...@fe...> writes: > Good day folks, > > git://git.feelingofgreen.ru/sbcl has a patch (also attached below), > which adds a separate condition for the &optional-and-&key style warning. I'd like to see that in. If no one complains, I'll commit this probably around the weekend. I'll see if there's a better alternative than specifying the package qualifier explicitly. -T. > > regards, > Samium Gromoff > -- > _deepfire-at-feelingofgreen.ru > O< ascii ribbon campaign - stop html mail - www.asciiribbon.org > > --- > > commit 53fdf6356077a5abdc43fbef0277b53e005785bb > Author: Samium Gromoff <_de...@fe...> > Date: Mon Jan 18 16:16:21 2010 +0300 > > &OPTIONAL-AND-&KEY-IN-LAMBDA-LIST condition for finer grain muffling. > > diff --git a/src/code/condition.lisp b/src/code/condition.lisp > index f9909cb..88c9531 100644 > --- a/src/code/condition.lisp > +++ b/src/code/condition.lisp > @@ -966,6 +966,13 @@ > (format stream "~@<Implicitly creating new generic function ~S.~:@>" > (implicit-generic-function-name condition))))) > > +(define-condition &optional-and-&key-in-lambda-list (style-warning) > + ((list :initarg :list :reader style-warning-lambda-list)) > + (:report > + (lambda (condition stream) > + (format stream "~@<&OPTIONAL and &KEY found in the same lambda list: ~S.~:@>" > + (style-warning-lambda-list condition))))) > + > (define-condition extension-failure (reference-condition simple-error) > ()) > > diff --git a/src/compiler/parse-lambda-list.lisp b/src/compiler/parse-lambda-list.lisp > index affb94d..9cbc7af 100644 > --- a/src/compiler/parse-lambda-list.lisp > +++ b/src/compiler/parse-lambda-list.lisp > @@ -87,8 +87,8 @@ > #-sb-xc-host > (when (optional) > (unless silent > - (compiler-style-warn > - "&OPTIONAL and &KEY found in the same lambda list: ~S" list))) > + (compiler-style-warn 'sb!kernel::&optional-and-&key-in-lambda-list > + :list list))) > (setq keyp t > state :key)) > (&allow-other-keys > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev |
From: Tobias C. R. <tc...@fr...> - 2010-01-31 16:09:11
|
Samium Gromoff <_de...@fe...> writes: > Good day folks, > > git://git.feelingofgreen.ru/sbcl has a patch (also attached below), > which adds a separate condition for the &optional-and-&key style warning. I'd like to commit some variation of this, but I have difficulties in coming up with a better name: > +(define-condition &optional-and-&key-in-lambda-list (style-warning) > + ((list :initarg :list :reader style-warning-lambda-list)) > + (:report > + (lambda (condition stream) > + (format stream "~@<&OPTIONAL and &KEY found in the same lambda list: ~S.~:@>" > + (style-warning-lambda-list condition))))) > + > (define-condition extension-failure (reference-condition simple-error) > ()) Samium named the reader STYLE-WARNING-LAMBDA-LIST -- properly because he couldn't come up with a good name either. When I first read the patch, I thought there were more conditions having such a reader function, but actually there aren't. Can anyone think of a good name? I tended towards giving the slot no explicit reader, and using SLOT-VALUE on the condition -- which (afaik) is not portable, but supported by SBCL itself. The build-order.lisp-expr says ("src/code/condition" :not-host) so I thought, "Nice! I'll be able to make use of sbcl-ism in code/conditions.lisp", but then reading in src/cold/shared.lisp the description of :no-host -- which says: ;; meaning: This file is not to be compiled when building the ;; cross-compiler which runs on the host ANSI Lisp. ("not host ;; code", i.e. does not execute on host -- but may still be ;; cross-compiled by the host, so that it executes on the target) Does "may be still be cross-compiled by the host" mean that the source file is compiled a) by the host's compile-file, or b) by the cross-compiler running on the host? If b), does this mean that sbcl-ism can be used within a source file flagged with :no-host? If the explicit slot-value doesn't work (or you think it's inappropriate doing so regardless of whether it works), can you think of a good name for the slot, now? :-) -T. |