Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the parenscript Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 05:32:40 2022 GMT+0.
Next: Systems, Previous: The parenscript Reference Manual, Up: The parenscript Reference Manual [Contents][Index]
Parenscript is a translator from an extended subset of Common Lisp to JavaScript. Parenscript code can run almost identically on both the browser (as JavaScript) and server (as Common Lisp). Parenscript code is treated the same way as Common Lisp code, making the full power of Lisp macros available for JavaScript. This provides a web development environment that is unmatched in its ability to reduce code duplication and provide advanced meta-programming facilities to web developers. At the same time, Parenscript is different from almost all other "language X" to JavaScript translators in that it imposes almost no overhead: No run-time dependencies: Any piece of Parenscript code is runnable as-is. There are no JavaScript files to include. Native types: Parenscript works entirely with native JavaScript data types. There are no new types introduced, and object prototypes are not touched. Native calling convention: Any JavaScript code can be called without the need for bindings. Likewise, Parenscript can be used to make efficient, self-contained JavaScript libraries. Readable code: Parenscript generates concise, formatted, idiomatic JavaScript code. Identifier names are preserved. This enables seamless use of JavaScript debuggers. Efficiency: Parenscript introduces minimal overhead for advanced Common Lisp features. The generated code is almost as fast as hand-written JavaScript. Parenscript is available via Quicklisp: (ql:quickload :parenscript) To run unit tests: (ql:quickload :parenscript.tests) (parenscript.tests:run-tests) Contributing: Please send patches and bug reports to the mailing list: parenscript-devel@common-lisp.net Documentation: See docs/tutorial.html and docs/reference.html Mailing list: parenscript-devel@common-lisp.net https://mailman.common-lisp.net/listinfo/parenscript-devel Web site: http://common-lisp.net/project/parenscript/ Source repository: https://gitlab.common-lisp.net/parenscript/parenscript.git License: BSD-3-Clause, see the file COPYING
Next: Modules, Previous: Introduction, Up: The parenscript Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
Lisp to JavaScript transpiler
Vladimir Sedach <vas@oneofus.la>
Manuel Odendahl <manuel@bl0rg.net>
BSD-3-Clause
Next: Files, Previous: Systems, Up: The parenscript Reference Manual [Contents][Index]
Modules are listed depth-first from the system components tree.
Next: parenscript/src/lib, Previous: Modules, Up: Modules [Contents][Index]
parenscript (system).
Next: parenscript/runtime, Previous: parenscript/src, Up: Modules [Contents][Index]
src (module).
Previous: parenscript/src/lib, Up: Modules [Contents][Index]
src (module).
parenscript (system).
ps-runtime-lib.lisp (file).
Next: Packages, Previous: Modules, Up: The parenscript Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: parenscript/src/package.lisp, Previous: Lisp, Up: Lisp [Contents][Index]
parenscript (system).
Next: parenscript/src/js-dom-symbol-exports.lisp, Previous: parenscript/parenscript.asd, Up: Lisp [Contents][Index]
src (module).
Next: parenscript/src/js-ir-package.lisp, Previous: parenscript/src/package.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
src (module).
re-export-symbols (function).
Next: parenscript/src/utils.lisp, Previous: parenscript/src/js-dom-symbol-exports.lisp, Up: Lisp [Contents][Index]
js-dom-symbol-exports.lisp (file).
src (module).
Next: parenscript/src/namespace.lisp, Previous: parenscript/src/js-ir-package.lisp, Up: Lisp [Contents][Index]
js-ir-package.lisp (file).
src (module).
Next: parenscript/src/compiler.lisp, Previous: parenscript/src/utils.lisp, Up: Lisp [Contents][Index]
utils.lisp (file).
src (module).
Next: parenscript/src/printer.lisp, Previous: parenscript/src/namespace.lisp, Up: Lisp [Contents][Index]
namespace.lisp (file).
src (module).
Next: parenscript/src/compilation-interface.lisp, Previous: parenscript/src/compiler.lisp, Up: Lisp [Contents][Index]
compiler.lisp (file).
src (module).
Next: parenscript/src/non-cl.lisp, Previous: parenscript/src/printer.lisp, Up: Lisp [Contents][Index]
printer.lisp (file).
src (module).
with-blank-compilation-environment (macro).
Next: parenscript/src/special-operators.lisp, Previous: parenscript/src/compilation-interface.lisp, Up: Lisp [Contents][Index]
compilation-interface.lisp (file).
src (module).
define-trivial-special-ops (macro).
Next: parenscript/src/parse-lambda-list.lisp, Previous: parenscript/src/non-cl.lisp, Up: Lisp [Contents][Index]
non-cl.lisp (file).
src (module).
Next: parenscript/src/function-definition.lisp, Previous: parenscript/src/special-operators.lisp, Up: Lisp [Contents][Index]
special-operators.lisp (file).
src (module).
Next: parenscript/src/macros.lisp, Previous: parenscript/src/parse-lambda-list.lisp, Up: Lisp [Contents][Index]
parse-lambda-list.lisp (file).
src (module).
Next: parenscript/src/deprecated-interface.lisp, Previous: parenscript/src/function-definition.lisp, Up: Lisp [Contents][Index]
function-definition.lisp (file).
src (module).
Next: parenscript/src/lib/ps-html.lisp, Previous: parenscript/src/macros.lisp, Up: Lisp [Contents][Index]
macros.lisp (file).
src (module).
Next: parenscript/src/lib/ps-loop.lisp, Previous: parenscript/src/deprecated-interface.lisp, Up: Lisp [Contents][Index]
lib (module).
Next: parenscript/src/lib/ps-dom.lisp, Previous: parenscript/src/lib/ps-html.lisp, Up: Lisp [Contents][Index]
lib (module).
for-in (function).
Next: parenscript/runtime/ps-runtime-lib.lisp, Previous: parenscript/src/lib/ps-loop.lisp, Up: Lisp [Contents][Index]
lib (module).
assert-is-one-of (function).
Previous: parenscript/src/lib/ps-dom.lisp, Up: Lisp [Contents][Index]
runtime (module).
*ps-lisp-library* (special variable).
Next: Definitions, Previous: Files, Up: The parenscript Reference Manual [Contents][Index]
Packages are listed by definition order.
Next: parenscript, Previous: Packages, Up: Packages [Contents][Index]
DOM Level 1 symbols.
Next: ps-dom2-symbols, Previous: ps-dom1-symbols, Up: Packages [Contents][Index]
ps
Next: ps-js-symbols, Previous: parenscript, Up: Packages [Contents][Index]
DOM Level 2 symbols. Includes DOM Level 1 symbols.
Next: ps-dhtml-symbols, Previous: ps-dom2-symbols, Up: Packages [Contents][Index]
JavaScript standard function and property names.
Next: ps-window-wd-symbols, Previous: ps-js-symbols, Up: Packages [Contents][Index]
Meta-package containing function/property symbols
of typical HTML4/DHTML browsers. Includes DOM Levels 0 to 2, Window
working draft, and de-facto standard symbols.
This is probably the package you want to :USE if you’re doing obfuscation in Parenscript and want to target the pre-HTML5 generation of browsers.
Next: ps-js, Previous: ps-dhtml-symbols, Up: Packages [Contents][Index]
Funtions and properties of the W3C Working Draft Window object. Includes DOM level 2 symbols.
Next: ps-dom-nonstandard-symbols, Previous: ps-window-wd-symbols, Up: Packages [Contents][Index]
Non-W3C-standard (incl. DOM level 0) but widely implemented functions and properties.
Next: Indexes, Previous: Packages, Up: The parenscript Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Next: Macros, Previous: Public Interface, Up: Public Interface [Contents][Index]
Special operators and macros defined by Parenscript. Replace at your own risk!
Controls the string delimiter char used when compiling Parenscript in ps-inline.
Specifies which character should be used for delimiting strings.
This variable is used when you want to embed the resulting JavaScript in an html attribute delimited by #\" as opposed to #\’, or vice-versa.
One of :sgml or :xml
Parenscript compiler version.
Next: Ordinary functions, Previous: Special variables, Up: Public Interface [Contents][Index]
Define a Lisp macro and a Parenscript macro with the same macro function (ie - the same result from macroexpand-1), for cases when the two have different full macroexpansions (for example if the CL macro contains implementation-specific code when macroexpanded fully in the CL environment).
Helper macro for writing Parenscript macros. Like PS-ONCE-ONLY,
except that if the given VARS are variables or constants, no intermediate variables are created.
Given Parenscript forms (an implicit progn), compiles those forms to a JavaScript string at macro-expansion time. Expands into a form which evaluates to a string.
Expands Parenscript forms in a clean environment.
Helper macro for writing Parenscript macros. Useful for preventing unwanted multiple evaluation.
Given Parenscript forms (an implicit progn), compiles those forms to a JavaScript string at macro-expansion time. Expands into a form which writes the resulting code to stream.
Helper macro for writing Parenscript macros. Each element of SYMBOLS is either a symbol or a list of (symbol gensym-prefix-string).
Previous: Macros, Up: Public Interface [Contents][Index]
Compiles the Parenscript form PS-FORM into Javascript.
If OUTPUT-STREAM is NIL, then the result is a string; otherwise code
is output to the OUTPUT-STREAM stream.
Import the named Lisp macros into the Parenscript macro environment. When the imported macro is macroexpanded by Parenscript, it is first fully macroexpanded in the Lisp macro environment, and then that expansion is further expanded by Parenscript.
Compiles body to a JavaScript string. If *parenscript-stream* is bound, writes the output to *parenscript-stream*, otherwise returns a string.
Opens file as input stream and calls ps-compile-stream on it.
Reads (using the value of *ps-read-function*, #’read by default, as the read function) Parenscript forms from stream and compiles them as if by ps*. If *parenscript-stream* is bound, writes the output to *parenscript-stream*, otherwise and returns a string.
Like concatenate but prints all of its arguments.
Previous: Public Interface, Up: Definitions [Contents][Index]
Used to issue warnings when replacing PS special operators or macros.
This value takes on the following values:
:toplevel indicates that we are traversing toplevel forms.
:inside-toplevel-form indicates that we are inside a call to ps-compile-*
nil indicates we are no longer toplevel-related.
Name of the lexically enclosing block, if any.
Tags that need to be thrown to to reach.
Lexical variables bound in all lexically enclosing function argument lists.
All enclosing lexical variables (includes function names).
All block names that this function is responsible for catching.
Table of lambda lists for defined functions.
Statement special forms that can be wrapped in a lambda to make them into expressions. Control transfer forms like BREAK, RETURN, and CONTINUE need special treatment, and are not included.
Functions named by flet and label.
Variable which is set by RETURN-FROM when it returns a value from inside a loop. The value is the name of a PS variable which dynamically indicates if the return statement indeed has been invoked.
Variable which is used to return values from inside loop bodies.
Lexical variables introduced by a loop.
Lexical variables introduced by a loop that are also captured by lambdas inside a loop.
Current macro environment.
Toplevel macro environment dictionary.
Table of lambda lists for toplevel macros.
Setf expander dictionary. Key is the symbol of the access function of the place, value is an expansion function that takes the arguments of the access functions as a first value and the form to be stored as the second value.
Special variables declared during any Parenscript run. Re-bind this if you want to clear the list.
Names that have been already used for lexical bindings in the current function scope.
This special variable is expected to be bound to a fresh list by special forms that introduce a new JavaScript lexical block (currently function definitions and lambdas). Enclosed special forms are expected to push variable declarations onto the list when the variables declaration cannot be made by the enclosed form (for example, a x,y,z expression progn). It is then the responsibility of the enclosing special form to introduce the variable declarations in its lexical block.
Bind to T when compiling CASE branches.
Lets the compiler know when lambda wrapping is necessary.
Used for seeing when we’re in loops, so that we can introduce proper scoping for lambdas closing over loop-bound variables (otherwise they all share the same binding).
Next: Ordinary functions, Previous: Special variables, Up: Internals [Contents][Index]
Next: Generic functions, Previous: Macros, Up: Internals [Contents][Index]
Given the current *compilation-level*, LEVEL, and the fully macroexpanded form, FORM, returns the new value for *compilation-level*.
Consumes the next meaningful chunk of loop for processing.
Given a string, produces to a valid JavaScript identifier by following transformation heuristics case conversion. For example, paren-script becomes parenScript, *some-global* becomes SOMEGLOBAL.
Given the arguments and body to a parenscript macro, returns a function that may be called on the entire parenscript form and outputs some parenscript code. Returns a second value that is the effective lambda list from a Parenscript perspective.
CL set-difference may not preserve order.
Parses a function or block body, which may or may not include a docstring. Returns 2 or 3 values: a docstring (if allowed for), a list of (declare ...) forms, and the remaining body.
The lambda list is transformed as follows:
* standard and optional variables are the mapped directly into
the js-lambda list
* keyword variables are not included in the js-lambda list, but instead are obtained from the magic js ARGUMENTS pseudo-array. Code assigning values to keyword vars is prepended to the body of the function.
parses an &key parameter. Returns 5 values:
var, init-form, keyword-name, supplied-p-var, init-form-supplied-p.
Syntax of key spec:
[&key {var | ({var | (keyword-name var)} [init-form [supplied-p-parameter]])}*
Parses an &optional parameter. Returns 3 values: var, init-form, supplied-p-var. [&optional {var | (var [init-form [supplied-p-parameter]])}*]
If FORM is a symbol macro, return its macro function. Otherwise, return NIL.
Heuristic that tries not to expressionize deeply nested if expressions.
Next: Conditions, Previous: Ordinary functions, Up: Internals [Contents][Index]
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
form.
automatically generated reader method
automatically generated writer method
automatically generated reader method
name.
automatically generated writer method
name.
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
Next: Classes, Previous: Generic functions, Up: Internals [Contents][Index]
error.
:form
This slot is read-only.
Previous: Conditions, Up: Internals [Contents][Index]
Previous: Definitions, Up: The parenscript Reference Manual [Contents][Index]
Jump to: | %
(
A B C D E F G H I J L M N O P R S T U V W |
---|
Jump to: | %
(
A B C D E F G H I J L M N O P R S T U V W |
---|
Next: Data types, Previous: Functions, Up: Indexes [Contents][Index]
Jump to: | %
*
A C F I N P R S T |
---|
Jump to: | %
*
A C F I N P R S T |
---|
Jump to: | C D F J L M N P R S U |
---|
Jump to: | C D F J L M N P R S U |
---|