clinton/parenscript.git
16 years agoeval-when special form
Red Daly [Fri, 20 Jul 2007 20:35:32 +0000 (20:35 +0000)]
eval-when special form

Added the EVAL-WHEN special form to the Parenscript language.  It
works similarly to the EVAL-WHEN form in Lisp.  It has the following
form:

(eval-when body-forms-language? (situation*) body-forms*)

SITUATION is either :compile-toplevel or :execute.

BODY-FORMS-LANGUAGE is optional and either :parenscript or :lisp.  It
defaults to :lisp when :COMPILE-TOPLEVEL is specified and :parenscript
when :EXECUTE is specified.

Parenscript's EVAL-WHEN is relevant when loading toplevel forms,
either from Parenscript files or from within Lisp.

16 years agorenaming and refactoring
Red Daly [Fri, 20 Jul 2007 00:34:31 +0000 (00:34 +0000)]
renaming and refactoring

Changed the names of many functions and macros to get rid of the
symbols with "js" in them--its not Javascript, it's Parenscript!  Most
of those symbols were renamed with "script" replacing "js".

Also changed the main compilation interfaces to use the function
COMPILE-SCRIPT and the macro SCRIPT from JS-COMPILE and JS
respectively.

Additionally, the first steps of the package system are included (with
the addition of a the SCRIPT-PACKAGE and COMPILATION-ENVIRONMENT
classes).  These are integrated into the current compiler, though they
probably break a few "traditional" serialization methods, specifically
because macro and special form names are stored as symbols rather than
strings and EQL comparisons are used rather than STRING-EQUAL
comparisons of the strings.

I have also split parser.lisp into parser.lisp and macrology.lisp.
Parser.lisp contains mechanisms for parsing Parenscript given an input
s-expression while macrology.lisp contains language definitions that
make use of the parsing mechanisms.

All tests now pass, though the documentation has gone slightly out of
date with the symbol renaming.  This will be fixed shortly.  More
tests and functionality need to be added to make the current
Parenscript compatable with the older semantics (as dicussed,
comparing macro/special form names based on their string values is the
main thing).

16 years agoRe-introduced 'with' special form. parenscript-20070720
Vladimir Sedach [Mon, 16 Jul 2007 18:13:40 +0000 (18:13 +0000)]
Re-introduced 'with' special form.

(it got lost somewhere along the way)

16 years agoImproved formatting/whitespace removing code in tests. Added slot-value-setf test.
Vladimir Sedach [Sat, 14 Jul 2007 00:28:54 +0000 (00:28 +0000)]
Improved formatting/whitespace removing code in tests.  Added slot-value-setf test.

Now all ps-tests pass.

16 years agoAdded documentation of new macro facilities.
Vladimir Sedach [Fri, 13 Jul 2007 21:11:09 +0000 (21:11 +0000)]
Added documentation of new macro facilities.

16 years agoAdded warnings when attempting to use reserved Javascript keywords as variable or...
Viktor Leis [Thu, 12 Jul 2007 23:19:07 +0000 (23:19 +0000)]
Added warnings when attempting to use reserved Javascript keywords as variable or functions names.

Signed-off-by: Vladimir Sedach <vsedach@gmail.com>
16 years agoAdded oddp, evenp utility functions, added explanatory error message to js-compile...
Vladimir Sedach [Tue, 10 Jul 2007 21:18:21 +0000 (21:18 +0000)]
Added oddp, evenp utility functions, added explanatory error message to js-compile-to-symbol.

16 years agoImproved symbol-to-js to handle more complicated Javascript-like symbols.
Vladimir Sedach [Tue, 3 Jul 2007 19:45:56 +0000 (19:45 +0000)]
Improved symbol-to-js to handle more complicated Javascript-like symbols.

16 years agoFactor out misc tests into their own test file.
Luca Capello [Tue, 3 Jul 2007 18:29:37 +0000 (18:29 +0000)]
Factor out misc tests into their own test file.

Signed-off-by: Vladimir Sedach <vsedach@gmail.com>
16 years agocharacter encoding fixes in test.lisp
Red Daly [Mon, 2 Jul 2007 21:43:07 +0000 (21:43 +0000)]
character encoding fixes in test.lisp

16 years agot/test.lisp: typo, remove colon at line 82
Luca Capello [Sun, 1 Jul 2007 17:04:19 +0000 (17:04 +0000)]
t/test.lisp: typo, remove colon at line 82

16 years agoadd an (eval-when ...) when defining a test suite
Luca Capello [Sun, 1 Jul 2007 17:00:21 +0000 (17:00 +0000)]
add an (eval-when ...) when defining a test suite

16 years agoAdded divisors to ceiling, floor, round.
Vladimir Sedach [Thu, 28 Jun 2007 19:28:23 +0000 (19:28 +0000)]
Added divisors to ceiling, floor, round.

16 years agoAdded Red Daly to contributors file.
Vladimir Sedach [Tue, 26 Jun 2007 23:13:07 +0000 (23:13 +0000)]
Added Red Daly to contributors file.

16 years agojs.lisp breakup
Red Daly [Tue, 26 Jun 2007 21:30:27 +0000 (21:30 +0000)]
js.lisp breakup

Broke the js.lisp file up into several three files: source-model.lisp,
js-translation.lisp, and parser.lisp.

source-model.lisp: class definitions that correspond to the Javascript
AST.  (defjsclass forms for the most part)

js-translation.lisp: functions for converting AST objects to
Javascript source code

parser.lisp: macro definitions and the mechanisms for processing
Parenscript forms into AST objects.

See also: http://common-lisp.net/pipermail/parenscript-devel/2007-June/000035.html

16 years agopackage rename
Red Daly [Tue, 26 Jun 2007 17:43:20 +0000 (17:43 +0000)]
package rename

16 years agoRefactored macro-related code, changed "compiler macros" to special forms, added...
Vladimir Sedach [Tue, 26 Jun 2007 19:24:52 +0000 (19:24 +0000)]
Refactored macro-related code, changed "compiler macros" to special forms, added separate namespaces for macros and symbol-macros, added full macro lambda lists to macrolet, added support for docstrings to defjsmacro.

16 years agoAdded contributors file.
Vladimir Sedach [Mon, 25 Jun 2007 19:42:00 +0000 (19:42 +0000)]
Added contributors file.

16 years agoAdded js-expander.el
Vladimir Sedach [Mon, 25 Jun 2007 19:17:27 +0000 (19:17 +0000)]
Added js-expander.el

16 years agoAdded defmacro to ParenScript.
Vladimir Sedach [Fri, 22 Jun 2007 20:46:40 +0000 (20:46 +0000)]
Added defmacro to ParenScript.

16 years agoRenamed with-timeout to do-set-timeout, added ignore errors.
Vladimir Sedach [Thu, 21 Jun 2007 17:54:16 +0000 (17:54 +0000)]
Renamed with-timeout to do-set-timeout, added ignore errors.

Thanks to: John Fremlin <john@fremlin.org>

16 years agoAdded defmacro+js
Vladimir Sedach [Wed, 20 Jun 2007 20:48:00 +0000 (20:48 +0000)]
Added defmacro+js

16 years agoExported defmacro/js
Vladimir Sedach [Tue, 19 Jun 2007 21:34:16 +0000 (21:34 +0000)]
Exported defmacro/js

16 years agoAdded js-utils file.
Vladimir Sedach [Tue, 19 Jun 2007 19:37:48 +0000 (19:37 +0000)]
Added js-utils file.

16 years agoAdded the defmacro/js macro-defining macro.
Vladimir Sedach [Tue, 19 Jun 2007 18:44:51 +0000 (18:44 +0000)]
Added the defmacro/js macro-defining macro.

16 years agoAdded binary negation ~ operator.
Vladimir Sedach [Sat, 16 Jun 2007 04:59:12 +0000 (04:59 +0000)]
Added binary negation ~ operator.

16 years agosetf slot-value patch
Vladimir Sedach [Fri, 15 Jun 2007 19:29:16 +0000 (19:29 +0000)]
setf slot-value patch

16 years agoFix: add parens around instanceof to make it work in all situations
Attila Lendvai [Wed, 6 Jun 2007 19:45:25 +0000 (19:45 +0000)]
Fix: add parens around instanceof to make it work in all situations

17 years agoBah, speed up list-to-string by a few factors...
Attila Lendvai [Thu, 3 May 2007 14:40:28 +0000 (14:40 +0000)]
Bah, speed up list-to-string by a few factors...

17 years agoFix (- 1) and (incf/decf x 5)
Ray Myers [Fri, 27 Apr 2007 07:39:17 +0000 (07:39 +0000)]
Fix (- 1) and (incf/decf x 5)

Fix the following incorrect (or at least unexpected) behavior in
ParenScript.

(js (- 1))  =>  "1;"
(js (incf x 5))   => an error
(js (decf x 5))   => an error

Signed-off-by: Attila Lendvai <attila.lendvai@gmail.com>
17 years agoNote in the warning that we are redefining a _js_ compiler macro
Attila Lendvai [Wed, 25 Apr 2007 14:58:06 +0000 (14:58 +0000)]
Note in the warning that we are redefining a _js_ compiler macro

17 years agoFollow quote changes in SLOT-VALUE
Attila Lendvai [Mon, 16 Apr 2007 14:36:03 +0000 (14:36 +0000)]
Follow quote changes in SLOT-VALUE

17 years agoFixed (?) quoting mechanism
Attila Lendvai [Mon, 16 Apr 2007 13:11:33 +0000 (13:11 +0000)]
Fixed (?) quoting mechanism

(js:js (+ 42 '"FoooFFFOFOFooo")) => "42 + FoooFFFOFOFooo;"

IOW, quote inside a parenscript form means to simply print the quoted
value as-is.  Among other things, this is useful for inserting literal
javascript into parenscript.  I hope it will not break anything.

17 years agoconditional attributes in html-generator
Henrik Hjelte [Mon, 15 Jan 2007 14:19:48 +0000 (14:19 +0000)]
conditional attributes in html-generator

17 years agoadd proper cond construct
Marijn Haverbeke [Wed, 15 Nov 2006 07:38:22 +0000 (07:38 +0000)]
add proper cond construct

17 years agoPossible to make attributes conditionally rendered with js-html generator
Henrik Hjelte [Wed, 22 Nov 2006 19:30:27 +0000 (19:30 +0000)]
Possible to make attributes conditionally rendered with js-html generator

17 years agodocs updated for new setf optimization
Henrik Hjelte [Wed, 15 Nov 2006 23:54:41 +0000 (23:54 +0000)]
docs updated for new setf optimization

17 years agobugfix method-call problem
Henrik Hjelte [Wed, 15 Nov 2006 23:41:44 +0000 (23:41 +0000)]
bugfix method-call problem

17 years agomoretests for method-call (dot-notation) syntax
Henrik Hjelte [Wed, 15 Nov 2006 22:40:45 +0000 (22:40 +0000)]
moretests for method-call (dot-notation) syntax

17 years agobugfix commutative plus and minus
Henrik Hjelte [Wed, 15 Nov 2006 21:35:02 +0000 (21:35 +0000)]
bugfix commutative plus and minus

17 years agotests for some bugs
Henrik Hjelte [Wed, 15 Nov 2006 20:44:56 +0000 (20:44 +0000)]
tests for some bugs

Reported by: Marijn Haverbeke <marijnh@gmail.com>

17 years agoasdf test-op added
Henrik Hjelte [Wed, 15 Nov 2006 19:27:20 +0000 (19:27 +0000)]
asdf test-op added

(asdf:operate 'asdf:test-op :parenscript)

17 years agoupdated pdf manual for new with syntax
Henrik Hjelte [Wed, 15 Nov 2006 16:46:03 +0000 (16:46 +0000)]
updated pdf manual for new with syntax

17 years agobuild.sh for documentation
Henrik Hjelte [Wed, 15 Nov 2006 16:43:39 +0000 (16:43 +0000)]
build.sh for documentation

17 years agoUpdated documentation to reflect the new syntax of the with statement
Henrik Hjelte [Wed, 15 Nov 2006 16:13:03 +0000 (16:13 +0000)]
Updated documentation to reflect the new syntax of the with statement

17 years agomake the test escape-sequences-in-string work again
Henrik Hjelte [Wed, 15 Nov 2006 15:58:46 +0000 (15:58 +0000)]
make the test escape-sequences-in-string work again

17 years agoAdded evenp and oddp
Attila Lendvai [Tue, 3 Oct 2006 13:49:55 +0000 (13:49 +0000)]
Added evenp and oddp

17 years agoAdded assert for simple catch forms
Attila Lendvai [Tue, 3 Oct 2006 13:49:23 +0000 (13:49 +0000)]
Added assert for simple catch forms

17 years agoKilled the feature (js:js* '(let (a b) (+ a b))) => "var a = b; a + b;"
Attila Lendvai [Fri, 1 Sep 2006 16:02:49 +0000 (16:02 +0000)]
Killed the feature (js:js* '(let (a b) (+ a b))) => "var a = b; a + b;"

17 years agodocs/pbook.py: correct faulty check for PDF output
Luca Capello [Mon, 2 Oct 2006 21:55:16 +0000 (21:55 +0000)]
docs/pbook.py: correct faulty check for PDF output

Frank K[_\c3_][_\bc_]ster discovered that docs/pbook.py produces buggy
LaTeX code, a faulty check for PDF output.  It doesn't show up if you
only try to create PDF.

But if you want to go the traditional route and produce dvi files (and
from that PostScript and maybe finally again PDF), this will fail and
still produce PDF.  The script itself doesn't do that (or rather, it
does that in fact but ignores the output in this first run), but it's
still an uglyness.

Moreover, it's completely useless, because the only package that uses
the information, graphicx, will detect the output format itself (and
in a proper way).

  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=390629

17 years agoUse symbol-name for op matching to fix various bugs/surprises
Attila Lendvai [Mon, 21 Aug 2006 09:57:00 +0000 (09:57 +0000)]
Use symbol-name for op matching to fix various bugs/surprises

(e.g. `(foo::% 4 2))

17 years agoAllow strings and numbers as slot names in object literals
Marijn Haverbeke [Fri, 21 Jul 2006 07:50:06 +0000 (07:50 +0000)]
Allow strings and numbers as slot names in object literals

17 years agoDrop unused js2.lisp
Marco Baringer [Sun, 16 Jul 2006 17:07:49 +0000 (17:07 +0000)]
Drop unused js2.lisp

17 years agoFix compilation of (.call (lambda () ...) arg1 ...), add missing ()'s around the...
Attila Lendvai [Sun, 16 Jul 2006 16:47:17 +0000 (16:47 +0000)]
Fix compilation of (.call (lambda () ...) arg1 ...), add missing ()'s around the lambda

17 years agoFix compilation of ((foo) bar) -> foo()(bar)
Attila Lendvai [Sun, 16 Jul 2006 16:46:30 +0000 (16:46 +0000)]
Fix compilation of ((foo) bar) -> foo()(bar)

17 years agoFixed js-with
Attila Lendvai [Sun, 16 Jul 2006 16:39:46 +0000 (16:39 +0000)]
Fixed js-with

WARNING: this involves syntax change

Previously the syntax of with was this:
  (with (object)
    body)

now it's:
  (with object
    body)

It was also broken when 'object' was an expression...

17 years agobugfix sometimes missing semicolons when joining js-body
Henrik Hjelte [Sat, 15 Jul 2006 20:13:44 +0000 (20:13 +0000)]
bugfix sometimes missing semicolons when joining js-body

17 years agoRebind var in dolist to make also clisp happy
Attila Lendvai [Tue, 11 Jul 2006 21:17:50 +0000 (21:17 +0000)]
Rebind var in dolist to make also clisp happy

import-macros-from-lisp was broken due to this.

17 years agoregex patch
Henrik Hjelte [Tue, 11 Jul 2006 13:47:05 +0000 (13:47 +0000)]
regex patch

Suggested by: Lou Vanek <vanek@acd.net>

17 years agodocumentation updated about dollar char
Henrik Hjelte [Tue, 11 Jul 2006 10:09:52 +0000 (10:09 +0000)]
documentation updated about dollar char

17 years agoMade ref2test work with cl-launch
Henrik Hjelte [Tue, 11 Jul 2006 08:49:15 +0000 (08:49 +0000)]
Made ref2test work with cl-launch

17 years agoFix screwed-up asd file
Attila Lendvai [Fri, 7 Jul 2006 22:37:11 +0000 (22:37 +0000)]
Fix screwed-up asd file

17 years agoFixed instanceof
Attila Lendvai [Fri, 7 Jul 2006 15:18:26 +0000 (15:18 +0000)]
Fixed instanceof

17 years agoAdded src/lib/functional.lisp
Attila Lendvai [Fri, 7 Jul 2006 15:13:21 +0000 (15:13 +0000)]
Added src/lib/functional.lisp

This is a first element of an parenscript library. The contents of
this file is to be compiled with parenscript and the result js
included in the host environment in one way or another.

17 years agoAdded :eval-forms-p to compile-parenscript-file
Attila Lendvai [Fri, 7 Jul 2006 15:12:31 +0000 (15:12 +0000)]
Added :eval-forms-p to compile-parenscript-file

17 years agoFix the return value of map-into
Attila Lendvai [Thu, 6 Jul 2006 22:55:47 +0000 (22:55 +0000)]
Fix the return value of map-into

17 years agoMoved some macros towards the top of the file due to dependencies
Attila Lendvai [Thu, 6 Jul 2006 22:51:47 +0000 (22:51 +0000)]
Moved some macros towards the top of the file due to dependencies

In the long run we should cut js.lisp into several files. One dealing
with the basic infrastructure like macro expansion, and the rest
implementing the compiler based on this infrastructure/utilities.

17 years agoAdded map and map-into
Attila Lendvai [Wed, 5 Jul 2006 18:23:51 +0000 (18:23 +0000)]
Added map and map-into

17 years agoShortened default gensym constant
Attila Lendvai [Wed, 5 Jul 2006 18:20:46 +0000 (18:20 +0000)]
Shortened default gensym constant

17 years agoDon't use loop's initially clause to avoid a clisp bug
Attila Lendvai [Tue, 4 Jul 2006 00:33:15 +0000 (00:33 +0000)]
Don't use loop's initially clause to avoid a clisp bug

For details see: http://sourceforge.net/tracker/index.php?func=detail&aid=1516684&group_id=1355&atid=101355

17 years agoMake defjsmacro rend's docstring a comment so clisp will stop complaining
Marco Baringer [Sat, 27 May 2006 09:31:59 +0000 (09:31 +0000)]
Make defjsmacro rend's docstring a comment so clisp will stop complaining

18 years agoMove undefine-js-compiler-macro into an eval-when.
Attila Lendvai [Sat, 13 May 2006 09:30:31 +0000 (09:30 +0000)]
Move undefine-js-compiler-macro into an eval-when.

Reported by: William Halliburton <whalliburton@gmail.com>

18 years agoAdded import-macros-from-lisp that bring lisp macros into the js macroexpansion
Attila Lendvai [Fri, 12 May 2006 15:29:54 +0000 (15:29 +0000)]
Added import-macros-from-lisp that bring lisp macros into the js macroexpansion

18 years agoMove compile-parenscript code into a separate file so that it complies cleanly
Marco Baringer [Wed, 10 May 2006 12:54:47 +0000 (12:54 +0000)]
Move compile-parenscript code into a separate file so that it complies cleanly

The problew is that compile-parenscript-file-to-string contains a call
to the macro js:js* this macro needs to be defined before we compile
the compile-parenscript-file-to-string function.

18 years agoUse an explicit asdf:perform :after method instead of :perform (load-op :after ...)
Marco Baringer [Wed, 10 May 2006 12:54:22 +0000 (12:54 +0000)]
Use an explicit asdf:perform :after method instead of :perform (load-op :after ...)

18 years agoAdded compile-parenscript-file
Attila Lendvai [Mon, 8 May 2006 11:08:34 +0000 (11:08 +0000)]
Added compile-parenscript-file

18 years agoAdded character type conversion
Attila Lendvai [Mon, 8 May 2006 11:06:11 +0000 (11:06 +0000)]
Added character type conversion

18 years agoAdded a rebind js macro that rebinds variables on the js side
Attila Lendvai [Sun, 16 Apr 2006 18:18:25 +0000 (18:18 +0000)]
Added a rebind js macro that rebinds variables on the js side

18 years agoExport defjsmacro
Marco Baringer [Sat, 1 Apr 2006 11:39:18 +0000 (11:39 +0000)]
Export defjsmacro

18 years agoAdded docstring for *js-quote-char*
Marco Baringer [Sat, 1 Apr 2006 11:35:03 +0000 (11:35 +0000)]
Added docstring for *js-quote-char*

18 years agoAdd variable *js-quote-char*
Xan Lopez [Sat, 1 Apr 2006 11:28:58 +0000 (11:28 +0000)]
Add variable *js-quote-char*

Signed-off-by: Marco Baringer <mb@bese.it>
18 years agoImplement js-to-strings for the regex class
Marco Baringer [Sun, 26 Feb 2006 17:05:27 +0000 (17:05 +0000)]
Implement js-to-strings for the regex class

18 years ago#\$ is not a special javascript character.
Marco Baringer [Sat, 25 Feb 2006 17:07:51 +0000 (17:07 +0000)]
#\$ is not a special javascript character.

Reported by: Richard Morse <pukku@mac.com>

18 years agoremove docs/images and relative references in tutorial.lisp
Luca Capello [Thu, 16 Feb 2006 08:42:59 +0000 (08:42 +0000)]
remove docs/images and relative references in tutorial.lisp

18 years agoremove docs/reference.pdf, already included in manual.pdf
Luca Capello [Fri, 27 Jan 2006 13:25:11 +0000 (13:25 +0000)]
remove docs/reference.pdf, already included in manual.pdf

18 years agoThe #\Form is not a standard character name, use #.(code-char 12) instead.
Marco Baringer [Sun, 5 Feb 2006 16:04:44 +0000 (16:04 +0000)]
The #\Form is not a standard character name, use #.(code-char 12) instead.

18 years agoproper escape sequences in strings
Henrik Hjelte [Thu, 2 Feb 2006 12:39:12 +0000 (12:39 +0000)]
proper escape sequences in strings

18 years agoref2test finds reference.lisp in docs dir
Henrik Hjelte [Wed, 1 Feb 2006 11:17:12 +0000 (11:17 +0000)]
ref2test finds reference.lisp in docs dir

18 years agomerge parenscript-test.asd into parenscript.asd
Luca Capello [Fri, 27 Jan 2006 08:57:09 +0000 (08:57 +0000)]
merge parenscript-test.asd into parenscript.asd

18 years agomove doc files to docs/
Luca Capello [Mon, 23 Jan 2006 22:25:48 +0000 (22:25 +0000)]
move doc files to docs/

18 years agomove test files to t/ and modify parenscript-test.asd as well
Luca Capello [Mon, 23 Jan 2006 21:50:26 +0000 (21:50 +0000)]
move test files to t/ and modify parenscript-test.asd as well

18 years agomove source files to src/ and modify parenscript.asd as well
Luca Capello [Mon, 23 Jan 2006 21:31:52 +0000 (21:31 +0000)]
move source files to src/ and modify parenscript.asd as well

18 years agoremove trailing spaces at endlines in *.lisp
Luca Capello [Mon, 23 Jan 2006 21:19:27 +0000 (21:19 +0000)]
remove trailing spaces at endlines in *.lisp

18 years agoremove trailing spaces at empty lines in *.lisp
Luca Capello [Sun, 22 Jan 2006 21:57:42 +0000 (21:57 +0000)]
remove trailing spaces at empty lines in *.lisp

18 years agopbook.py: convert endlines to Unix format
Luca Capello [Sun, 22 Jan 2006 21:17:04 +0000 (21:17 +0000)]
pbook.py: convert endlines to Unix format

18 years agocss-inline compiles with cmucl
Henrik Hjelte [Mon, 9 Jan 2006 11:36:02 +0000 (11:36 +0000)]
css-inline compiles with cmucl

18 years agoNew function gen-js-name-string
Marco Baringer [Mon, 19 Dec 2005 16:04:35 +0000 (16:04 +0000)]
New function gen-js-name-string

This allows you to get a unique javascript name as a string and not
just as a symbol.

18 years agobugfix slot-value
Henrik Hjelte [Mon, 19 Dec 2005 13:19:01 +0000 (13:19 +0000)]
bugfix slot-value

18 years agobug in dwim-join
Henrik Hjelte [Sun, 18 Dec 2005 17:17:24 +0000 (17:17 +0000)]
bug in dwim-join

18 years agocss-inline generator
Henrik Hjelte [Sun, 18 Dec 2005 11:14:26 +0000 (11:14 +0000)]
css-inline generator