Common Lisp Package: JS

README:

FUNCTION

Public

* (&REST NUMBERS)

Return the product of its arguments. With no args, returns 1.

+ (&REST NUMBERS)

Return the sum of its arguments. With no args, returns 0.

- (NUMBER &REST MORE-NUMBERS)

Subtract the second and all subsequent arguments from the first; or with one argument, negate the first argument.

/ (NUMBER &REST MORE-NUMBERS)

Divide the first argument by each of the following arguments, in turn. With one argument, return reciprocal.

/= (NUMBER &REST MORE-NUMBERS)

Return T if no two of its arguments are numerically equal, NIL otherwise.

1+ (NUMBER)

Return NUMBER + 1.

1- (NUMBER)

Return NUMBER - 1.

< (NUMBER &REST MORE-NUMBERS)

Return T if its arguments are in strictly increasing order, NIL otherwise.

<= (NUMBER &REST MORE-NUMBERS)

Return T if arguments are in strictly non-decreasing order, NIL otherwise.

= (NUMBER &REST MORE-NUMBERS)

Return T if all of its arguments are numerically equal, NIL otherwise.

> (NUMBER &REST MORE-NUMBERS)

Return T if its arguments are in strictly decreasing order, NIL otherwise.

>= (NUMBER &REST MORE-NUMBERS)

Return T if arguments are in strictly non-increasing order, NIL otherwise.

AREF (ARRAY &REST SUBSCRIPTS)

Return the element of the ARRAY specified by the SUBSCRIPTS.

BREAK (&OPTIONAL (DATUM break) &REST ARGUMENTS)

Print a message and invoke the debugger without allowing any possibility of condition handling occurring.

COMPILE-PARENSCRIPT-FILE (SOURCE-FILE &REST ARGS &KEY DESTINATION-FILE &ALLOW-OTHER-KEYS)

Compile SOURCE-FILE (a parenscript file) to a javascript file with compile-parenscript-file-to-string. When DESTINATION-FILE is omitted, then it will be named the same as SOURCE-FILE but with js extension.

COMPILE-PARENSCRIPT-FILE-TO-STRING (SOURCE-FILE &KEY (LOG-STREAM NIL) (COMMENT NIL) (EVAL-FORMS-P NIL))

Compile SOURCE-FILE (a parenscript file) to a javascript string. (in-package ...) forms behave as expected and all other forms are evaluated according to the value of EVAL-FORMS-P. If the result of the evaluation is not nil then it's compiled with js:js* and written to the output.

CONTINUE (&OPTIONAL CONDITION)

Transfer control to a restart named CONTINUE, or return NIL if none exists.

DELETE (ITEM SEQUENCE &REST ARGS &KEY FROM-END (TEST #'EQL) (TEST-NOT NIL) (START 0) (END NIL) (COUNT NIL) (KEY NIL))

Return a sequence formed by destructively removing the specified ITEM from the given SEQUENCE.

FLOOR (NUMBER &OPTIONAL (DIVISOR 1))

Return the greatest integer not greater than number, or number/divisor. The second returned value is (mod number divisor).

GEN-JS-NAME (&KEY (PREFIX _ps_))

Generate a new javascript identifier.

GEN-JS-NAME-STRING (&KEY (PREFIX _ps_))

Generates a unique valid javascript identifier ()

IF (TEST THEN &OPTIONAL ELSE)

IF predicate then [else] If PREDICATE evaluates to true, evaluate THEN and return its values, otherwise evaluate ELSE and return its values. ELSE defaults to NIL.

IMPORT-MACROS-FROM-LISP (&REST NAMES)

Import the named lisp macros into the js macro expansion

LET (BINDINGS &BODY BODY)

LET ({(var [value]) | var}*) declaration* form* During evaluation of the FORMS, bind the VARS to the result of evaluating the VALUE forms. The variables are bound in parallel after all of the VALUES forms have been evaluated.

LIST (&REST ARGS)

Return constructs and returns a list of its arguments.

MACROLET (DEFINITIONS &REST BODY)

MACROLET ({(name lambda-list form*)}*) body-form* Evaluate the BODY-FORMS in an environment with the specified local macros defined. NAME is the local macro name, LAMBDA-LIST is a DEFMACRO style destructuring lambda list, and the FORMS evaluate to the expansion.

NOT (OBJECT)

Return T if X is NIL, otherwise return NIL.

PROGN (&REST FORMS)

PROGN form* Evaluates each FORM in order, returning the values of the last form. With no forms, returns NIL.

SYMBOL-MACROLET (MACROBINDINGS &BODY BODY)

SYMBOL-MACROLET ({(name expansion)}*) decl* form* Define the NAMES as symbol macros with the given EXPANSIONS. Within the body, references to a NAME will effectively be replaced with the EXPANSION.

THROW (TAG RESULT)

THROW tag form Do a non-local exit, return the values of FORM from the CATCH whose tag is EQ to TAG.

Undocumented

SETFAREF (NEW-VALUE ARRAY &REST SUBSCRIPTS)

CSS-TO-STRING (RULES)

EQL (X Y)

JS-COMPILE (FORM)

JS-TO-LINE (EXPR)

JS-TO-STRING (EXPR)

MAKE-ARRAY (DIMENSIONS &KEY (ELEMENT-TYPE T) (INITIAL-ELEMENT NIL INITIAL-ELEMENT-P) (INITIAL-CONTENTS NIL INITIAL-CONTENTS-P) ADJUSTABLE FILL-POINTER DISPLACED-TO DISPLACED-INDEX-OFFSET)

RANDOM (ARG &OPTIONAL (STATE *RANDOM-STATE*))

SLOT-VALUE (OBJECT SLOT-NAME)

Private

JS-EXPAND-FORM (EXPR)

Expand a javascript form.

LOOKUP-MACRO (NAME)

Lookup the macro NAME in the current macro expansion environment. Returns the macro and the parent macro environment of this macro.

Undocumented

APPEND-TO-LAST (FORM ELT)

ASSIGNMENT-OP (OP)

CONSTANT-STRING-P (STRING)

CSS-INLINE-FUNC (PROPLIST)

CSS-RULE-PROPERTIES (CSS-RULE)

CSS-RULE-SELECTORS (CSS-RULE)

CSS-RULE-TO-STRING (CSS-RULE)

DWIM-JOIN (VALUE-STRING-LISTS MAX-LENGTH &KEY (START ) END (JOIN-BEFORE ) JOIN-AFTER (WHITE-SPACE (MAKE-STRING (LENGTH START) INITIAL-ELEMENT )) (SEPARATOR ) (APPEND-TO-LAST #'APPEND-TO-LAST) (COLLECT T))

FIRST-SLASH-P (STRING)

FIRST-UPPERCASE-P (STRING)

FUNCALL-FORM-P (FORM)

JS-++ (X)

JS-- (FIRST &REST REST)

JS--- (X)

JS-AREF (ARRAY &REST COORDS)

JS-ARRAY (&REST VALUES)

JS-BREAK

JS-CC-IF (TEST &REST BODY)

JS-COMPILE-LIST (FORM)

JS-COMPILE-TO-BODY (FORM &KEY (INDENT ))

JS-COMPILE-TO-EXPRESSION (FORM)

JS-COMPILE-TO-STATEMENT (FORM)

JS-COMPILE-TO-SYMBOL (FORM)

JS-COMPILER-MACRO-FORM-P (FORM)

JS-COND (&REST CLAUSES)

JS-CONTINUE

JS-CONVERT-OP-NAME (OP)

JS-CREATE (&REST ARGS)

JS-CSS-INLINE (&REST FORMS)

JS-DECF (X &OPTIONAL (DELTA 1))

JS-DEFUN (NAME ARGS &REST BODY)

JS-DEFVAR (NAME &OPTIONAL VALUE)

JS-DELETE (VALUE)

JS-DO (DECLS TERMINATION &REST BODY)

JS-DOEACH (DECL &REST BODY)

JS-FALSE

JS-GENSYM (&OPTIONAL (NAME js))

JS-GET-COMPILER-MACRO (NAME)

JS-HTML (&REST FORMS)

JS-IF (TEST THEN &OPTIONAL ELSE)

JS-INCF (X &OPTIONAL (DELTA 1))

JS-INSTANCEOF (VALUE TYPE)

JS-JS (&REST BODY)

JS-JS-INLINE (&REST BODY)

JS-LAMBDA (ARGS &REST BODY)

JS-LET (DECLS &REST BODY)

JS-MACROLET (MACROS &REST BODY)

JS-NEW (VALUE)

JS-NIL

JS-NOT (X)

JS-PROGN (&REST BODY)

JS-REGEX (REGEX)

JS-RETURN (VALUE)

JS-SETF (&REST ARGS)

JS-SLOT-VALUE (OBJ SLOT)

JS-SWITCH (VALUE &REST CLAUSES)

JS-T

JS-THIS

JS-THROW (VALUE)

JS-TRY (BODY &REST CLAUSES)

JS-TYPEOF (VALUE)

JS-UNDEFINED

JS-VOID (VALUE)

JS-WHILE (CHECK &REST BODY)

JS-WITH (STATEMENT &REST BODY)

JS-{} (&REST VALUES)

KLAMMER (STRING-LIST)

LISP-SPECIAL-CHAR-TO-JS (LISP-CHAR)

LIST-JOIN (LIST ELT)

LIST-TO-STRING (LIST)

MAKE-CSS-RULE (SELECTORS PROPERTIES)

MAKE-FOR-STEPS (DECLS)

MAKE-FOR-VARS (DECLS)

MAKE-JS-TEST (LHS RHS)

METHOD-CALL-P (FORM)

OP-FORM-P (FORM)

OP-PRECEDENCE (OP)

OPTIMIZE-STRING-LIST (LIST)

PREPEND-TO-FIRST (FORM ELT)

PROCESS-CSS-FORMS (PROPLIST)

PROCESS-HTML-FORMS (FORMS)

PROPVAL-TO-STRING (PROPVAL)

SPECIAL-APPEND-TO-LAST (FORM ELT)

STRING-CHARS (STRING)

STRING-JOIN (STRINGS ELT)

STRING-SPLIT (STRING SEPARATORS)

SYMBOL-TO-JS (SYMBOL)

UNDEFINE-JS-COMPILER-MACRO (NAME)

UNTOUCHABLE-STRING-P (STRING)

VAL-TO-STRING (VAL)

MACRO

Public

CASE (KEYFORM &BODY CASES)

CASE Keyform {({(Key*) | Key} Form*)}* Evaluates the Forms in the first clause with a Key EQL to the value of Keyform. If a singleton key is T then the clause is a default clause.

DECF (PLACE &OPTIONAL (DELTA 1) &ENVIRONMENT ENV)

The first argument is some location holding a number. This number is decremented by the second argument, DELTA, which defaults to 1.

DEFJSMACRO (NAME ARGS &REST BODY)

Define a javascript macro, and store it in the toplevel macro environment.

DEFUN (&ENVIRONMENT ENV NAME ARGS &BODY BODY)

Define a function at top level.

DEFVAR (VAR &OPTIONAL (VAL NIL VALP) (DOC NIL DOCP))

Define a special variable at top level. Declare the variable SPECIAL and, optionally, initialize it. If the variable already has a value, the old value is not clobbered. The third argument is an optional documentation string for the variable.

DO (VARLIST ENDLIST &BODY BODY)

DO ({(Var [Init] [Step])}*) (Test Exit-Form*) Declaration* Form* Iteration construct. Each Var is initialized in parallel to the value of the specified Init form. On subsequent iterations, the Vars are assigned the value of the Step form (if any) in parallel. The Test is evaluated before each evaluation of the body Forms. When the Test is true, the Exit-Forms are evaluated as a PROGN, with the result being the value of the DO. A block named NIL is established around the entire expansion, allowing RETURN to be used as an alternate exit mechanism.

INCF (PLACE &OPTIONAL (DELTA 1) &ENVIRONMENT ENV)

The first argument is some location holding a number. This number is incremented by the second argument, DELTA, which defaults to 1.

JS* (&REST BODY)

Return the javascript string representing BODY. Body is evaluated.

JS-INLINE* (&REST BODY)

Just like JS-INLINE except that BODY is evaluated before being converted to javascript.

SETF (&REST ARGS &ENVIRONMENT ENV)

Takes pairs of arguments like SETQ. The first is a place and the second is the value that is supposed to go into that place. Returns the last value. The place argument may be any of the access forms for which SETF knows a corresponding setting form.

UNLESS (TEST &BODY FORMS)

If the first argument is not true, the rest of the forms are evaluated as a PROGN.

WHEN (TEST &BODY FORMS)

If the first argument is true, the rest of the forms are evaluated as a PROGN.

WITH-UNIQUE-JS-NAMES (SYMBOLS &BODY BODY)

Evaluate BODY with the variables on SYMBOLS bound to new javascript identifiers. Each element of SYMBOLS is either a symbol or a list of (symbol prefix).

Undocumented

AND (&REST FORMS)

CSS (&REST RULES)

CSS-FILE (&REST RULES)

CSS-INLINE (&REST PROPVALS)

DOLIST ((VAR LIST &OPTIONAL (RESULT NIL)) &BODY BODY &ENVIRONMENT ENV)

DOTIMES ((VAR COUNT &OPTIONAL (RESULT NIL)) &BODY BODY)

JS (&REST BODY)

JS-FILE (&REST BODY)

JS-INLINE (&REST BODY)

JS-SCRIPT (&REST BODY)

LAMBDA (&WHOLE WHOLE ARGS &BODY BODY)

OR (&REST FORMS)

RETURN (&OPTIONAL (VALUE NIL))

WITH-SLOTS (SLOTS INSTANCE &BODY BODY)

Private

DEFINE-JS-COMPILER-MACRO (NAME LAMBDA-LIST &REST BODY)

Define a javascript compiler macro NAME. Arguments are destructured according to LAMBDA-LIST. The resulting JS language types are appended to the ongoing javascript compilation.

DEFJSKEYWORD (NAME STRING)

Define a Javascript keyword that will expand to STRING.

DEFJSLITERAL (NAME STRING)

Define a Javascript literal that will expand to STRING.

Undocumented

CSS-RULE (SELECTORS &REST PROPERTIES)

DEFINE-JS-SINGLE-OP (NAME &OPTIONAL (SUPERCLASS 'EXPRESSION))

DEFJSCLASS (NAME SUPERCLASSES SLOTS &REST CLASS-OPTIONS)

GENERIC-FUNCTION

Public

JS-TO-STATEMENT-STRINGS (CODE-FRAGMENT START-POS)

Transform an enscript-javascript code fragment to a string

JS-TO-STRINGS (EXPRESSION START-POS)

Transform an enscript-javascript expression to a string

Private

EXPRESSION-PRECEDENCE (EXPRESSION)

Returns the precedence of an enscript-javascript expression

FUNCTION-START-STRING (FUNCTION)

Returns the string that starts the function - this varies according to whether this is a lambda or a defun

JS-EQUAL (OBJ1 OBJ2)

Determine if two enscript-javascript statements are equivalent

SLOT-ACCESSOR

Private

Undocumented

AREF-ARRAY (OBJECT)

SETFAREF-ARRAY (NEW-VALUE OBJECT)

AREF-INDEX (OBJECT)

SETFAREF-INDEX (NEW-VALUE OBJECT)

ARRAY-VALUES (OBJECT)

SETFARRAY-VALUES (NEW-VALUE OBJECT)

B-INDENT (OBJECT)

SETFB-INDENT (NEW-VALUE OBJECT)

B-STMTS (OBJECT)

SETFB-STMTS (NEW-VALUE OBJECT)

CASE-CLAUSES (OBJECT)

SETFCASE-CLAUSES (NEW-VALUE OBJECT)

CASE-VALUE (OBJECT)

SETFCASE-VALUE (NEW-VALUE OBJECT)

CC-IF-BODY (OBJECT)

SETFCC-IF-BODY (NEW-VALUE OBJECT)

CC-IF-TEST (OBJECT)

SETFCC-IF-TEST (NEW-VALUE OBJECT)

COND-BODIES (OBJECT)

SETFCOND-BODIES (NEW-VALUE OBJECT)

COND-TESTS (OBJECT)

SETFCOND-TESTS (NEW-VALUE OBJECT)

DEFUN-NAME (OBJECT)

SETFDEFUN-NAME (NEW-VALUE OBJECT)

F-ARGS (OBJECT)

SETFF-ARGS (NEW-VALUE OBJECT)

F-FUNCTION (OBJECT)

SETFF-FUNCTION (NEW-VALUE OBJECT)

FE-BODY (OBJECT)

SETFFE-BODY (NEW-VALUE OBJECT)

FE-NAME (OBJECT)

SETFFE-NAME (NEW-VALUE OBJECT)

FE-VALUE (OBJECT)

SETFFE-VALUE (NEW-VALUE OBJECT)

FOR-BODY (OBJECT)

SETFFOR-BODY (NEW-VALUE OBJECT)

FOR-CHECK (OBJECT)

SETFFOR-CHECK (NEW-VALUE OBJECT)

FOR-STEPS (OBJECT)

SETFFOR-STEPS (NEW-VALUE OBJECT)

FOR-VARS (OBJECT)

SETFFOR-VARS (NEW-VALUE OBJECT)

IF-ELSE (OBJECT)

SETFIF-ELSE (NEW-VALUE OBJECT)

IF-TEST (OBJECT)

SETFIF-TEST (NEW-VALUE OBJECT)

IF-THEN (OBJECT)

SETFIF-THEN (NEW-VALUE OBJECT)

LAMBDA-ARGS (OBJECT)

SETFLAMBDA-ARGS (NEW-VALUE OBJECT)

LAMBDA-BODY (OBJECT)

SETFLAMBDA-BODY (NEW-VALUE OBJECT)

M-ARGS (OBJECT)

SETFM-ARGS (NEW-VALUE OBJECT)

M-METHOD (OBJECT)

SETFM-METHOD (NEW-VALUE OBJECT)

M-OBJECT (OBJECT)

SETFM-OBJECT (NEW-VALUE OBJECT)

O-SLOTS (OBJECT)

SETFO-SLOTS (NEW-VALUE OBJECT)

OBJECT-VALUES (OBJECT)

SETFOBJECT-VALUES (NEW-VALUE OBJECT)

ONE-OP (OBJECT)

SETFONE-OP (NEW-VALUE OBJECT)

ONE-OP-PRE-P (OBJECT)

SETFONE-OP-PRE-P (NEW-VALUE OBJECT)

OP-ARGS (OBJECT)

SETFOP-ARGS (NEW-VALUE OBJECT)

OPERATOR (OBJECT)

SETFOPERATOR (NEW-VALUE OBJECT)

SETF-LHS (OBJECT)

SETFSETF-LHS (NEW-VALUE OBJECT)

SETF-RHSIDES (OBJECT)

SETFSETF-RHSIDES (NEW-VALUE OBJECT)

SV-OBJECT (OBJECT)

SETFSV-OBJECT (NEW-VALUE OBJECT)

SV-SLOT (OBJECT)

SETFSV-SLOT (NEW-VALUE OBJECT)

TRY-BODY (OBJECT)

SETFTRY-BODY (NEW-VALUE OBJECT)

TRY-CATCH (OBJECT)

SETFTRY-CATCH (NEW-VALUE OBJECT)

TRY-FINALLY (OBJECT)

SETFTRY-FINALLY (NEW-VALUE OBJECT)

VALUE (OBJECT)

SETFVALUE (NEW-VALUE OBJECT)

VAR-NAMES (OBJECT)

SETFVAR-NAMES (NEW-VALUE OBJECT)

VAR-VALUE (OBJECT)

SETFVAR-VALUE (NEW-VALUE OBJECT)

WHILE-BODY (OBJECT)

SETFWHILE-BODY (NEW-VALUE OBJECT)

WHILE-CHECK (OBJECT)

SETFWHILE-CHECK (NEW-VALUE OBJECT)

WITH-BODY (OBJECT)

SETFWITH-BODY (NEW-VALUE OBJECT)

WITH-OBJ (OBJECT)

SETFWITH-OBJ (NEW-VALUE OBJECT)

VARIABLE

Public

* (&REST NUMBERS)

the value of the most recent top level EVAL

+ (&REST NUMBERS)

the value of the most recent top level READ

++

the previous value of +

- (NUMBER &REST MORE-NUMBERS)

the form currently being evaluated

/ (NUMBER &REST MORE-NUMBERS)

a list of all the values returned by the most recent top level EVAL

Private

*JS-COMPILER-MACROS*

*JS-COMPILER-MACROS* is a hash-table containing the functions corresponding to javascript special forms, indexed by their name. Javascript special forms are compiler macros for JS expressions.

*JS-MACRO-ENV*

Current macro environment.

*JS-MACRO-TOPLEVEL*

Toplevel of macro expansion, holds all the toplevel javascript macros.

*JS-QUOTE-CHAR*

Specifies which character JS sholud use for delimiting strings. This variable is usefull when have to embed some javascript code in an html attribute delimited by #\" as opposed to #\', or vice-versa.

Undocumented

*GEN-JS-NAME-COUNTER*

*JS-LISP-ESCAPED-CHARS*

*OP-PRECEDENCE-HASH*

*SPECIAL-CHARS*

*VAR-COUNTER*

CLASS

Public

Undocumented

ARRAY

CC-IF

LIST (&REST ARGS)

REGEX

T

Private

Undocumented

ARRAY-LITERAL

EXPRESSION

FOR-EACH

FUNCTION-CALL

JS-AREF (ARRAY &REST COORDS)

JS-BODY

JS-COND (&REST CLAUSES)

JS-DEFUN (NAME ARGS &REST BODY)

JS-DEFVAR (NAME &OPTIONAL VALUE)

JS-DELETE (VALUE)

JS-FOR

JS-IF (TEST THEN &OPTIONAL ELSE)

JS-INSTANCEOF (VALUE TYPE)

JS-LAMBDA (ARGS &REST BODY)

JS-NEW (VALUE)

JS-OBJECT

JS-QUOTE

JS-RETURN (VALUE)

JS-SETF (&REST ARGS)

JS-SLOT-VALUE (OBJ SLOT)

JS-SUB-BODY

JS-SWITCH (VALUE &REST CLAUSES)

JS-THROW (VALUE)

JS-TRY (BODY &REST CLAUSES)

JS-TYPEOF (VALUE)

JS-VARIABLE

JS-VOID (VALUE)

JS-WHILE (CHECK &REST BODY)

JS-WITH (STATEMENT &REST BODY)

METHOD-CALL

NUMBER-LITERAL

OBJECT-LITERAL

ONE-OP (OBJECT)

OP-FORM

STATEMENT

STRING-LITERAL

CONSTANT

Public

Undocumented

T