[parenscript-devel] Warning about usage of reserved words as variable names

Viktor Leis viktor.leis at googlemail.com
Thu Jul 12 15:18:46 UTC 2007


Hi,

here is a piece of code that warns when a reserved keyword is used as a
variable name. This is nice time saver for me, since IE refuses to run such
code. Perhaps it could be included in a nicer way.

Bye

Viktor


(defmethod initialize-instance :after ((var js-variable) &rest initargs)
  (declare (ignore initargs))
  (when (find (slot-value var 'value) '(abstract else instanceof switch
boolean enum int synchronized break export interface this byte extends long
throw case native throws catch final new transient char finally float
package try const for private typeof continue function protected var
debugger goto public void default if return volatile delete implements short
while do import static with double in super class) :test #'string-equal)
    (warn "~a is a reserved word and should not be used as a variable"
(slot-value var 'value))))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/parenscript-devel/attachments/20070712/a9de3573/attachment.html>


More information about the parenscript-devel mailing list