Common Lisp Package: DOPLUS

README:

FUNCTION

Public

MAKE-ITERATION (&KEY BINDINGS INITIALIZATIONS STEPS PRECONDITIONS POSTCONDITIONS)

General iteration clause generator.

MAKE-SIMPLE-ITERATION (&KEY (VAR *ITERATION-VARIABLE*) INIT (STEP NIL STEP-P) PRECONDITION POSTCONDITION)

Specialized iteration clause generator, where the iteration clause refers to a single variable, possibly with an initial value, step form, precondition, or postcondition.

Undocumented

MAKE-BINDING (VAR &KEY (DEFAULT NIL DEFAULT-PROVIDED?))

MAKE-EPILOGUE (&KEY ((FORM DUM368) NIL))

MAKE-FINALIZATION (&KEY ((FORM DUM258) NIL))

MAKE-INITIALIZATION (&KEY ((FORM DUM186) NIL))

MAKE-PROLOGUE (&KEY ((FORM DUM332) NIL))

MAKE-RESULT (&KEY ((FORM DUM74) NIL))

MAKE-STEP (&KEY ((FORM DUM222) NIL))

MAKE-TERMINATION (&KEY ((CONDITION DUM38) NIL))

Private

ACCUMULATOR-FUNCTION (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

ACCUMULATOR-VAR (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

BINDING-DEFAULT (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

BINDING-DEFAULT-PROVIDED? (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

BINDING-VAR (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DECLARATION-FORM (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DOPLUS-ENV-ACCUMULATORS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DOPLUS-ENV-DEFAULT-COLLECT-VAR (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DOPLUS-ENV-GENERATORS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DOPLUS-ENV-LOOP-NAME (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DOPLUS-ENV-PARENT (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DOPLUS-ENV-SKIP-LABEL (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DOPLUS-ENV-TERMINATE-LABEL (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

ENSURE-LIST (OBJ)

(if (listp obj) obj (list obj))

EPILOGUE-FORM (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

EXPAND-WITH-SIMPLE-DESTRUCTURING (FORM ENV)

Expand `form' in `env' as an iteration form that assigns to `*iteration-variable*' destructuring as by `destructuring-bind'.

FINALIZATION-FORM (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

GENERATOR-CLAUSES (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

GENERATOR-NAME (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

INITIALIZATION-FORM (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

OPTIONS-MAP (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

PROLOGUE-FORM (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

RESULT-FORM (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

STEP-FORM (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

TERMINATION-CONDITION (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

WRAPPER-FUNCTION (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

Undocumented

%MAKE-BINDING (&KEY ((VAR DUM110) NIL) ((DEFAULT DUM111) NIL) ((DEFAULT-PROVIDED? DUM112) NIL))

SETFACCUMULATOR-FUNCTION (NEW-VALUE INSTANCE)

ACCUMULATOR-P (OBJECT)

SETFACCUMULATOR-VAR (NEW-VALUE INSTANCE)

SETFBINDING-DEFAULT (NEW-VALUE INSTANCE)

SETFBINDING-DEFAULT-PROVIDED? (NEW-VALUE INSTANCE)

BINDING-P (OBJECT)

SETFBINDING-VAR (NEW-VALUE INSTANCE)

COPY-ACCUMULATOR (INSTANCE)

COPY-BINDING (INSTANCE)

COPY-DECLARATION (INSTANCE)

COPY-DOPLUS-ENV (INSTANCE)

COPY-EPILOGUE (INSTANCE)

COPY-FINALIZATION (INSTANCE)

COPY-GENERATOR (INSTANCE)

COPY-INITIALIZATION (INSTANCE)

COPY-OPTIONS (INSTANCE)

COPY-PROLOGUE (INSTANCE)

COPY-RESULT (INSTANCE)

COPY-STEP (INSTANCE)

COPY-TERMINATION (INSTANCE)

COPY-WRAPPER (INSTANCE)

SETFDECLARATION-FORM (NEW-VALUE INSTANCE)

DECLARATION-P (OBJECT)

SETFDOPLUS-ENV-ACCUMULATORS (NEW-VALUE INSTANCE)

SETFDOPLUS-ENV-DEFAULT-COLLECT-VAR (NEW-VALUE INSTANCE)

SETFDOPLUS-ENV-GENERATORS (NEW-VALUE INSTANCE)

SETFDOPLUS-ENV-LOOP-NAME (NEW-VALUE INSTANCE)

DOPLUS-ENV-P (OBJECT)

SETFDOPLUS-ENV-PARENT (NEW-VALUE INSTANCE)

SETFDOPLUS-ENV-SKIP-LABEL (NEW-VALUE INSTANCE)

SETFDOPLUS-ENV-TERMINATE-LABEL (NEW-VALUE INSTANCE)

SETFEPILOGUE-FORM (NEW-VALUE INSTANCE)

EPILOGUE-P (OBJECT)

EXTRACT-VARIABLES (LAMBDA-LIST)

SETFFINALIZATION-FORM (NEW-VALUE INSTANCE)

FINALIZATION-P (OBJECT)

FIND-GENERATOR (NAME ENV)

FIND-LOOP-IN-ENV (NAME ENV)

SETFGENERATOR-CLAUSES (NEW-VALUE INSTANCE)

SETFGENERATOR-NAME (NEW-VALUE INSTANCE)

GENERATOR-P (OBJECT)

SETFINITIALIZATION-FORM (NEW-VALUE INSTANCE)

INITIALIZATION-P (OBJECT)

MAKE-ACCUMULATOR (&KEY ((VAR DUM294) NIL) ((FUNCTION DUM295) NIL))

MAKE-DECLARATION (&KEY ((FORM DUM150) NIL))

MAKE-DESTRUCTURING-FORM (LAMBDA-LIST EXPRESSION)

MAKE-DOPLUS-ENV (&KEY ((LOOP-NAME DUM1307) NIL) ((SKIP-LABEL DUM1308) NIL) ((TERMINATE-LABEL DUM1309) NIL) ((DEFAULT-COLLECT-VAR DUM1310) NIL) ((ACCUMULATORS DUM1311) NIL) ((GENERATORS DUM1312) NIL) ((PARENT DUM1313) NIL))

MAKE-GENERATOR (&KEY ((NAME DUM0) NIL) ((CLAUSES DUM1) NIL))

MAKE-OPTIONS (&KEY ((MAP DUM440) NIL))

MAKE-WRAPPER (&KEY ((FUNCTION DUM404) NIL))

SETFOPTIONS-MAP (NEW-VALUE INSTANCE)

OPTIONS-P (OBJECT)

SETFPROLOGUE-FORM (NEW-VALUE INSTANCE)

PROLOGUE-P (OBJECT)

SETFRESULT-FORM (NEW-VALUE INSTANCE)

RESULT-P (OBJECT)

SETFSTEP-FORM (NEW-VALUE INSTANCE)

STEP-P (OBJECT)

SETFTERMINATION-CONDITION (NEW-VALUE INSTANCE)

TERMINATION-P (OBJECT)

SETFWRAPPER-FUNCTION (NEW-VALUE INSTANCE)

WRAPPER-P (OBJECT)

MACRO

Public

ACCUMULATING-TO (VARS &KEY INITIALLY BY FINALLY)

Specifies an accumulation clause. Refer to the manual for details.

ACCUMULATING-TO-AND-RETURNING (VARS &REST ARGS &KEY INITIALLY BY FINALLY)

Same as accumulating-into, but also returns the value of each <vars> at the end of the loop.

ACROSS (VECTOR &REST ARGS &KEY INDEX START END BY)

Synonym for in-vector.

BEING (FORM &KEY (THEN FORM))

Assigns to the iteration variable a value computed by evaluating FORM on each iteration, including the first. Optionally, the variable can be updated evaluating a differen form (the value of the `then' parameter). Examples: (for x (being (random))), (for y (being 'quiet :then (if (> x 0.5) 'angry 'quiet))).

COLLECT (VALUE &KEY INTO)

Collects a value into an accumulator. If no accumulator is provided, the default one for the current do+ loop is used.

COLLECTING-INTO (VARS &REST ARGS &KEY INITIALLY BY FINALLY)

Synonym for accumulating-to.

COLLECTING-INTO-AND-RETURNING (VARS &REST ARGS &KEY INITIALLY BY FINALLY)

Same as collecting-into, but also returns the value of each <vars> at the end of the loop.

COUNTING (VAR)

Counts the number of iterations, starting from 0.

DEFCLAUSE (NAME ARGLIST &BODY BODY)

Same as cl:defmacro, but additionally records <name> in *clauses* as a known clause macro.

DO+ ((&REST ITER-FORMS) &BODY BODY)

High-level, extensible iteration construct. Refer to the manual for syntax and semantics.

FINALLY (&REST FORMS)

Evaluates <form> after the last iteration, before returning a value.

FINDING (VAR CONDITION)

Same as FOR, but perhaps nicer to read when used in conjunction with macros like MAXIMIZING.

FOR (VAR-OR-VARS ITERATION &ENVIRONMENT ENV)

General iteration clause. Its actual behaviour is controlled by ITERATION, a macro form that FOR expands with *ITERATION-VARIABLE* bound to VAR. Example: in (for x (in '(1 2 3))), IN is a macro that expands into clauses that make use of *ITERATION-VARIABLE*, which is bound to the symbol X in the example. For certain iteration macros, VAR can be a lambda-list as well, in which case destructuring is applied. Example: (for (x &optional y) (in-list '((1 2) (3)))).

FROM (INITIAL-VALUE &KEY TO BY WHILE (USING ''+))

Iterates from a given initial value to an optional maximum. Every iteration increments/decrements the value applying the <using> function (by default +) to the previous value and <by> (by default 1 or -1, depending on whether to >= from or not). Similarly, the <while> function is used to determine if <to> has been reached or surpassed. <while> is a function of two arguments, the current value and the value of <to>, and as soon as it returns false, the loop is terminated. <while> defaults to a function that returns true only if <to> has been specified and, letting cur be the current value, (<= (min to from) cur (max to from)).

GENERATING (VAR ITERATION)

Lazy version of FOR. The user must call UPDATE or TRY-UPDATE in the body of the DO+ form in order to compute new values for the variable(s). Initialization, instead, is *always* performed eagerly.

HASH-ENTRIES-OF (HASH-TABLE)

Iterates over the entries of a hash table. The iteration variables must be specified as (key value), for example: (for (lemma definitions) (hash-entries-of the-english-vocabulary)).

IN (&WHOLE FORM SEQ &REST ARGS &KEY &ALLOW-OTHER-KEYS &ENVIRONMENT ENV)

Iterates over a sequence. IN must be used in combination with FOR, GENERATING and similar macros (those that bind *ITERATION-VARIABLE*). In implementations with extensible sequences (currently ABCL and SBCL), native sequence iterators are used, and all sequence types are supported, not just lists and vectors. In other implementations, an iterator specialized for lists or vectors is used depending on the type of sequence. All `args` are passed down to make-sequence-iterator (see the extensible sequences API paper for details [Rhodes2007]). IN can perform destructuring.

IN-LIST (&WHOLE FORM LIST &KEY (BY '#'CDR) (REST (GENSYM REST)) &ENVIRONMENT ENV)

Like IN, but specialized for lists. Successive lists are obtained by calling the function BY (which by default is #'CDR) on the previous list. REST, if specified, is the variable holding the remaining elements to be processed; REST initially is bound to the entire list, then to successive lists obtained by funcalling BY.

IN-VECTOR (VECTOR &KEY (INDEX (GENSYM INDEX)) (START 0) END (BY 1))

Loops across a vector. INDEX is bound to the index of the current element in the vector. The vector is traversed starting from index START (0 by default) to index END (the end of the vector if not specified); the index is incremented by BY (1 by default) on each iteration.

INITIALLY (&REST FORMS)

Evaluates <form> before the first iteration.

LIST-TAILS (&WHOLE FORM LIST &KEY (BY '#'CDR) &ENVIRONMENT ENV)

Loops over the successive tails of a list, checking for the end of the list as if by ATOM. Can perform destructuring.

MAXIMIZING (FORM &KEY (TEST ''>) SAVING IN)

Synonym for optimizing.

MINIMIZING (FORM &KEY (TEST ''<) SAVING IN)

Same as optimizing but with < as the default test.

OPTIMIZING (FORM &KEY (TEST ''>) SAVING IN)

Finds the optimum value of an expression across the iteration. Refer to the manual for details.

PREVIOUS (EXPR)

On every iteration, the for-variable is set to the value <expr> had at the end of the previous iteration (initially NIL).

RETURNING (FORM)

Returns <form> as the value of the do+ form when the loop ends. If multiple return clauses are specified, multiple values are returned, in the same order as the corresponding clauses.

SKIP (&OPTIONAL LOOP-NAME)

Skips the current iteration. Refers to the current loop or, if loop-name is specified, to the closest surrounding loop with that name.

STOP-WHEN (CONDITION)

Synonym for until.

SUM (VALUE &KEY (TO (ERROR sum requires a target accumulator (:to key))))

Syntactic sugar for collect, intended to be used when the accumulator computes a sum.

SUMMING-TO (VARS &OPTIONAL RESULT-PROCESSOR)

Specifies an accumulation strategy with 0 as the default value and + as the accumulator function.

SUMMING-TO-AND-RETURNING (VARS &OPTIONAL RESULT-PROCESSOR)

Same as summing-to, but also returns the value of each <vars> at the end of the loop.

SYMBOLS-IN (PACKAGE-OR-PACKAGES &REST SYMBOL-TYPES)

Iterates over the symbols in one or more packages. Symbol-types follows the specification of cl:with-package-iterator.

TERMINATE (&OPTIONAL LOOP-NAME RETURN-VALUE)

Immediately terminates the loop. Refers to the current loop or, if loop-name is specified and non-NIL, to the closest surrounding loop with that name. Can optionally specify a return value for the loop, which, if provided, will override the loop's ordinary return value.

TO (FINAL-VALUE &KEY (FROM 0) BY WHILE USING)

Variation over from.

TRY-UPDATE (VAR &KEY ON-ERROR)

Tries to update the generator named <var> as by UPDATE. If the loop would be terminated as a result of the update operation, it is not terminated. Any errors occurring during the update are ignored by default; however, it is possible to provide a function to be invoked in case of error to determine what to do. This is the value of the <on-error> parameter, which, if provided, must be a function of two arguments: the first is the value to be returned as the result of the try-update form if the error is suppressed; the second is the condition object itself, which can be resignaled. Calling TERMINATE inside the function, if it is defined lexically inside the DO+ body, will regularly terminate the loop.

UPDATE (VAR)

Updates the generator named <var>, calculating new value(s) for its variable(s) and evaluating its pre and post conditions, terminating the loop if they fail. If successful, the update returns the value of <var>.

WITH (&REST BINDINGS)

Establishes bindings which are in effect for the whole loop.

Undocumented

OPTIONS (&REST ARGS &KEY NAME ATOMIC-UPDATES)

Private

DECLARING (THING)

Causes the emission of a (declare <thing>) form in the declaration section of the loop.

UNTIL (CONDITION)

Specifies a termination clause for the loop. When, at the beginning of an iteration, the clause evaluates to true, the loop stops.

WHILE (CONDITION)

Same as (until (not <condition>)).

Undocumented

DO+/INTERNAL (DOPLUS-ENV ITER-FORMS &BODY BODY &ENVIRONMENT ENV)

WITH-ATOMIC-UPDATES ((&REST VARIABLES) &BODY BODY)

WITH-ATOMIC-UPDATES* ((&REST VARIABLES) BINDING-FORM &BODY BODY)

WITH-DOPLUS-BODY (ENV &BODY BODY)

WITHOUT-ATOMIC-UPDATES ((&REST VARIABLES) &BODY BODY)

GENERIC-FUNCTION

Private

Undocumented

MAKE-SEQUENCE-ITERATOR (SEQUENCE &KEY FROM-END START END)

VARIABLE

Private

*CLAUSES*

A list of known symbols that name clause macros, useful for introspection and documentation purposes.

CLASS

Public

Undocumented

OPTIONS (&REST ARGS &KEY NAME ATOMIC-UPDATES)

Private

Undocumented

ACCUMULATOR

BINDING

DECLARATION

DOPLUS-ENV

EPILOGUE

FINALIZATION

GENERATOR

INITIALIZATION

PROLOGUE

RESULT

STEP

TERMINATION

WRAPPER