Vladimir Sedach [Mon, 8 Jun 2009 05:30:52 +0000 (23:30 -0600)]
Changed destructuring-bind to use let* instead of let in its
macroexpansion.
Bug report due to Scott
Bell. http://common-lisp.net/pipermail/parenscript-devel/2009-June/000532.html
Vladimir Sedach [Mon, 8 Jun 2009 05:27:47 +0000 (23:27 -0600)]
Fixed several special forms that were not macroexpanding their
arguments.
Bug reports thanks to Scott
Bell. http://common-lisp.net/pipermail/parenscript-devel/2009-June/000530.html
Vladimir Sedach [Mon, 8 Jun 2009 04:52:58 +0000 (22:52 -0600)]
Introduced 'function' special form to further help with faking Lisp2
in JavaScript.
Previously, 'apply,' among others, did not recognize the second
namespace as introduced by flet/labels. Thanks to Scott Bell for the
bug report:
http://common-lisp.net/pipermail/parenscript-devel/2009-June/000529.html
Vladimir Sedach [Mon, 8 Jun 2009 04:35:05 +0000 (22:35 -0600)]
Fixed 'flatten' to correctly handle lists with non-nil cdr (ie '(1 . 2)).
Thanks to Scott Bell for the bug report.
http://common-lisp.net/pipermail/parenscript-devel/2009-June/000528.html
Vladimir Sedach [Mon, 25 May 2009 00:53:03 +0000 (18:53 -0600)]
Changed process-html-forms-lhtml loop in lib/ps-html.lisp from 'loop'
to 'do' due to bug in CLISP's 'loop' implementation (this also made
the code shorter).
Thanks to Olaf Ruppert <oruppert@googlemail.com> for the bug report.
Vladimir Sedach [Fri, 15 May 2009 22:04:33 +0000 (16:04 -0600)]
Fixed some special forms that weren't macro-expanding their arguments.
Vladimir Sedach [Fri, 15 May 2009 00:38:10 +0000 (18:38 -0600)]
let/let* no longer gensym variable names when they are not bound in
enclosing lexical scopes, resulting in prettier output ("var x = 1",
instead of "var x1 = 1") in typical usage of let.
Vladimir Sedach [Sun, 10 May 2009 17:39:02 +0000 (11:39 -0600)]
Made compiled-form-to-string use write-string instead of printc, which
results in a much more efficient ps*.
Daniel Gackle [Fri, 8 May 2009 21:13:18 +0000 (15:13 -0600)]
Added support for supplied-p parameters to optional and keyword arguments.
Daniel Gackle [Fri, 8 May 2009 20:59:05 +0000 (14:59 -0600)]
Extended DESTRUCTURING-BIND to allow NIL bindings to indicate a place should be ignored, the way that CL LOOP does.
Vladimir Sedach [Sat, 9 May 2009 23:24:22 +0000 (17:24 -0600)]
Substantially modified the way Parenscript compilation and
macro-expansion take place. This gives control of macroexpansion to
special forms, and lets Parenscript do things like fake being a Lisp2
(different function and variable namespaces), and overall makes
Parenscript compilation look a lot more like CL compilation.
Vladimir Sedach [Sat, 9 May 2009 04:54:07 +0000 (22:54 -0600)]
Fixed bug where macrolet and symbol-macrolet special forms were always
compiling their implicit progn bodies to statements.
Vladimir Sedach [Sun, 3 May 2009 21:31:16 +0000 (15:31 -0600)]
Reimplemented flet and labels to use the same renaming tricks as the
let/let* patch to correctly implement lexical scoping.
Vladimir Sedach [Sun, 3 May 2009 20:42:12 +0000 (14:42 -0600)]
Implemented LET and LET* by variable renaming, which provides the
correct scoping semantics, and simplifies both the producing and the
produced code.
Removed the "." and "[]" name-mangling conventions from
symbol-to-js-string. Any code that uses symbols such as "foo.bar[baz]"
will now issue a warning, and needs to be rewritten to use standard
Lisp accessors. This is needed for variable renaming to work, and is
an extension of the patch that eliminated the ".method" method-calling
convention.
Thanks to Daniel Gackle and Dough Hoyte for opening my eyes to this
technique, which was right in front of me all along.
Vladimir Sedach [Sun, 3 May 2009 17:01:20 +0000 (11:01 -0600)]
Removed unused function val-to-string from utils.lisp
Vladimir Sedach [Wed, 29 Apr 2009 06:20:48 +0000 (00:20 -0600)]
Added file compilation and eval-when facilities (patch from Red Daly).
Vladimir Sedach [Wed, 29 Apr 2009 02:17:34 +0000 (20:17 -0600)]
Fixed bug with incorrectly parenthesized if expressions.
Thanks to Daniel Gackle for the bug report.
Vladimir Sedach [Wed, 29 Apr 2009 01:22:36 +0000 (19:22 -0600)]
Fixed non-uniform handling of quoted symbols that manifested itself in
broken package obfuscation.
Thanks to Red Daly for the bug report.
Vladimir Sedach [Mon, 27 Apr 2009 21:52:55 +0000 (15:52 -0600)]
Fixed bug in keyword argument handling (patch thanks to Red Daly).
Kelly McDonald [Wed, 22 Apr 2009 18:38:14 +0000 (14:38 -0400)]
method trick was yanked in
79630c82ac03066ceb1dac50015eb6b7a2151bbe but the documentation makes it look as if you can still do this.
A further note with something about a backwards incompatible change
might also be useful
Vladimir Sedach [Mon, 20 Apr 2009 03:24:23 +0000 (21:24 -0600)]
Fixed typo in ps-macro-lib.lisp
Vladimir Sedach [Tue, 14 Apr 2009 01:43:15 +0000 (19:43 -0600)]
Added the colon character (:) to the list of special characters that have special translations in symbol-to-js-string.
Vladimir Sedach [Mon, 13 Apr 2009 21:31:07 +0000 (15:31 -0600)]
Introduced the *js-target-version* special variable, which is designed
to control which version of JavaScript Parenscript is emitting code
for. This can be used to emit shorter code for certain constructs
(this patch uses this facility to generate shorter keyword-handling
code for JS version 1.6 and later).
Vladimir Sedach [Mon, 13 Apr 2009 20:05:10 +0000 (14:05 -0600)]
Got rid of 'ensure-ps-symbol' internal function (at this point all it was doing was polluting the PS package).
Daniel Gackle [Sun, 12 Apr 2009 19:49:41 +0000 (12:49 -0700)]
Added destructuring lists to PS-LOOP.
Vladimir Sedach [Mon, 13 Apr 2009 04:35:15 +0000 (22:35 -0600)]
Removed some unnecessary code that ignored an anaphor in define-ps-special-form (declare (ignorable sufficed.
Vladimir Sedach [Mon, 13 Apr 2009 04:33:29 +0000 (22:33 -0600)]
Changed representation of expression blocks and 'if' to look more like JS in intermediate code.
Vladimir Sedach [Sun, 12 Apr 2009 23:17:31 +0000 (17:17 -0600)]
Merge branch 'master' of ssh://vsedach@common-lisp.net/project/parenscript/public_html/git/parenscript
Vladimir Sedach [Sun, 12 Apr 2009 23:16:12 +0000 (17:16 -0600)]
Removed 'append' from runtime lib since Daniel Gackle provided a more concise macro version in
83a26b36c.
Daniel Gackle [Sun, 12 Apr 2009 06:51:27 +0000 (23:51 -0700)]
Added a file PS-DOM with handy utility macros for DOM functionality, e.g. Lispy ways of accessing offsetWidth, offsetHeight, etc.
Daniel Gackle [Sun, 12 Apr 2009 06:15:41 +0000 (23:15 -0700)]
Added several new utility macros, including a primitive DESTRUCTURING-BIND.
Daniel Gackle [Sun, 12 Apr 2009 05:12:51 +0000 (22:12 -0700)]
Modified the way the PS-LOOP does SUM (it now gensyms an accumulation var rather than accepting INTO) and added COLLECT to work the same way.
Daniel Gackle [Sun, 12 Apr 2009 05:11:55 +0000 (22:11 -0700)]
Added a macro WITH-LAMBDA that's useful for wrapping one or more statements up into an expression.
Vladimir Sedach [Sun, 12 Apr 2009 02:25:18 +0000 (20:25 -0600)]
Updated tests to reflect changes in latest patches from Daniel Gackle.
Vladimir Sedach [Sun, 12 Apr 2009 01:57:19 +0000 (19:57 -0600)]
Fixed 'lisp' form to produce code that captures enclosing lexical scope correctly in 'ps' macro (broke it in my previous patch
0ce67a33), added unit tests to check for expansion in correct environment.
Vladimir Sedach [Sun, 12 Apr 2009 01:56:46 +0000 (19:56 -0600)]
Exported 'loop' from Parenscript package, moved utility functions to src/utils.lisp.
Vladimir Sedach [Sun, 12 Apr 2009 02:25:18 +0000 (20:25 -0600)]
Updated tests to reflect changes in latest patches from Daniel Gackle.
Vladimir Sedach [Sun, 12 Apr 2009 01:57:19 +0000 (19:57 -0600)]
Fixed 'lisp' form to produce code that captures enclosing lexical scope correctly in 'ps' macro (broke it in my previous patch
0ce67a33), added unit tests to check for expansion in correct environment.
Vladimir Sedach [Sun, 12 Apr 2009 01:56:46 +0000 (19:56 -0600)]
Exported 'loop' from Parenscript package, moved utility functions to src/utils.lisp.
Daniel Gackle [Sat, 11 Apr 2009 22:55:05 +0000 (15:55 -0700)]
Restored the old psmacro for LISP evaluation, because the new special form wasn't working.
Daniel Gackle [Sat, 11 Apr 2009 22:51:29 +0000 (15:51 -0700)]
When turning a quoted list into a JS array, compile elements that are NIL as "null", not "[]". There is no way to make JS completely consistent with Lisp here, because NIL means two different things in JS (null or an empty list) where it means only one thing in Lisp. We have to pick one thing in this context, and "[null]" is more common than "[[]]".
Daniel Gackle [Sat, 11 Apr 2009 22:48:02 +0000 (15:48 -0700)]
Quoted symbols should be emitted as literal strings, not converted first to JS symbols, otherwise symbols with characters like * and ? will be emitted as "star" and "what", which makes sense only if you're trying to define a function or variable name, but not if you're generating arbitrary strings.
Daniel Gackle [Sat, 11 Apr 2009 22:47:17 +0000 (15:47 -0700)]
Generate "[]" rather than "new Array()" for concision.
Daniel Gackle [Sat, 11 Apr 2009 22:40:30 +0000 (15:40 -0700)]
Changed PS-LOOP to emit DO* (i.e. normal JS for-loop code) rather than DO. It was originally written when DO meant DO* (in today's terms). Using DO here makes the generated code slower and breaks a bunch of our existing cases. Also, DO* produces more idiomatic JS code and should be the default case (there is unfortunately no single default here that gives all the desired behavior, but this is a better tradeoff).
Daniel Gackle [Sat, 11 Apr 2009 22:39:31 +0000 (15:39 -0700)]
Use WITH-OUTPUT-TO-STRING instead of CONCATENATE, because the latter fails when there are too many arguments (this happens in Clozure more often than SBCL).
Vladimir Sedach [Tue, 7 Apr 2009 02:46:19 +0000 (20:46 -0600)]
Modified the PS compiler to produce an intermediate representation that looks like raw JavaScript in s-exp notation.
Removed the doeach macro.
Vladimir Sedach [Mon, 6 Apr 2009 00:16:17 +0000 (18:16 -0600)]
Changed tests to reflect Daniel Gackle's keyword arguments patch.
Daniel Gackle [Thu, 2 Apr 2009 22:05:28 +0000 (15:05 -0700)]
Initialize keyword arguments from js ARGUMENTS, allowing keywords to also be passed as normal function arguments without an error being thrown.
Daniel Gackle [Thu, 2 Apr 2009 04:01:03 +0000 (21:01 -0700)]
Added a partial implementation of LOOP to PS.
Vladimir Sedach [Sun, 5 Apr 2009 23:50:15 +0000 (17:50 -0600)]
Made the ignore declaration in define-ps-special-form be generated on the condition that 'expecting is used in the body. While it's not an error to use variables previously declared ignored, it does raise annoying compiler warnings in some Lisps.
Vladimir Sedach [Sat, 4 Apr 2009 22:39:15 +0000 (16:39 -0600)]
Removed compile-time constant string concatenation from the Parenscript printer, which was significantly slowing down compilation.
Vladimir Sedach [Tue, 31 Mar 2009 19:36:32 +0000 (13:36 -0600)]
Changed the definition of define-ps-special-form to make "expecting" an anaphor.
Vladimir Sedach [Tue, 31 Mar 2009 00:42:31 +0000 (18:42 -0600)]
Changed the implementation of quote from being special cased in several Parenscript internal functions to a Parenscript macro. This makes the code simpler and allows for extensibility of how quoted forms are translated. One example is quoted strings being translated to JavaScript array literals.
Vladimir Sedach [Thu, 12 Mar 2009 08:07:39 +0000 (02:07 -0600)]
Renamed *html-empty-tag-aware-p* to *ps-html-empty-tag-aware-p* and *html-mode* to *ps-html-mode* to not clash with CL-WHO symbols, but still follow the same naming convention.
Vladimir Sedach [Thu, 12 Mar 2009 08:04:06 +0000 (02:04 -0600)]
Removed tutorial.lisp from repository (it is now updated and placed online in HTML format: common-lisp.net/project/parenscript/tutorial.html)
Vladimir Sedach [Fri, 6 Mar 2009 04:38:08 +0000 (21:38 -0700)]
Changed ps-html generators to behave more like CL-WHO when it comes to XML/SGML, self-closing/empty tags. Changed the name of *self-closing-tags-p* flag to *html-empty-tag-aware-p*, added *html-mode* parameter.
Vladimir Sedach [Fri, 6 Mar 2009 04:37:00 +0000 (21:37 -0700)]
Regenerated reference-tests.lisp from reference doc with latest changes.
Vladimir Sedach [Fri, 6 Mar 2009 03:09:54 +0000 (20:09 -0700)]
Rewrote some unit tests to simplify code.
Vladimir Sedach [Fri, 6 Mar 2009 03:09:21 +0000 (20:09 -0700)]
Added ps-doc* function to PS compilation interface.
Vladimir Sedach [Fri, 6 Mar 2009 03:08:00 +0000 (20:08 -0700)]
Added example of closure symbol-map usage for obfuscate-package in reference doc.
Vladimir Sedach [Fri, 6 Mar 2009 03:05:29 +0000 (20:05 -0700)]
Removed literal backspace character from the JS escape sequence part of the reference doc since it caused an error when generating PDFs.
Vladimir Sedach [Sat, 28 Feb 2009 19:39:06 +0000 (12:39 -0700)]
Added note about printing special characters to escape sequences to the reference.
Vladimir Sedach [Mon, 23 Feb 2009 09:34:35 +0000 (02:34 -0700)]
Added all symbols from DOM levels 1 and 2, Window working draft to the
DOM symbol export convenience packages (used with obfuscation). Moved
non-standard DOM symbols to their own package. Removed the Prototype
symbol export convenience package.
Vladimir Sedach [Fri, 20 Feb 2009 23:47:08 +0000 (16:47 -0700)]
Fixed the 'pi' symbol-macro.
Vladimir Sedach [Tue, 10 Feb 2009 00:01:55 +0000 (17:01 -0700)]
Introduced the "funcall" macro (which really doesn't do anything - only CL needs it because of the weird way it treats form evaluation).
Vladimir Sedach [Mon, 9 Feb 2009 23:44:41 +0000 (16:44 -0700)]
Updated js-expander to work with the latest CVS version of SLIME.
Vladimir Sedach [Sun, 8 Feb 2009 08:13:11 +0000 (01:13 -0700)]
Added 'reduce' function to runtime lib.
Vladimir Sedach [Sun, 8 Feb 2009 07:24:17 +0000 (00:24 -0700)]
Fixed a bug where variable initializations inside for loops were being compiled as statements instead of expressions.
Vladimir Sedach [Sat, 7 Feb 2009 05:02:19 +0000 (22:02 -0700)]
Implemented 'flet' and 'labels' as PS macros.
Vladimir Sedach [Fri, 6 Feb 2009 02:02:03 +0000 (19:02 -0700)]
Made who-ps-html handle multiple html forms correctly (ie - things like (:ul (:li) (:li))).
Vladimir Sedach [Tue, 3 Feb 2009 01:14:32 +0000 (18:14 -0700)]
Changed let to not introduce any extra variables (for parallel
binding) when only one variable is being bound.
Vladimir Sedach [Mon, 2 Feb 2009 21:14:21 +0000 (14:14 -0700)]
Got rid of the "(.method-name object args)" method-calling
convention. It breaks package prefixing/obfuscation, and while
sometimes a handy shortcut it obscures how method calls are really
done, and introduces a redundant way of doing them which complicates
code-walkers and (future) attempts at Parenscript compiler
open-implementation facilities.
Vladimir Sedach [Mon, 2 Feb 2009 20:27:00 +0000 (13:27 -0700)]
Changed the @ (slot-value composition macro) not to do the dollar sign
thing if the first argument is a string ('$' is a Prototype library
function), and not to do spurious macroexpansion.
Vladimir Sedach [Mon, 2 Feb 2009 07:31:52 +0000 (00:31 -0700)]
Defined ps-inline as a PS macro in addition to a CL macro.
Vladimir Sedach [Mon, 2 Feb 2009 06:15:41 +0000 (23:15 -0700)]
Fixed bug where expressions could not be applied correctly (ex - ((or a b) c) did not compile to "(a||b)(c)").
Vladimir Sedach [Sun, 1 Feb 2009 07:18:34 +0000 (00:18 -0700)]
Modified the Parenscript macro facilities so that defpsmacro and
define-ps-symbol-macro define their macros in their lexical
environment (previously they were always defining in the null lexical
environment).
This cleared up the implementation of the macro facilities, and now
defmacro and define-symbol-macro explicitly define macros in the null
lexical environment inside Parenscript code (the behavior is unchanged
and the only one that makes sense since Parenscript code is translated
and not evaluated, but previously this was not obvious from looking at
the implementation).
Vladimir Sedach [Wed, 28 Jan 2009 20:13:54 +0000 (13:13 -0700)]
Added Daniel Gackle and William Halliburton to the list of contributors.
Vladimir Sedach [Wed, 28 Jan 2009 20:07:09 +0000 (13:07 -0700)]
Added symbol-to-js to the deprecated interface since it was used in several 3rd party libraries (despite not being exported).
Vladimir Sedach [Thu, 22 Jan 2009 05:14:15 +0000 (22:14 -0700)]
Made the ps-html macros generate self-closing tags.
Vladimir Sedach [Mon, 19 Jan 2009 19:48:39 +0000 (12:48 -0700)]
Made the package symbol obfuscator be able to take closures, for more interesting obfuscation possibilities (ex: using various Unicode characters).
Vladimir Sedach [Mon, 19 Jan 2009 19:47:02 +0000 (12:47 -0700)]
Added convenience packages that export JS and browser DOM symbols, to be used to make package obfuscation work.
Vladimir Sedach [Tue, 30 Dec 2008 21:13:50 +0000 (14:13 -0700)]
Changed the capitalization of "ParenScript" to "Parenscript" in the reference.
Vladimir Sedach [Tue, 30 Dec 2008 21:11:47 +0000 (14:11 -0700)]
Modified the printer so that PS and PS-INLINE compile and print
Parenscript code at macro-expansion time. Renamed COMPILE-SCRIPT to
PS1* and got rid of its output-stream argument.
Vladimir Sedach [Tue, 30 Dec 2008 21:10:47 +0000 (14:10 -0700)]
Added an implementation of 'elt' to ps-macro-lib.
Vladimir Sedach [Tue, 30 Dec 2008 20:48:25 +0000 (13:48 -0700)]
Added a "runtime" directory for runtime libs and moved ps-runtime-lib there.
Vladimir Sedach [Sat, 13 Dec 2008 01:27:47 +0000 (18:27 -0700)]
Fixed content handling in ps-who-html.
Vladimir Sedach [Mon, 8 Dec 2008 02:40:57 +0000 (19:40 -0700)]
Added Daniel Gackle <danielgackle@gmail.com>'s contributed [] (nested) array literal macro to the macro library.
Vladimir Sedach [Sun, 7 Dec 2008 22:48:17 +0000 (15:48 -0700)]
Changed extras/js-expander.el to work with the latest CVS snapshot of SLIME.
Vladimir Sedach [Sun, 7 Dec 2008 22:12:12 +0000 (15:12 -0700)]
Added William Halliburton <whalliburton@gmail.com>'s tracing macro to extras folder.
Vladimir Sedach [Sun, 7 Dec 2008 20:50:36 +0000 (13:50 -0700)]
Made operator precedence handling not throw away symbol package information.
This fixed a bug where for example (ps (#:new)) => ";" instead of "new();".
Vladimir Sedach [Sat, 6 Dec 2008 07:17:27 +0000 (00:17 -0700)]
Added a few more unit tests related to fixes in previous patches.
Vladimir Sedach [Sat, 6 Dec 2008 05:20:44 +0000 (22:20 -0700)]
Fixed compilation of caller argument lists. Changed the handling of keyword symbols in the process. Now they are no longer output as JavaScript variables, but as strings. The former behavior was a hack introduced to get around some (in hindsight) deficient macrology in an application that used Parenscript, while the latter behavior is more CL-like in that it compiles a self-evaluating object to a self-evaluating object. Thanks to Daniel Gackle for the suggestion on the treatment of keywords.
Vladimir Sedach [Fri, 5 Dec 2008 21:23:04 +0000 (14:23 -0700)]
Got rid of parenscript-symbol object; special forms and macros are now
regular Common Lisp symbols so that the package system works as
expected.
Vladimir Sedach [Thu, 4 Dec 2008 06:35:10 +0000 (23:35 -0700)]
Exported concat-string CL/PS utility function/macro.
Vladimir Sedach [Thu, 4 Dec 2008 06:34:26 +0000 (23:34 -0700)]
Fixed unterminating recursion in who-ps-html when element has attributes but no content.
Vladimir Sedach [Thu, 4 Dec 2008 05:50:17 +0000 (22:50 -0700)]
Renamed symbol-to-js to symbol-to-js-string and exported it.
Vladimir Sedach [Thu, 4 Dec 2008 05:49:19 +0000 (22:49 -0700)]
Corrected reference doc to explain 'var' special form as 'global variable' instead of 'function variable.'
Vladimir Sedach [Wed, 26 Nov 2008 05:50:18 +0000 (22:50 -0700)]
Implemented who-ps-html, which is like the ps-html macro but taking CL-WHO like syntax. Changed the behavior of ps-html to preserve the case of tag and attribute symbols when printing.
Vladimir Sedach [Mon, 17 Nov 2008 20:54:50 +0000 (13:54 -0700)]
Added a bunch of unit tests from recent bug reports.
Travis Cross [Sat, 15 Nov 2008 19:28:52 +0000 (19:28 +0000)]
Overhauled operator precedence handling.
In particular the changes here cleaned up unary operator handling,
which was badly broken.