11 years agos/js:funcall/js::funcall/ statement-expression-rework
Clinton Ebadi [Tue, 8 Dec 2009 18:37:55 +0000 (13:37 -0500)]

12 years agoRemove `labels' in favor of `letrec'
Clinton Ebadi [Thu, 8 Oct 2009 19:31:57 +0000 (15:31 -0400)]
Remove `labels' in favor of `letrec'
This is more general and is a better name given that Javascript does
not have separate value/function namespaces

12 years agoLisp-2 removal (part one)
Clinton Ebadi [Thu, 8 Oct 2009 19:23:15 +0000 (15:23 -0400)]
Lisp-2 removal (part one)
* Remove `flet', `function', and `funcall' special forms/macros
* `js::funcall' is kept because it makes the AST a bit easier to work
  with, but this is for internal use only

12 years agoLexical renaming rework (part one and a half)
Clinton Ebadi [Thu, 8 Oct 2009 19:11:17 +0000 (15:11 -0400)]
Lexical renaming rework (part one and a half)
* Properly expand `let' inside of an expression
* Do not introduce new `js:block' when compiling statements

12 years agoMove lexical binding renaming to JS:VARIABLE printer (part one)
Clinton Ebadi [Thu, 8 Oct 2009 18:11:16 +0000 (14:11 -0400)]
Move lexical binding renaming to JS:VARIABLE printer (part one)
This moves lexical binding renaming into the printer for
`js:variable' (where it belongs -- using symbol-macros for this makes
the compiler a lot messier than it need be). Right now a new block is
unnecessarily introduced for every `let' expression.

* Rewrite `let' special form
* Enclose variable name in `js:variable' when expanding `var' special
* Maintain lexical binding stack in printer for `js:let'
* Perform renaming for all `js:variable' forms at print time

12 years agoremove debugging cruft
Clinton Ebadi [Tue, 6 Oct 2009 22:00:51 +0000 (18:00 -0400)]
remove debugging cruft

12 years agoExpand compound symbol (warning: very lightly tested)
Clinton Ebadi [Tue, 6 Oct 2009 18:52:41 +0000 (14:52 -0400)]
Expand compound symbol (warning: very lightly tested)
Performs expansion and renaming of compound symbols in
`ps-compile-symbol' and for function names in `(funcall NAME . args)'
forms. This will probably break with other special forms and needs
more testing / possible reimplementation at another level of the

12 years agoInitial compund symbol ( syntax) splitting function
Clinton Ebadi [Tue, 6 Oct 2009 18:49:58 +0000 (14:49 -0400)]
Initial compund symbol ( syntax) splitting function

12 years agoMerge branch 'master' into symbol-syntax
Clinton Ebadi [Tue, 6 Oct 2009 16:39:11 +0000 (12:39 -0400)]
Merge branch 'master' into symbol-syntax

12 years agoFixed bug: dotted lists weren't being destructured properly. master
Daniel Gackle [Tue, 22 Sep 2009 05:29:31 +0000 (23:29 -0600)]
Fixed bug: dotted lists weren't being destructured properly.

12 years agoFixed a bug in PS LOOP: the :INITIALLY and :FINALLY clauses should execute whether...
Daniel Gackle [Tue, 22 Sep 2009 00:20:50 +0000 (18:20 -0600)]
Fixed a bug in PS LOOP: the :INITIALLY and :FINALLY clauses should execute whether or not the loop body is executed.

12 years agoReimplement (.method object . args) syntax
Clinton Ebadi [Thu, 17 Sep 2009 23:59:06 +0000 (19:59 -0400)]
Reimplement (.method object . args) syntax
Using PS:FUNCALL, PS:CHAIN, or ((PS:SLOT-VALUE ...) ...) for method
invocation is rather unwieldy for something so common in
javascript. This reenables the convenient (.method ...) call syntax in
a way that seems reasonably clean.

This may have subtle issues with the lexical-let variable renamer and
such, but my cursory skimming of the new compiler source doesn't seem
to indicate any serious issues.

12 years agoAdded &OPTIONAL to DESTRUCTURING-BIND. Currently it's just ignored (next step woudl... origin/HEAD origin/master
Daniel Gackle [Thu, 17 Sep 2009 23:47:52 +0000 (17:47 -0600)]
Added &OPTIONAL to DESTRUCTURING-BIND. Currently it's just ignored (next step woudl be to support default values).

12 years agoDESTRUCTURING-BIND now supports &REST.
Daniel Gackle [Tue, 15 Sep 2009 17:54:59 +0000 (11:54 -0600)]

12 years agoFixed symbol macro bug (thanks to Daniel Gackle for the bug report).
Vladimir Sedach [Thu, 17 Sep 2009 18:18:51 +0000 (12:18 -0600)]
Fixed symbol macro bug (thanks to Daniel Gackle for the bug report).

12 years agoReplaced redundant string functions in utils.lisp with
Vladimir Sedach [Mon, 14 Sep 2009 18:12:00 +0000 (12:12 -0600)]
Replaced redundant string functions in utils.lisp with
standard/library ones.

12 years agoFixed the CHAIN macro to correctly chain plain slot values.
Vladimir Sedach [Sun, 13 Sep 2009 22:19:11 +0000 (16:19 -0600)]
Fixed the CHAIN macro to correctly chain plain slot values.

Thanks to Daniel White <> for the patch.

12 years agoChanged op-precedence back to a memoized table (performance tweaks).
Vladimir Sedach [Sun, 13 Sep 2009 22:04:53 +0000 (16:04 -0600)]
Changed op-precedence back to a memoized table (performance tweaks).

12 years agoMemoized SYMBOL-NAME-TO-JS-STRING (performance improvement).
Vladimir Sedach [Sun, 13 Sep 2009 21:49:27 +0000 (15:49 -0600)]
Memoized SYMBOL-NAME-TO-JS-STRING (performance improvement).

12 years agoAdded symbolp check before the use of lookup-macro-def in
Vladimir Sedach [Fri, 11 Sep 2009 19:21:57 +0000 (13:21 -0600)]
Added symbolp check before the use of lookup-macro-def in
ps-macroexpand (more low-hanging performance fruit).

12 years agoRefactored SYMBOL-NAME-TO-JS-STRING.
Vladimir Sedach [Fri, 11 Sep 2009 19:13:35 +0000 (13:13 -0600)]

12 years agoChanged printing subsystem interface to allow direct output to
Vladimir Sedach [Fri, 11 Sep 2009 18:56:40 +0000 (12:56 -0600)]
Changed printing subsystem interface to allow direct output to
streams. Added 'ps-to-stream' function.

12 years agoRefactored compile-parenscript-form code.
Vladimir Sedach [Fri, 11 Sep 2009 16:58:11 +0000 (10:58 -0600)]
Refactored compile-parenscript-form code.

12 years agoRefactored ps-compiler method name for symbols.
Vladimir Sedach [Fri, 11 Sep 2009 09:37:03 +0000 (03:37 -0600)]
Refactored ps-compiler method name for symbols.

12 years agoFactored out duplication between simple and parallel loops.
Daniel Gackle [Wed, 19 Aug 2009 20:34:38 +0000 (13:34 -0700)]
Factored out duplication between simple and parallel loops.

12 years agoCorrecting how parallel loop handles destructuring lists.
Daniel Gackle [Tue, 18 Aug 2009 23:58:31 +0000 (16:58 -0700)]
Correcting how parallel loop handles destructuring lists.

12 years agoSeparated the processing of single and parallel loops.
Daniel Gackle [Tue, 18 Aug 2009 23:22:10 +0000 (16:22 -0700)]
Separated the processing of single and parallel loops.

12 years agoFixed problem with destructuring-lists in multiple-for clauses (they need binding...
Daniel Gackle [Tue, 18 Aug 2009 21:54:41 +0000 (14:54 -0700)]
Fixed problem with destructuring-lists in multiple-for clauses (they need binding before the first execution of the loop). This solution is not optimal, because it creates new bindings for the variable inside the loop, and emits the pre-loop bindings even when they aren't being used.

12 years agoRemoved trailing whitespace.
Daniel Gackle [Sun, 16 Aug 2009 00:24:14 +0000 (17:24 -0700)]
Removed trailing whitespace.

12 years agoEliminated unused local variables that caused compiler warnings in CCL.
Daniel Gackle [Sun, 16 Aug 2009 00:22:36 +0000 (17:22 -0700)]
Eliminated unused local variables that caused compiler warnings in CCL.

12 years agoMade PS LOOP conform to LOOP's semantics regarding parallel FOR clauses. A clause...
Daniel Gackle [Fri, 14 Aug 2009 08:13:09 +0000 (01:13 -0700)]
Made PS LOOP conform to LOOP's semantics regarding parallel FOR clauses. A clause's end-test should take place before the next clause's step form.

12 years agoBroke up loop parsing by pushing local functions to top level and passing a state...
Daniel Gackle [Thu, 13 Aug 2009 20:04:19 +0000 (13:04 -0700)]
Broke up loop parsing by pushing local functions to top level and passing a state object around.

12 years agoFixed a bug where 'create' was special-casing keywords in
Vladimir Sedach [Wed, 12 Aug 2009 21:01:51 +0000 (15:01 -0600)]
Fixed a bug where 'create' was special-casing keywords in
inappropriate ways.

(slot-value (create :foo-bar 1) :foo-bar) was being translated as
({ fooBar : 1 })['foo-bar']

12 years agoMerge branch 'master' of ssh://
Vladimir Sedach [Fri, 7 Aug 2009 04:22:20 +0000 (22:22 -0600)]
Merge branch 'master' of ssh://

12 years agoFixed nary comparison operators (ex: (< 1 2 3) should translate to (1
Vladimir Sedach [Fri, 7 Aug 2009 04:21:11 +0000 (22:21 -0600)]
Fixed nary comparison operators (ex: (< 1 2 3) should translate to (1
< 2) && (2 < 3) instead of 1 < 2 < 3).

12 years agoMade the COUNT clause in PS LOOP evaluate its term before counting (and skip nil)
Daniel Gackle [Wed, 5 Aug 2009 23:51:32 +0000 (17:51 -0600)]
Made the COUNT clause in PS LOOP evaluate its term before counting (and skip nil)
 like CL does.

12 years agoAdded :REPEAT clauses to PS's LOOP.
Daniel Gackle [Fri, 31 Jul 2009 20:20:15 +0000 (14:20 -0600)]
Added :REPEAT clauses to PS's LOOP.

12 years agoExported 'chain' helper macro.
Vladimir Sedach [Sat, 1 Aug 2009 19:15:23 +0000 (13:15 -0600)]
Exported 'chain' helper macro.

12 years agoChanged 'slot-value' to print keyword slot names as strings.
Vladimir Sedach [Mon, 27 Jul 2009 20:10:51 +0000 (14:10 -0600)]
Changed 'slot-value' to print keyword slot names as strings.

12 years agoFixed eval-when special form and added tests to prevent future breakage.
Red Daly [Sun, 26 Jul 2009 20:22:54 +0000 (20:22 +0000)]
Fixed eval-when special form and added tests to prevent future breakage.

12 years agoChanged 'create' and 'slot-value' to treat reserved JS keywords as
Vladimir Sedach [Sat, 25 Jul 2009 22:01:37 +0000 (16:01 -0600)]
Changed 'create' and 'slot-value' to treat reserved JS keywords as

Thanks to Alexey Lebedeff for the idea.

12 years agoRevised PS literal mechanism to use 'symbol-name-to-js-string' instead
Vladimir Sedach [Sat, 25 Jul 2009 21:43:00 +0000 (15:43 -0600)]
Revised PS literal mechanism to use 'symbol-name-to-js-string' instead
of 'symbol-name' to check symbol names for conflicts with reserved JS
keywords. Added list of currently reserved JS keyword names.

12 years agoPS LOOP now supports ON.
Daniel Gackle [Sat, 11 Jul 2009 01:17:39 +0000 (19:17 -0600)]
PS LOOP now supports ON.

12 years agoDESTRUCTURING-BIND can now handle dotted and nested binding lists.
Daniel Gackle [Fri, 10 Jul 2009 22:31:55 +0000 (16:31 -0600)]
DESTRUCTURING-BIND can now handle dotted and nested binding lists.

12 years agoAdded support for COUNT, MINIMIZE and MAXIMIZE to PS-LOOP.
Daniel Gackle [Wed, 1 Jul 2009 01:52:12 +0000 (19:52 -0600)]
Added support for COUNT, MINIMIZE and MAXIMIZE to PS-LOOP.

12 years agoExtended PS-LOOP to allow explicit accumulation variables (declared by INTO as in...
Daniel Gackle [Wed, 1 Jul 2009 01:29:44 +0000 (19:29 -0600)]
Extended PS-LOOP to allow explicit accumulation variables (declared by INTO as in "sum x into y").

12 years agoRewrote 'ps' macro to expand into 'with-output-to-string' instead of
Vladimir Sedach [Mon, 6 Jul 2009 20:13:15 +0000 (14:13 -0600)]
Rewrote 'ps' macro to expand into 'with-output-to-string' instead of
'concatenate,' which gives better runtime performance.

12 years agoAdded the 'chain' convenience macro for method call chaining (ex:
Vladimir Sedach [Thu, 18 Jun 2009 23:11:56 +0000 (17:11 -0600)]
Added the 'chain' convenience macro for method call chaining (ex:
(chain ($ "foo") (bar x z) (baz 5)) => $('foo').bar(x, z).baz(5);)

12 years agoChanged destructuring-bind to use let* instead of let in its
Vladimir Sedach [Mon, 8 Jun 2009 05:30:52 +0000 (23:30 -0600)]
Changed destructuring-bind to use let* instead of let in its

Bug report due to Scott

12 years agoFixed several special forms that were not macroexpanding their
Vladimir Sedach [Mon, 8 Jun 2009 05:27:47 +0000 (23:27 -0600)]
Fixed several special forms that were not macroexpanding their

Bug reports thanks to Scott

12 years agoIntroduced 'function' special form to further help with faking Lisp2
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:

12 years agoFixed 'flatten' to correctly handle lists with non-nil cdr (ie '(1 . 2)).
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.

12 years agoChanged process-html-forms-lhtml loop in lib/ps-html.lisp from 'loop'
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 <> for the bug report.

12 years agoFixed some special forms that weren't macro-expanding their arguments.
Vladimir Sedach [Fri, 15 May 2009 22:04:33 +0000 (16:04 -0600)]
Fixed some special forms that weren't macro-expanding their arguments.

12 years agolet/let* no longer gensym variable names when they are not bound in
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.

12 years agoMade compiled-form-to-string use write-string instead of printc, which
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*.

12 years agoAdded support for supplied-p parameters to optional and keyword arguments.
Daniel Gackle [Fri, 8 May 2009 21:13:18 +0000 (15:13 -0600)]
Added support for supplied-p parameters to optional and keyword arguments.

12 years agoExtended DESTRUCTURING-BIND to allow NIL bindings to indicate a place should be ignor...
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.

12 years agoSubstantially modified the way Parenscript compilation and
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.

12 years agoFixed bug where macrolet and symbol-macrolet special forms were always
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.

12 years agoReimplemented flet and labels to use the same renaming tricks as the
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.

12 years agoImplemented LET and LET* by variable renaming, which provides the
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 "[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

Thanks to Daniel Gackle and Dough Hoyte for opening my eyes to this
technique, which was right in front of me all along.

12 years agoRemoved unused function val-to-string from utils.lisp
Vladimir Sedach [Sun, 3 May 2009 17:01:20 +0000 (11:01 -0600)]
Removed unused function val-to-string from utils.lisp

12 years agoAdded file compilation and eval-when facilities (patch from Red Daly).
Vladimir Sedach [Wed, 29 Apr 2009 06:20:48 +0000 (00:20 -0600)]
Added file compilation and eval-when facilities (patch from Red Daly).

12 years agoFixed bug with incorrectly parenthesized if expressions.
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.

12 years agoFixed non-uniform handling of quoted symbols that manifested itself in
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.

12 years agoFixed bug in keyword argument handling (patch thanks to Red Daly).
Vladimir Sedach [Mon, 27 Apr 2009 21:52:55 +0000 (15:52 -0600)]
Fixed bug in keyword argument handling (patch thanks to Red Daly).

12 years agomethod trick was yanked in 79630c82ac03066ceb1dac50015eb6b7a2151bbe but the documenta...
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

12 years agoFixed typo in ps-macro-lib.lisp
Vladimir Sedach [Mon, 20 Apr 2009 03:24:23 +0000 (21:24 -0600)]
Fixed typo in ps-macro-lib.lisp

12 years agoAdded the colon character (:) to the list of special characters that have special...
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.

12 years agoIntroduced the *js-target-version* special variable, which is designed
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).

12 years agoGot rid of 'ensure-ps-symbol' internal function (at this point all it was doing was...
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).

12 years agoAdded destructuring lists to PS-LOOP.
Daniel Gackle [Sun, 12 Apr 2009 19:49:41 +0000 (12:49 -0700)]
Added destructuring lists to PS-LOOP.

12 years agoRemoved some unnecessary code that ignored an anaphor in define-ps-special-form ...
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.

12 years agoChanged representation of expression blocks and 'if' to look more like JS in intermed...
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.

12 years agoMerge branch 'master' of ssh://
Vladimir Sedach [Sun, 12 Apr 2009 23:17:31 +0000 (17:17 -0600)]
Merge branch 'master' of ssh://

12 years agoRemoved 'append' from runtime lib since Daniel Gackle provided a more concise macro...
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.

12 years agoAdded a file PS-DOM with handy utility macros for DOM functionality, e.g. Lispy ways...
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.

12 years agoAdded several new utility macros, including a primitive DESTRUCTURING-BIND.
Daniel Gackle [Sun, 12 Apr 2009 06:15:41 +0000 (23:15 -0700)]
Added several new utility macros, including a primitive DESTRUCTURING-BIND.

12 years agoModified the way the PS-LOOP does SUM (it now gensyms an accumulation var rather...
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.

12 years agoAdded a macro WITH-LAMBDA that's useful for wrapping one or more statements up into...
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.

12 years agoUpdated tests to reflect changes in latest patches from Daniel Gackle.
Vladimir Sedach [Sun, 12 Apr 2009 02:25:18 +0000 (20:25 -0600)]
Updated tests to reflect changes in latest patches from Daniel Gackle.

12 years agoFixed 'lisp' form to produce code that captures enclosing lexical scope correctly...
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.

12 years agoExported 'loop' from Parenscript package, moved utility functions to src/utils.lisp.
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.

12 years agoUpdated tests to reflect changes in latest patches from Daniel Gackle.
Vladimir Sedach [Sun, 12 Apr 2009 02:25:18 +0000 (20:25 -0600)]
Updated tests to reflect changes in latest patches from Daniel Gackle.

12 years agoFixed 'lisp' form to produce code that captures enclosing lexical scope correctly...
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.

12 years agoExported 'loop' from Parenscript package, moved utility functions to src/utils.lisp.
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.

12 years agoRestored the old psmacro for LISP evaluation, because the new special form wasn't...
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.

12 years agoWhen turning a quoted list into a JS array, compile elements that are NIL as "null...
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 "[[]]".

12 years agoQuoted symbols should be emitted as literal strings, not converted first to JS symbol...
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.

12 years agoGenerate "[]" rather than "new Array()" for concision.
Daniel Gackle [Sat, 11 Apr 2009 22:47:17 +0000 (15:47 -0700)]
Generate "[]" rather than "new Array()" for concision.

12 years agoChanged PS-LOOP to emit DO* (i.e. normal JS for-loop code) rather than DO. It was...
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).

12 years agoUse WITH-OUTPUT-TO-STRING instead of CONCATENATE, because the latter fails when there...
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).

12 years agoModified the PS compiler to produce an intermediate representation that looks like...
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.

12 years agoChanged tests to reflect Daniel Gackle's keyword arguments patch.
Vladimir Sedach [Mon, 6 Apr 2009 00:16:17 +0000 (18:16 -0600)]
Changed tests to reflect Daniel Gackle's keyword arguments patch.

12 years agoInitialize keyword arguments from js ARGUMENTS, allowing keywords to also be passed...
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.

12 years agoAdded a partial implementation of LOOP to PS.
Daniel Gackle [Thu, 2 Apr 2009 04:01:03 +0000 (21:01 -0700)]
Added a partial implementation of LOOP to PS.

12 years agoMade the ignore declaration in define-ps-special-form be generated on the condition...
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.

12 years agoRemoved compile-time constant string concatenation from the Parenscript printer,...
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.

12 years agoChanged the definition of define-ps-special-form to make "expecting" an anaphor.
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.