Improved handling of declarations.
commit8d7e8fa1ce2e1a3115776af2ffc703d368171ef0
authorBoris Smilga <boris.smilga@gmail.com>
Thu, 25 Dec 2014 19:35:44 +0000 (25 22:35 +0300)
committerBoris Smilga <boris.smilga@gmail.com>
Thu, 25 Dec 2014 20:39:27 +0000 (25 23:39 +0300)
tree12fe54287df01538986dc23738c014030cb20ddf
parent379b33ad96fb3993319e9e1f9cf0b2de65a1f3c7
Improved handling of declarations.

1. Named function bodies in Common Lisp may contain multiple DECLARE
   forms before or after the docstring (or even before *and* after).
   This feature is important for meta-programming by macros, and so
   PS should also support it.

2. Declarations should be allowed in PS forms whose Lisp namesakes
   allow them, to wit: in the macros WITH-SLOTS, MULTIPLE-VALUE-BIND,
   DO*, DO, DOTIMES, DOLIST, DESTRUCTURING-BIND, LET*, DEFUN,
   DEFSETF, and in the special forms LET, FLET, LABELS (letting out
   DEFMACRO, MACROLET, SYMBOL-MACROLET  who are not translated to
   JavaScript). Before the present commit, most of them didn't
   handle declarations correctly.

3. Individual DECLARE forms should be allowed to contain multiple
   declaration specifiers, in particular, multiple SPECIAL specifiers.
   WITH-DECLARATION-EFFECTS used to ignore SPECIALs after the first
   one.

4. This commit also introduces LOCALLY as PS form because it
   simplifies the implementation of stuff from (2).
src/function-definition.lisp
src/macros.lisp
src/special-operators.lisp
t/output-tests.lisp