Constructor.
the variable binding environment
the stream manager for trace and spy output
the initial call depth
the plugin chain consulted before falling through to Applier
The initial value of Object.prototype.constructor is the standard built-in Object constructor.
The current call depth, used for indenting trace/spy output.
The variable binding environment used during evaluation.
Registered plugins consulted by eval when no special form matches.
The stream manager used for trace and spy output.
Static ReadonlybuildLisp-name to method-name dispatch map for special forms.
Static ReadonlymacroMarker symbol stored as the car of the Cons that represents a macro binding,
distinguishing macros from ordinary lambda closures in the environment.
Counts the number of distinct bindings for the given symbol along the environment chain.
the symbol whose bindings are inspected
the number of distinct bindings found
Implementation of the Lisp case special form. Evaluates the key form and
runs the body of the first clause whose (unevaluated) keys match the key;
a clause head of t or otherwise always matches.
the argument Cons containing the key form and the clauses
the value of the matching clause's last body form, or nil
Returns whether a case clause head matches the given key. A head of t
or otherwise always matches; a list head matches when any of its
(unevaluated) elements is identical to the key; an atom head matches when
it is identical to the key. A nil head never matches (CL semantics).
a boolean
Implementation of the Lisp catch special form. Evaluates the tag form,
then the body; a throw to an eq tag during the body unwinds to here
and its value becomes the result.
the argument Cons containing the tag form and the body
the value of the last body form, or the thrown value
Parses a lambda source string, captures the current environment, and binds
the resulting closure under the given name (used by defstruct).
the function name to bind
the lambda source string
Implementation of the Lisp defmacro special form. Defines a macro: a
transformer whose body receives its arguments unevaluated and returns a
form that is then evaluated in the caller's environment.
the argument Cons containing the macro name, parameter list, and body
the macro name symbol
Implementation of the Lisp defstruct special form. Defines a structure
type represented as a tagged list (name field1 field2 ...) and generates
a positional constructor make-<name>, a predicate <name>-p, and one
accessor <name>-<field> per field. Accessors are registered as setf
places. (Keyword-argument constructors arrive with the keyword type.)
the argument Cons containing the struct name and the field symbols
the struct name symbol
Implementation of the Lisp destructuring-bind special form. Binds the
symbols of a (possibly nested or dotted) pattern to the corresponding
parts of the evaluated expression and evaluates the body.
the argument Cons containing the pattern, the expression, and the body
the value of the last body form
Evaluates the argument list (the same way entrustApplier does), then
delegates the call to the matched plugin with a context that allows
recursive evaluation.
the plugin that claimed the call symbol
the call form whose car is the symbol and whose cdr is the argument list
the result returned by the plugin
Evaluates a form in tail position. Tail-transparent special forms
(if, cond, case, when, unless, progn, let, let*) are
unwound iteratively, macros are expanded in place, and a call to a user
lambda returns a TailCall sentinel instead of recursing — the Applier's
lambda-application loop then applies it iteratively (TCO).
the form to evaluate in tail position
the evaluation result, or a TailCall sentinel
Resolves the value bound to the given symbol in the current environment.
the symbol to resolve
the value bound to the symbol
Implementation of the Lisp exit special form; terminates the REPL by throwing an ExitError.
Returns the first handler-case clause matching the given error, or null.
the clause list of a handler-case form
the signaled error
the matching clause Cons, or null
Implementation of the Lisp gc special form; triggers garbage collection and returns memory usage.
an association list of memory usage statistics
Implementation of the Lisp handler-case special form (the common subset
of CL handler-case / Scheme guard / Clojure try-catch). Evaluates
the protected form; when it signals an error, runs the body of the first
clause whose type matches — error matches any interpreter error,
parse-error / eval-error match the specific families. The clause
variable (when given) is bound to the error message string. throw
signals and exit are not errors and pass through untouched.
the argument Cons containing the protected form and the clauses
the value of the protected form, or of the matching clause body
Returns whether a handler-case clause type symbol matches the error.
the clause type designator
the signaled error
a boolean
Determines whether an object has a property with the specified name.
A property name.
Shared implementation of incf / decf: reads a numeric place, adds the
(optional, default 1) delta with the given sign, and writes it back.
the argument Cons containing the place and an optional delta form
+1 for incf, -1 for decf
the new value of the place
Returns the indentation string used for trace and spy output at the current depth.
the indentation string
Determines whether an object exists in another object's prototype chain.
Another object whose prototype chain is to be checked.
Returns whether the given symbol is currently being spied on.
the symbol to check
a boolean
Implementation of the Lisp lambda special form; captures the current environment as a closure.
The environment Table is appended after the last body form (the same
layout defineDerivedLambda produces), so a body of any length is kept.
the argument Cons containing the parameter list and body
a lambda form with the captured environment appended
Implementation of the Lisp macroexpand special form. Evaluates its
argument to obtain a form and repeatedly expands it until the result is no
longer a macro call, without evaluating the result.
the argument Cons whose car evaluates to the form to expand
the fully expanded form
Implementation of the Lisp macroexpand-1 special form. Evaluates its
argument to obtain a form and, when that form is a macro call, expands it
exactly once without evaluating the result.
the argument Cons whose car evaluates to the form to expand
the once-expanded form, or the form unchanged when it is not a macro call
Implementation of the Lisp notrace special form; disables tracing.
the symbol t
Determines whether a specified property is enumerable.
A property name.
Implementation of the Lisp quasiquote (`) special form. Returns the
template with every unquote (,) and unquote-splicing (,@) at the
matching nesting level replaced by the evaluation of its operand. Nested
quasiquotes increase the level so inner unquotes are preserved.
the argument Cons whose car is the template
the constructed form
Runs the body of a matched handler-case clause, binding its optional
variable to the error message string.
the matched clause Cons: (type (var?) body...)
the signaled error
the value of the last body form
Sets the current call depth used for trace and spy indentation.
the new depth
Appends the elements of a spliced value (,@) onto the accumulator. The
value must be a proper list (or nil); an atom or an improper (dotted) list
is rejected rather than silently dropping the dotted tail.
Writes a trace/spy line to the given stream (or stdout) with the current indentation.
the destination stream, or null/string to fall back to stdout
the line to write
Walks cond clauses in tail position: evaluates each test and returns the
matching clause's last body form as the tail step (or the test value for
an empty consequent, matching cond's behavior).
the clause list
a tail step record or a finished value
Selects the tail form of a tail-transparent special form, evaluating any non-tail parts (tests, bindings, leading body forms) along the way.
the special-form call
a finished value, the next form (with its table) to evaluate in tail position, or null when the operator is not tail-transparent
Implementation of the Lisp terpri special form; writes a newline to stdout.
the symbol t
Implementation of the Lisp throw special form. Evaluates the tag and
value forms and unwinds to the nearest dynamically enclosing catch
whose tag is eq to the thrown tag.
the argument Cons containing the tag form and the value form
Implementation of the Lisp time special form; measures evaluation time in milliseconds.
the argument Cons whose car is the form to time
the elapsed time in milliseconds
Returns a date converted to a string using the current locale.
Returns a string representation of an object.
Implementation of the Lisp trace special form; enables tracing.
the symbol t
Implementation of the Lisp unquote (,) special form. Signals an error
because unquote is only meaningful inside a quasiquote template.
Implementation of the Lisp unquote-splicing (,@) special form. Signals
an error because unquote-splicing is only meaningful inside a quasiquote
template.
Returns the primitive value of the specified object.
Implementation of the Lisp with-output-to-string special form. Evaluates
the body while capturing program output (princ, print, terpri,
format) and returns the captured text as a string. The CL stream
variable list is accepted for compatibility but no stream is bound
(kei-lisp has no stream objects yet), so it must be empty or is ignored.
the argument Cons containing an optional stream variable list and the body
the captured output string
Implements (setf (getf plist key) value). When the property list already
contains the key its value cell is mutated; otherwise a new (key value)
pair is appended. An empty property list is only supported when the plist
form is a symbol, which is then rebound to the fresh list.
the stored value
Writes a value into a generalized place (a setf-able location): a symbol,
(car x), (cdr x), (nth n x), (elt x n), (getf sym key), or a
struct field accessor generated by defstruct.
the stored value
StaticassignCopy the values of all of the enumerable own properties from one or more source objects to a target object. Returns the target object.
The target object to copy to.
One or more source objects from which to copy properties
StaticcreateCreates an object that has the specified prototype or that has null prototype.
Object to use as a prototype. May be null.
Creates an object that has the specified prototype, and that optionally contains specified properties.
Object to use as a prototype. May be null
JavaScript object that contains one or more property descriptors.
StaticdefineAdds one or more properties to an object, and/or modifies attributes of existing properties.
Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.
JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.
StaticdefineAdds a property to an object, or modifies attributes of an existing property.
Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.
The property name.
Descriptor for the property. It can be for a data property or an accessor property.
StaticentriesReturns an array of key/values of the enumerable own properties of an object
Returns an array of key/values of the enumerable own properties of an object
Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
StaticevalEvaluates the given form in the given environment.
the form to evaluate
the variable binding environment
the stream manager for trace and spy output
the current call depth
the plugin chain consulted before falling through to Applier
the evaluation result
StaticfreezePrevents the modification of existing property attributes and values, and prevents the addition of new properties.
Object on which to lock the attributes.
StaticfromReturns an object created by key-value entries for properties and methods
An iterable object that contains key-value entries for properties and methods.
StaticgetGets the own property descriptor of the specified object. An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.
Object that contains the property.
Name of the property.
StaticgetReturns an object containing all own property descriptors of an object
Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
StaticgetReturns the names of the own properties of an object. The own properties of an object are those that are defined directly on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.
Object that contains the own properties.
StaticgetReturns an array of all symbol properties found directly on object o.
Object to retrieve the symbols from.
StaticgetReturns the prototype of an object.
The object that references the prototype.
StatichasDetermines whether an object has a property with the specified name.
An object.
A property name.
StaticisReturns true if the values are the same value, false otherwise.
The first value.
The second value.
StaticisReturns a value that indicates whether new properties can be added to an object.
Object to test.
StaticisReturns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.
Object to test.
StaticisReturns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.
Object to test.
StaticisReturns whether the given value is a user lambda closure (a lambda Cons with a captured environment) rather than a macro or plain data.
the environment binding to inspect
a boolean
StatickeysReturns the names of the enumerable string properties and methods of an object.
Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
Returns the names of the enumerable string properties and methods of an object.
Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
StaticpreventStaticsealStaticsetSets the prototype of a specified object o to object proto or null. Returns the object o.
The object to change its prototype.
The value of the new prototype or null.
StaticsetupBuilds and returns the Lisp-name to method-name dispatch map for special forms.
the dispatch map
StaticvaluesReturns an array of values of the enumerable own properties of an object
Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
Classdesc
Class that mimics Lisp's universal function Evaluate.
Author
Keisuke Ikeda
This