Common Lisp Package: GENDL

Base Core Kernel Engine

README:

Gendl

Gendl is an AGPL-licensed Generative Programming and Knowledge Based

Engineering framework, building on concepts dating back to the

1980s. It allows for high-level declarative, object-oriented problem

solving and application development, including but not limited to the

ability to generate and manipulate 3D geometry. To solve a problem in

Gendl, you formulate it using the "define-object" operator, which

allows you to specify inputs, outputs (computed slots), and child

objects, which then gives the ability to generate a "tree" of objects,

useful for decomposing complexity.

A graphical web-based interface, /tasty/, is available for interacting

with your system as it is developed.

The web-based GUI framework used to make tasty (GWL) is also available

for creating your own custom web-based user interfaces.

Fundamental KBE Features Provided

  • Declarative (non-procedural) Syntax

  • Object and value caching (i.e. runtime memorization)

  • Dependency-tracking (cached values get recomputed when needed)

Optionally there is available a set of surface- and solid-modeling

primitives which currently depend on SMLib, a commercial geometry

kernel available from Solid Modeling Solutions, Inc.

The Surface (:surf) package (in the surf/ folder) contains all the

high-level Surface and Solid modeling primitives and is available

under the AGPL with the Gendl project. These primitives provide a

protocol for what the objects should be able to do (i.e. what messages

they should answer), but without the SMLib library and associated

middleware available, they will not be able to return any results.

The SMLib kernel and associated middleware are available as part of

the commercial Genworks GDL product Genworks International

(http://genworks.com).

If you have a different favorite solid modeling kernel

(e.g. OpenCascade, Parasolid, Geometros sgCore), then it may be

possible to interface the existing Surface package to that kernel, by

implementing the methods in surf/source/methods.lisp.

Gendl is distributed under AGPL, which has the requirement that you

release your updates and any applications compiled with Gendl under

AGPL-compatible license (if distributed at all).

For Proprietary (closed-source) development and distribution, the

commercial Genworks GDL system is available from http://genworks.com.

Support

  • #gendl on freenode.irc.net (irc://irc.freenode.net/gendl)
  • @gendl on Twitter
  • (common-lisp.net mailing list hopefully/possibly coming soon)
  • http://groups.google.com/group/genworks
  • #lisp, #quicklisp, #emacs channels on irc.freenode.net

Current Requirements:

  1. Common Lisp: Allegro CL 9.0, LispWorks 6.x, SBCL, or CCL (Clozure
  2. CL). Without web interface, initial ports to ECL, ABCL, and CLISP

    have also been completed.

  3. Quicklisp (available from http://www.quicklisp.org)

Note

The name :gendl is new and will be used in Quicklisp starting with the April release, which is due out the week of April 8 (this week!). Prior to the April 2013 Quicklisp, the system is known as :genworks-gdl, and so would be loaded and started with:

common-lisp (ql:quickload :genworks-gdl) (gdl:start-gdl)

We recommend you to switch to the latest system under its new name :gendl as soon as it is available, which should be by the end of this week.

To load the entire system, you can do it with:

`common-lisp (ql:quickload :gendl)

(gendl:start-gendl!)

`

Now you can do a quick sanity check by visiting:

localhost:9000/tasty

in your browser and trying to instantiate the default assembly tree

(robot).

Slime (Superior Lisp Interaction Mode for Emacs) is recommended

for developing Gendl applications with Emacs.

Slime is available with:

(ql:quickload :quicklisp-slime-helper)

Documentation is in documentation/tutorial/pdf/tutorial.pdf

and this very much an active work in progress. Training tutorials and videos

are also in progress and in their current state are available in the

Documentation section on http://genworks.com.

To help in understanding the role of each module, the overall Gendl

source architecture is partially described below.

Gendl source code Architecture:

Gendl is separated into layered components, some of which depend on

others. Some components also depend on third-party external libraries,

which are currently handled with the Quicklisp system.

At the core "kernel" is the :gdl package, implemented with files in

the folder gdl/base/. This includes the compiler/expanders for

"define-object" and related macros as well as core primitives such as

vanilla-mixin.

Including the base, there are eight modules supported with Gendl:

  • :base - (gendl/base/) Gendl language kernel.

  • :cl-lite - (gdl/cl-lite/) Gendl system definitions and loading

  • facility. Supplements our use of asdf and quicklisp.

  • :regression - (gdl/regression) regression test utilities.

  • :geom-base - (gdl/geom-base/) Built-in Gendl wireframe primtives

    and basic geometry/vector manipulation functions.

  • :gwl - (gdl/gwl/) Generative Web Language, represent web pages

    using GDL objects, includes Ajax-based web interaction with

  • your model.

  • :gwl-graphics - (gdl/gwl-graphics/) include graphics rendered
  • from geometry object in GWL web pages.

  • :surf - (gdl/surf/) surface primitives without underlying
  • geometry kernel middleware or implementation.

  • :yadd - (gdl/apps/yadd/) self auto-documentation.

License

Affero Gnu General Public License (http://www.gnu.org/licenses/agpl.txt)

FUNCTION

Public

^2 (NUMBER)

Number. Return <b>number</b> raised to the power two (2). :arguments (number "Number")

ALIST2PLIST (ALIST)

Plist. Converts an assoc-list to a plist. :arguments (alist "Assoc-List")

ALWAYS (ARG)

T. Always returns the value <tt>T</tt> regardless of <b>arg</b>. :arguments (arg "Lisp object. Ignored")

CYCLIC-NTH (NUMBER LIST)

Lisp object. Returns nth from the list, or wraps around if nth is greater than the length of the list.

DIV (&REST NUMS)

Floating-point number. Divides using rational division and converts the result (which may be a pure rational number) to a floating-point number. :arguments (numerator "Number." denominator "Number.") :&optional (more-denominators "(&rest). More numbers to divide by.")

ENSURE-LIST (POSSIBLE-LIST)

List. If argument is not list, returns it in a list. If argument is a list, returns it unchanged. :arguments (possible-list "Lisp object")

FIND-MESSAGES-USED-BY (INSTANCE MESSAGE-KEY)

List of pairs of instance/keyword. This returns the list of direct dependants of a given message in a given instance. Note that this is not recursive; if you want to generate a tree, then you have to call this recursively yourself. If you want an easy way to remember the meaning of dependant and dependency: You have a dependency on caffeine. Your children are your dependants.

FIND-MESSAGES-WHICH-USE (INSTANCE MESSAGE-KEY)

List of pairs of instance/keyword. This returns the list of direct dependants of a given message in a given instance. Note that this is not recursive; if you want to generate a tree, then you have to call this recursively yourself. If you want an easy way to remember the meaning of dependant and dependency: You have a dependency on caffeine. Your children are your dependants.

FLATTEN (TREE)

List. Returns a new list consisting of only the leaf-level atoms from <b>list</b>. Since nil is technically a list, <tt>flatten</tt> also has the effect of removing nils from <b>list</b>, but may be inefficient if used only for this purpose. For removing nil values from a list, consider using <tt>remove nil ...</tt> instead. :note from On Lisp by Paul Graham, code as follows: <pre> (if (atom tree) (ensure-list tree) (nconc (flatten (car tree)) (if (cdr tree) (flatten (cdr tree))))) </pre> :arguments (list "List") :see-also <tt>remove</tt>

FROUND-TO-NEAREST (NUMBER INTERVAL)

Number. Rounds <b>number</b> to the nearest <b>interval</b>, using type contagion rules for floating-point similar to the CL "fround" function. :arguments (number "Number" interval "Number")

HALF (NUM)

Number. Returns the result of dividing <b>num</b> by the integer <tt>2</tt>. The type of the returned number will depend on the type of <b>num</b>. :arguments (num "Number")

INDEX-FILTER (FN LIST)

List. Returns all elements of <b>list</b> for whose index (starting at zero) the function <b>fn</b> returns non-NIL. :arguments (fn "Function object (e.g. a lambda expression)" list "List")

ISO-8601-DATE (UNIVERSAL-TIME &KEY INCLUDE-TIME?)

String. Returns the ISO8601 formatted date and possibly time from a Common Lisp universal time integer, e.g. 2007-11-30 or 2007-11-30T13:45:10

LASTCAR (LIST)

Lisp Object. Returns the last element of <b>list</b>. :arguments (list "List")

LEAST (FUNCTION LIST)

List. Returns the member of <b>list</b> which returns the minimum numerical value when <b>function</b> is applied to it. As second value is returned which is the actual minimum value (the return-value of <b>function</b> as applied). This function comes from the Paul Graham book <u>ANSI Common Lisp</u>. :arguments (function "Function" list "List")

LIST-OF-NUMBERS (NUM1 NUM2 &OPTIONAL (INCREMENT 1))

List of Numbers. Returns a list of incrementing numbers starting from <b>num1</b> and ending with <b>num2</b>, inclusive. :arguments (num1 "Number" num2 "Number") :&optional ((increment 1) "Number. The distance between the returned listed numbers.")

MAKE-KEYWORD (&REST STRINGS)

Keyword symbol. Converts given strings to a keyword. If any of the given arguments is not a string, it will be converted to one with (format nil "~a" string). :arguments (strings "&rest Strings")

MAKE-OBJECT (OBJECT-TYPE &REST ARGS)

GDL Object. Instantiates an object with specified initial values for input-slots. :arguments (object-name "Symbol. Should name a GDL object type." arguments "spliced-in plist. A plist of keyword symbols and values for initial <tt>input-slots</tt>.")

MAPSEND (OBJECT-LIST MESSAGE &REST ARGS)

List. Returns a new list which is the result of sending <b>message</b> to each GDL object in <b>object-list</b>. :arguments (object-list "List of GDL objects." message "Keyword symbol.")

MAPTREE (NODE FN &OPTIONAL (ACCEPT? #'ALWAYS) (PRUNE? #'NEVER) (GET-CHILDREN CHILDREN))

List. Returns the results of applying <b>fn</b> to each GDL object in the object tree rooted at <b>node</b> in a ``depth-first'' tree traversal. :arguments (node "GDL object" fn "Function. Operates on a single argument which is a GDL object") :&optional ((accept? #'always) "Function. Determines which nodes to accept in the final result" (prune? #'never) "Function. Determines which nodes to prune from the tree traversal" (get-children :children) "Keyword symbol :children or Function. Function applied to a given node to get its children. The default, keyword symbol :children, uses the node's normal children as returned by (the-object node children).")

MOST (FUNCTION LIST)

List. Returns the member of <b>list</b> which returns the maximum numerical value when <b>function</b> is applied to it. As second value is returned which is the actual maximum value (the return-value of <b>function</b> as applied). This function comes from the Paul Graham book <u>ANSI Common Lisp</u>. :arguments (function "Function" list "List")

NEAR-TO? (NUMBER NEAR-TO &OPTIONAL (TOLERANCE *ZERO-EPSILON*))

Boolean. Predicate to test if number is within tolerance of <b>near-to</b>. The default tolerance is the value of the parameter <tt>*zero-epsilon*</tt>. :arguments (number "Number" near-to "Number") :&optional ((tolerance *zero-epsilon*) "Number")

NEAR-ZERO? (NUMBER &OPTIONAL (TOLERANCE *ZERO-EPSILON*))

Boolean. Returns non-NIL iff <b>number</b> is greater than <b>tolerance</b> different from zero. :arguments (number "Number") :&optional ((tolerance *zero-epsilon*) "Number") :see-also <tt>zerop</tt> (Common Lisp function)

NEVER (ARG)

NIL. Always returns the value <tt>NIL</tt> regardless of <b>arg</b>. :arguments (arg "Lisp object. Ignored")

NUMBER-FORMAT (NUMBER &OPTIONAL DECIMAL-PLACES)

String. Returns a string displaying <b>number</b> rounded to <b>decimal-places</b> decimal places. :arguments (number "Number" decimal-places "Integer")

NUMBER-ROUND (NUMBER &OPTIONAL DECIMAL-PLACES)

Number. Returns <b>number</b> rounded to <b>decimal-places</b> decimal places. :arguments (number "Number" decimal-places "Integer")

PLIST-KEYS (PLIST)

List of keyword symbols. Returns the keys from a plist. :arguments (plist "Plist")

PLIST-VALUES (PLIST)

List of Lisp objects. Returns the values from a plist. :arguments (plist "Plist")

READ-SAFE-STRING (STRING)

Lisp object. Reads an item from string, protecting against lisp evaluation with the `#.' reader macro. Throws an error if evaluation would have occured. :arguments (string "string")

READ-SNAPSHOT (&KEY (FILENAME /tmp/snap.gdl) OBJECT KEEP-BASHED-VALUES? MAKE-OBJECT-ARGS KEYS-TO-IGNORE)

GDL Instance. Reads the snapshot file indicated by filename. If no optional keyword <tt>object</tt> argument is given, a new GDL instance based on the data in the snapshot file is returned. If an <tt>object</tt> is given, the object should be compatible in type to that specified in the snapshot file, and this existing object will be modified to contain the set slot values and toplevel inputs as specified in the snapshot file. :&key ((filename "/tmp/snap.gdl") "String or pathname. File to be read." (keep-bashed-values? nil) "Boolean. Indicates whether to keep the currently bashed values in object before reading snap values into it." (object nil) "GDL object. Existing object to be modified with restored values.")

REMOVE-PLIST-ENTRY (PLIST KEY &KEY (TEST #'EQL))

Plist. Returns a new plist sans any key/value pairs where the plist key is eql to the given key. Optionally a different test than #'eql can be specified with the :test keyword argument. :arguments (plist "Plist. The source plist." key "matching key, typically a keyword symbol. The key to target for removal.") :&key ((test #'eql) "predicate equality function taking two arguments. The function to use for matching.") :examples (remove-plist-entry (list :a "a" :b :a) :a)

REPLACE-SUBSTRING (STRING OLD NEW)

String. Replaces all substring occurrences of <b>old</b> with <b>new</b> in <b>string</b>. Note: In a full GDL system, you will have glisp:replace-regexp, which is more powerful and probably more efficient than this. :arguments (string "String. The source string." old "String. The substring to be replaced." new "String. The substring to replace it with.") :see-also <tt>excl:replace-regexp</tt>

ROUND-TO-NEAREST (NUMBER INTERVAL)

Number. Rounds <b>number</b> to the nearest <b>interval</b>. :arguments (number "Number" interval "Number")

SAFE-FLOAT (NUMBER)

Double-float Number. Coerces <b>number</b> to a double-precision floating-point number if possible. If this is not possible, returns <tt>0.0d0</tt> (i.e. zero in the form of a double-precision floating-point number). :arguments (number "Number")

SAFE-SORT (LIST &REST ARGS)

List. Nondestructive analog of the Common Lisp <tt>sort</tt> function. Returns a freshly created list. :arguments (list "List. The list to be sorted.") :&rest (args "Argument list. Identical to the arguments for Common Lisp <tt>sort</tt>.")

SPLIT (STRING &OPTIONAL (SPLIT-CHARS (LIST )))

List of Strings. Returns a list containing the elements of <b>string</b> after having been split according to <b>split-chars</b> as delimiting characters. :arguments (string "String") :&optional ((split-chars (list #\space #\newline #\return #\tab)) "List of characters") :see-also <tt>glisp:split-regexp</tt>

STATUS-MESSAGE (STRING)

NIL. Prints <b>string</b>, followed by a newline, to <tt>*trace-output*</tt>, which is generally the system console. :arguments (string "String")

STRING-APPEND (&REST ARGS)

String. Returns a new string made up of concatenating the arguments. :arguments (:&rest (args "strings"))

TWICE (NUM)

Number. Returns the result of multiplying <b>num</b> by the integer <tt>2</tt>. The type of the returned number will depend on the type of <b>num</b>. :arguments (num "Number")

UNDEFINE-OBJECT (OBJECT-NAME-SYMBOL)

NIL. Clears all definitions associated with <b>object-name</b> from the currently running GDL session. :arguments (object-name "Non-keyword Symbol naming a GDL object type")

UNIVERSAL-TIME-FROM-ISO-8601 (ISO8601-DATE)

Integer representing Common Lisp Universal Time. Returns the universal time from a date formatted as an iso-8601 date, optionally with time, e.g. 2012-07-08 or 2012-07-08T13:33 or 2012-07-08T13:33:00

WRITE-PLIST (&KEY PLIST OUTPUT-PATH)

Pretty-prints a plist to a file with standard I/O syntax. :&key ((plist nil) "List. The list to be printed to the file" (output-path nil) "Pathname of a file. The file to be created or superseded.")

Undocumented

ENSURE-KEYWORD (&REST STRINGS)

EXPANDIT (FORM &OPTIONAL (STREAM *STANDARD-OUTPUT*))

LIST-HASH (HASH)

MAKE-CANONICAL-PART (&REST ARGS)

MAKE-KEYWORD-SENSITIVE (STRING)

MAKE-PART (&REST ARGS)

MAKE-SELF (OBJECT-TYPE &REST ARGS)

MERGE-COMMON-KEYS (PLIST)

REMOVE-PLIST-KEY (PLIST KEY)

REMOVE-PLIST-KEYS (PLIST KEYS)

RGB-CUBE-COLORS (&KEY (COMPONENTS (LIST FF CC 99 66 33 00)))

SET-SELF (OBJECT)

START-GENDL! (&KEY (FEATURES *FEATURES-TO-INITIALIZE*) (BANNER? T) (INIT-FILES? T))

TO-DOUBLE-FLOAT (NUM)

TO-SINGLE-FLOAT (NUM)

TRAVERSE-TREE (NODE &OPTIONAL PRUNE? (GET-CHILDREN CHILDREN))

UNIVERSAL-TIME-TO-PLIST (UNIVERSAL-TIME)

Private

Undocumented

%MAKE-KEYWORD (STRING)

%UNBIND-DEPENDENT-SLOTS% (OBJECT SLOT &KEY UPDATING?)

ADD-NOTIFY-CONS (NOTIFY-CONS VALUE &OPTIONAL SELF MESSAGE)

ALIST-TO-HASH (ALIST)

ALL-INPUTS (SYMBOL)

ALL-INPUTS-SINGLE (SYMBOL)

ALL-SUPERCLASSES (CLASS)

CACHED-FUNCTION (NAME FUNCTION &KEY (TEST #'EQL))

CACHED-METHOD (NAME METHOD &KEY (TEST #'EQL))

CHASE-UP-TRICKLE-DOWN (SLOT-SYMBOL SELF ARGS)

COLOR-COMPARE (COLOR1 COLOR2)

COMPARE-ITEMS (NEW-CONS OLD-CONS)

COMPOSE (&REST FUNCTIONS)

COMPUTED-SLOTS-SECTION (NAME COMPUTED-SLOTS &KEY QUERY?)

CONVERT-TO-MATRIX (PLIST)

CONVERT-TO-RADIAL (PLIST)

FIND-ALL-SUPERCLASSES (CLASS &OPTIONAL (LOCAL? NIL))

FIND-DEPENDANTS (INSTANCE MESSAGE-KEY)

FIND-DEPENDENCIES (INSTANCE MESSAGE-KEY)

FIRST-SYMBOL (LIST)

FLATTEN-PAIRS (PAIR-LIST)

FORMAT-FUNCTIONS-SECTION (NAME METHODS)

FUNCTIONS-SECTION (NAME FUNCTIONS)

GDL-FORMAT-SYMBOL? (SYMBOL)

GDL-OBJECT-SYMBOL? (SYMBOL)

GET-REMARKS (MESSAGE-LIST)

GROUP-REMARK-STRINGS (LIST)

HASH-TABLE-COMPARE (HT1 HT2 &KEY (TEST 'EQUALP))

HASH-TABLE-COPY (HT)

INITIALIZE

INPUT-METHODS (NAME ATTR-SYM KEYS EXPRESSIONS SPECIAL-KEYS)

INPUT-SLOTS-GENERICS (INPUT-SLOTS)

INPUT-SLOTS-SECTION (NAME INPUT-SLOTS)

INSTANTIATE-PART-ON-DEMAND (SELF SELF-TYPE ATTR-SYM)

LOAD-GDL-INIT-FILES

MAKE-ACCESSIBLE-SLOTS (KEYS &KEY INPUTS?)

MAKE-FRESH-COPY (&KEY OBJECT MAKE-OBJECT-ARGS)

MAKE-OBJECT-INTERNAL (OBJECT-TYPE &REST ARGS)

MAKE-RULE-SYMBOL (SYMBOL)

MAKE-STANDARD-SLOTS

MESSAGE-GENERICS (MESSAGES)

MESSAGE-LIST (SELF CATEGORY DEPTH BASE-PART-TYPE)

MESSAGE-SOURCE-CODE (MESSAGE-LIST)

MESSAGE-STRINGS (LIST &OPTIONAL (DEPTH 0))

MESSAGE-SYMBOL (MESSAGE-LIST)

METHODS-SECTION (NAME METHODS)

NORMALIZE-CATEGORY-NAME (NAME)

NOT-HANDLED (OBJECT MESSAGE)

NOT-HANDLED-ERROR (OBJECT MESSAGE)

OBJECT-INPUTS-GENERICS-SECTION (COOKED-DATA &KEY SPECIAL-KEYS)

OBJECT-SPECIFIC-METHODS-SECTION (&KEY ATTR-REMARKS ATTR-SYM PLIST PLIST-ORIG PART-PARAMETERS-EXPRESSION PART-TYPE-EXPR PART-QUANTIFY-EXPR PSEUDO-INPUTS WITH-ATTRIBUTE-KEYS PART-TYPE-SYMBOL NAME SPECIAL-KEYS)

OBJECTS-SECTION (NAME OBJECTS)

OLD-CATEGORY-NAME (NAME)

OPTIONAL-INPUT-SLOTS-SECTION (NAME INPUT-SLOTS &OPTIONAL (DEFAULTED? NIL))

PLIST2PAIRS (PLIST)

PREVIOUS-VALUE (OBJECT SLOT)

PROCESS-MATRIX (PLIST)

PROCESS-RADIAL (PLIST)

RESERVED-WORD-WARNING-OR-ERROR (NAME MESSAGES)

SAME-TREE? (OBJ1 OBJ2)

STARTUP-BANNER

STRIP-STRINGS (LIST)

SYMBOLS-AS-KEYWORDS (ITEM)

TRICKLE-DOWN-BASIS (SELF SLOT ARGS)

TRICKLE-DOWN-SLOTS-SECTION (SLOTS &KEY FROM-OBJECTS?)

UNBIND-DEPENDENT-SLOTS (OBJECT SLOT &KEY UPDATING?)

UNCACHED-FUNCTION (NAME FUNCTION)

UNCACHED-METHOD (NAME METHOD)

VANILLA-FINALIZATION (OBJ)

VIEW-OUTPUT-FUNCTION (FORMAT OBJECT-TYPE-NAME SKIN FUNCTION &KEY REMOTE?)

VIEW-OUTPUT-FUNCTIONS-SECTION (FORMAT OBJECT-TYPE-NAME SKIN FORMAT-FUNCTIONS &KEY REMOTE?)

MACRO

Public

APPEND-ELEMENTS (AGGREGATE &OPTIONAL EXPRESSION FILTER)

List of Objects [Macro]. Returns an appended list of <tt>expression</tt> from each element of an aggregate, with an optional filter. :arguments (aggregate "GDL aggregate object. (e.g. from a <tt>:sequence (:size ..)</tt> <tt>:object</tt> specification).") :&optional (expression "Expression using <tt>the-element</tt>. Similar to a <tt>the-object</tt> reference, which should return a list.")

DEFAULTING (FORM &OPTIONAL DEFAULT)

Lisp object. Returns a default value if the reference-chain is not handled. Note: Defaulting is currently implemented with ignore-errors, so it will return the default value regardless of whether the reference-chain is actually not handled or throws some other error. This will be updated in a future GDL release only to return the default if the reference-chain is actually not handled, and to throw any other errors normally. :arguments (form "Reference-chain with the or the-object" default "Lisp expression. Default value to return if reference-chain cannot be handled.")

DEFINE-FORMAT (NAME MIXIN-LIST &KEY SLOTS FUNCTIONS DOCUMENTATION)

Standard-class [Macro]. Defines a standard GDL output format for use with GDL views. :arguments (name "Symbol." mixin-list "List of symbols.") :&key (documentation "Plist containing keys and strings for author, description, etc." slots "List of lists or symbols. If a list, the list should contain a symbol, a default value, and optionally a documentation string. If a symbol, this is the name of the slot and there will be no default value." functions "List of format-function definitions. Each definition is made up of a symbol, an argument-list, and a body.")

DEFINE-LENS (FORMAT-AND-OBJECT MIXIN-LISTS &KEY (SKIN T) OUTPUT-FUNCTIONS AMEND? DOCUMENTATION)

Void [Macro]. Defines output-functions for the combination of the given output-format and GDL object. :arguments (format-and-object "List of two symbols. The first should name an output-format previously defined with <tt>define-format</tt>, and the second should name a GDL object previously defined with <tt>define-object</tt>." mixin-list "NIL. This is not supported and should be left as NIL or an empty list for now.") :&key ((skin t) "Name of a skin defined with define-skin. This allows a class hierarchy of look and feel for each view combination. Defaults to T, a generic skin.") (output-functions "List of format-function definitions. Each definition is made up of a symbol, an argument-list, and a body. The code in the body may refer to the dynamically bound variable <tt>stream</tt> for writing output.")

DEFINE-OBJECT (NAME MIXIN-LIST &REST SPEC-PLIST)

Defines a standard GDL object. Please see the document USAGE.TXT for an overview of <tt>define-object</tt> syntax.

DEFINE-OBJECT-AMENDMENT (NAME MIXIN-LIST &REST SPEC-PLIST)

Supplements or alters an existing GDL object definition. Syntax is similar to that for <tt>define-object</tt>. Note that there is currently no way to undefine messages defined with this macro, other than redefining the original object or restarting the GDL session. Support for surgically removing messages will be added in a future GenDL release.

FORMAT-SLOT (SLOT-NAME)

Lisp object [Macro]. Returns the value of the given slot within the context of the current <tt>with-format</tt> output format object. :arguments (slot-name "Symbol.")

IGNORE-ERRORS-WITH-BACKTRACE (&BODY BODY)

Like IGNORE-ERRORS, but in case of failure, return backtrace string as third value.

LIST-ELEMENTS (AGGREGATE &OPTIONAL EXPRESSION FILTER)

List of GDL Objects [Macro]. Returns a listing of the elements of an aggregate, with an optional <tt>the-element</tt> expression and filter. If an expression is given, the list of results from the expressions is returned. If no expression is given, a list of the objects themselves is returned. :arguments (aggregate "GDL aggregate object. (e.g. from a <tt>:sequence (:size ..)</tt> <tt>:object</tt> specification).") :&optional (expression "Expression using <tt>the-element</tt>. Similar to a <tt>the-object</tt> reference." filter "Function of one argument. Can be used to filter the result list.")

MAX-OF-ELEMENTS (AGGREGATE &OPTIONAL EXPRESSION FILTER)

Number [Macro]. Returns the maximum of <tt>expression</tt> from each element of an aggregate, with an optional filter. :arguments (aggregate "GDL aggregate object. (e.g. from a <tt>:sequence (:size ..)</tt> <tt>:object</tt> specification).") :&optional (expression "Expression using <tt>the-element</tt>. Similar to a <tt>the-object</tt> reference, which should return a number.")

MIN-OF-ELEMENTS (AGGREGATE &OPTIONAL EXPRESSION FILTER)

Number [Macro]. Returns the minimum of <tt>expression</tt> from each element of an aggregate, with an optional filter. :arguments (aggregate "GDL aggregate object. (e.g. from a <tt>:sequence (:size ..)</tt> <tt>:object</tt> specification).") :&optional (expression "Expression using <tt>the-element</tt>. Similar to a <tt>the-object</tt> reference, which should return a number.")

SET-FORMAT-SLOT (SLOT-NAME VALUE)

Void [Macro]. Sets the value of the given slot within the context of the current <tt>with-format</tt> output format object. :arguments (slot-name "Symbol." value "Lisp Value")

SUM-ELEMENTS (AGGREGATE &OPTIONAL EXPRESSION FILTER)

Number [Macro]. Returns the sum of <tt>expression</tt> from each element of an aggregate, with an optional filter. :arguments (aggregate "GDL aggregate object. (e.g. from a <tt>:sequence (:size ..)</tt> <tt>:object</tt> specification).") :&optional (expression "Expression using <tt>the-element</tt>. Similar to a <tt>the-object</tt> reference, which should return a number.")

THE (&REST REFERENCE-CHAIN)

Lisp object. Sends the <tt>reference-chain</tt> to <tt>self</tt>, which typically means it is used within the context of a define-object where self is automatically lexically bound. :arguments (reference-chain "(&rest). A spliced-in list of symbols naming messages, which can be slots or objects starting from <tt>self</tt>. For referring to elements of a quantified set, or for passing arguments to GDL functions which take arguments, use parentheses around the message name and enclose the quantified element index or function arguments after the message name.") :example This example sends the <tt>length</tt> message to the ``zeroth'' element of the quantified set of arms contained in the body which is contained in the robot which is contained in self: <pre> (the robot body (arms 0) length) </pre>

THE-CHILD (&REST REFERENCE-CHAIN)

similar to ``the,'' but used to refer to the child part from within an :objects or :hidden-objects specification. This is often used for sending the <tt>index</tt> message to an element of a quantified set. :arguments (reference-chain "(&rest). A spliced-in list of symbols naming messages relative to the child object.")

THE-ELEMENT (&REST ARGS)

Lisp Object [Macro]. Acts similarly to <tt>the-object</tt> for each element of an aggregate, within the context of a <tt>list-elements</tt>, <tt>append-elements</tt>, <tt>max-of-elements</tt>, <tt>min-of-elements</tt>, <tt>sum-elements</tt>, or a query operator (query operators are not yet documented). :arguments (args "(&rest). Standard reference chain applicable to the element.")

THE-OBJECT (OBJECT &REST REFERENCE-CHAIN)

Lisp object. Sends the <tt>reference-chain</tt> to <tt>object</tt>, which must be specified as a Lisp expression (e.g. a variable) which evaluates to a GDL object. :arguments (reference-chain "(&rest). A spliced-in list of symbols naming messages, which can be slots or objects starting from <tt>object</tt>. For referring to elements of a quantified set, or for passing arguments to GDL functions which take arguments, use parentheses around the message name and enclose the quantified element index or function arguments after the message name.") :example This example sends the <tt>length</tt> message to the ``zeroth'' element of the quantified set of arms contained in the body which is contained in the robot which is contained in <tt>object</tt>: <pre> (the-object object robot body (arms 0) length) </pre>

WITH-ERROR-HANDLING ((&KEY (ERROR? NIL) (TIMEOUT NIL) (TIMEOUT-BODY `(WARN ,Timed Out after ~a Seconds ,TIMEOUT))) &BODY BODY)

[Macro]. Wraps the <b>body</b> of code with error-trapping and system timeout. A warning is given if an error condition occurs with <b>body</b>. :&key ((timeout 2) "Timeout in Seconds." timeout-body "Body of code to evaluate if timeout occurs. Default is to print a warning and return nil.") :&rest (body "Body of code to be wrapped")

WITH-FORMAT ((FORMAT STREAM-OR-FILE &REST ARGS) &BODY BODY)

Void [Macro]. Used to establish an output format and a stream to which data is to be sent. This is the experimental new version of the <tt>with-format</tt> macro, which supports a full range of output options such as page dimensions, view transforms, view scales, etc. :example <pre> (gdl::with-format (pdf "/tmp/box.pdf" :view-transform (getf *standard-views* :trimetric)) (write-the-object (make-instance 'box :length 100 :width 100 :height 100) cad-output)) </pre>

WITH-FORMAT-SLOTS ((&REST SLOTS) &BODY BODY)

Void [Macro]. Wrap this around a body of code which should have access to multiple slots from the context of the current <tt>with-format</tt> output format object. :arguments (slots "List of Symbols.")

WRITE-ENV (&REST METHOD-CALLS)

Void [Macro] (usually used just for outputting). Within the context of a <tt>with-format</tt>, calls functions of the format object, optionally with arguments. Typically these functions will output data to the <tt>stream</tt> established by the <tt>with-format</tt>. :arguments (function-calls "(&rest). Functions on the named output-format to be called.") :example <pre> (with-format (base-format my-object) (write-env (:a "Hello World, my object's length is: ") (:a (the length)))) </pre>

WRITE-THE (&REST ARGS)

Lisp object [Macro]. Typcially used only to send output, not for the return value. This macro is used within the body of a <tt>with-format</tt>. It sends the <tt>reference-chain</tt> to <tt>self</tt>, which typically means it is used within the context of a define-object where self is automatically lexically bound. The reference-chain must terminate with an output-function defined for the combination of the output-format specified in the enclosing <tt>with-format</tt>, and the object identified by <tt>self</tt>. :arguments (reference-chain "(&rest). A spliced-in list of symbols naming messages, which can be slots or objects starting from <tt>self</tt>, terminating with the name of an output-function. For referring to elements of a quantified set, or for passing arguments to GDL functions which take arguments, use parentheses around the message name and enclose the quantified element index or function arguments after the message name.")

WRITE-THE-OBJECT (OBJECT &REST REFERENCE-CHAIN)

Lisp object [Macro]. Typcially used only to send output, not for the return value. This macro is used within the body of a <tt>with-format</tt>. It sends the <tt>reference-chain</tt> to <tt>object</tt>, which must be specified as a Lisp expression (e.g. a variable) which evaluates to a GDL object. The reference-chain must terminate with an output-function defined for the combination of the output-format specified in the enclosing <tt>with-format</tt>, and the object identified by <tt>object</tt>. :arguments (reference-chain "(&rest). A spliced-in list of symbols naming messages, which can be slots or objects starting from <tt>object</tt>, terminating with the name of an output-function. For referring to elements of a quantified set, or for passing arguments to GDL functions which take arguments, use parentheses around the message name and enclose the quantified element index or function arguments after the message name.")

Undocumented

DEFCOMPANION (&REST ARGS)

DEFINE-PACKAGE (NAME &REST BODY)

DEFINE-SKIN (NAME &OPTIONAL MIXINS SLOTS)

DEFINE-VIEW (&REST ARGS)

Private

Undocumented

%DEFINE-OBJECT% (NAME MIXIN-LIST &KEY INPUT-SLOTS COMPUTED-SLOTS OBJECTS HIDDEN-OBJECTS FUNCTIONS METHODS (NO-VANILLA-MIXIN? NIL) DOCUMENTATION TRICKLE-DOWN-SLOTS QUERY-SLOTS)

%DEFINE-OBJECT-AMENDMENT% (NAME MIXIN-LIST &KEY INPUT-SLOTS COMPUTED-SLOTS OBJECTS HIDDEN-OBJECTS FUNCTIONS METHODS DOCUMENTATION TRICKLE-DOWN-SLOTS QUERY-SLOTS)

WITH-DEPENDENCY-TRACKING ((MESSAGE-SYMBOL &OPTIONAL (SELF-SYM 'SELF)) &REST BODY)

WITH-GDL-MESSAGE-SYMBOLS ((&REST SPECS) &REST BODY)

GENERIC-FUNCTION

Public

Undocumented

EVALUATE-OBJECT (CATEGORY ARGS)

LOOKUP-COLOR (COLOR &KEY (GROUND FOREGROUND) (FORMAT DECIMAL))

READABLE-EXPRESSION (OBJECT &OPTIONAL SELF)

RESTORE-UI-OBJECT (UI-SERVER OBJECT)

SLOT-ACCESSOR

Private

Undocumented

CACHED-FUNCTIONS (OBJECT)

SETFCACHED-FUNCTIONS (NEW-VALUE OBJECT)

CACHED-METHODS (OBJECT)

SETFCACHED-METHODS (NEW-VALUE OBJECT)

CHILD-INPUTS (OBJECT)

SETFCHILD-INPUTS (NEW-VALUE OBJECT)

COMPUTED-SLOTS (OBJECT)

SETFCOMPUTED-SLOTS (NEW-VALUE OBJECT)

DEFAULTED-INPUT-SLOTS (OBJECT)

SETFDEFAULTED-INPUT-SLOTS (NEW-VALUE OBJECT)

FORMAT-FUNCTIONS (OBJECT)

SETFFORMAT-FUNCTIONS (NEW-VALUE OBJECT)

FUNCTIONS (OBJECT)

SETFFUNCTIONS (NEW-VALUE OBJECT)

GDL-DOCUMENTATION (OBJECT)

SETFGDL-DOCUMENTATION (NEW-VALUE OBJECT)

HIDDEN-OBJECTS (OBJECT)

SETFHIDDEN-OBJECTS (NEW-VALUE OBJECT)

MESSAGE-DOCUMENTATION (OBJECT)

SETFMESSAGE-DOCUMENTATION (NEW-VALUE OBJECT)

MESSAGE-SOURCE (OBJECT)

SETFMESSAGE-SOURCE (NEW-VALUE OBJECT)

MESSAGE-SOURCE-CHANGED (OBJECT)

SETFMESSAGE-SOURCE-CHANGED (NEW-VALUE OBJECT)

MESSAGE-SOURCE-COPY (OBJECT)

SETFMESSAGE-SOURCE-COPY (NEW-VALUE OBJECT)

MESSAGES (OBJECT)

SETFMESSAGES (NEW-VALUE OBJECT)

METHODS (OBJECT)

SETFMETHODS (NEW-VALUE OBJECT)

OBJECTS (OBJECT)

SETFOBJECTS (NEW-VALUE OBJECT)

OPTIONAL-INPUT-SLOTS (OBJECT)

SETFOPTIONAL-INPUT-SLOTS (NEW-VALUE OBJECT)

OUTPUT-FUNCTIONS (OBJECT)

SETFOUTPUT-FUNCTIONS (NEW-VALUE OBJECT)

QUANTIFIED-HIDDEN-OBJECTS (OBJECT)

SETFQUANTIFIED-HIDDEN-OBJECTS (NEW-VALUE OBJECT)

QUANTIFIED-OBJECTS (OBJECT)

SETFQUANTIFIED-OBJECTS (NEW-VALUE OBJECT)

QUERY-SLOTS (OBJECT)

SETFQUERY-SLOTS (NEW-VALUE OBJECT)

REQUIRED-INPUT-SLOTS (OBJECT)

SETFREQUIRED-INPUT-SLOTS (NEW-VALUE OBJECT)

SETTABLE-COMPUTED-SLOTS (OBJECT)

SETFSETTABLE-COMPUTED-SLOTS (NEW-VALUE OBJECT)

SETTABLE-DEFAULTED-INPUT-SLOTS (OBJECT)

SETFSETTABLE-DEFAULTED-INPUT-SLOTS (NEW-VALUE OBJECT)

SETTABLE-OPTIONAL-INPUT-SLOTS (OBJECT)

SETFSETTABLE-OPTIONAL-INPUT-SLOTS (NEW-VALUE OBJECT)

SETTABLE-SLOTS (OBJECT)

SETFSETTABLE-SLOTS (NEW-VALUE OBJECT)

TRICKLE-DOWN-SLOTS (OBJECT)

SETFTRICKLE-DOWN-SLOTS (NEW-VALUE OBJECT)

UNCACHED-COMPUTED-SLOTS (OBJECT)

SETFUNCACHED-COMPUTED-SLOTS (NEW-VALUE OBJECT)

VIEW-DOCUMENTATION (OBJECT)

SETFVIEW-DOCUMENTATION (NEW-VALUE OBJECT)

VARIABLE

Public

*COLOR-TABLE*

Hash Table. Built from the <tt>*color-plist*</tt>, this hash table is keyed on the same keys.

*COLOR-TABLE-DECIMAL*

Hash table. Same as <tt>*color-table*</tt> except the results are returned as a list of three decimal integers (for Red, Green, Blue) in the range of 0-254.

*COLORS-DEFAULT*

Plist. Should contain keys of at least <tt>:foreground</tt> and <tt>:background</tt>, whose values are a color indicator for the default foreground and background of graphics viewports. The default is <tt>:black</tt> for foreground, and <tt>:white</tt> for background.

*COMPILE-CIRCULAR-REFERENCE-DETECTION?*

Boolean. This is a compile-time switch. Determines whether the system detects circular references in messages. Defaults to NIL.

*COMPILE-DEPENDENCY-TRACKING?*

Boolean. This is a compile-time switch. Determines whether the system keeps track of object and message dependencies at runtime, thereby enabling the modification of messages and subsequent proper demand-driven recomputation of other messages in the object hierarchy. This switch must be set at the beginning of a session before comiling all code; switching it in the middle of a session (especially from NIL to T) will have unpredictable effects and very likely will result in incorrect operation. Defaults to T.

*COMPILE-DOCUMENTATION-DATABASE?*

Boolean. Determines whether documentation strings information will be compiled into compiled files. Defaults to T.

*COMPILE-FOR-DGDL?*

Boolean. Determines whether global methods are defined during compilation to allow calling any message on a gdl remote-object. This functionality is not available in the base by itself, it requires the :gwl system as well. Defaults to nil.

*COMPILE-SOURCE-CODE-DATABASE?*

Boolean. Determines whether source code information information will be compiled into compiled files. Defaults to T.

*CURVE-CHORDS*

Integer. The number of chords to use per Bezier curve when rendering curves as a sequence of straight chords (e.g. in VRML).

*ENSURE-LISTS-WHEN-BASHING?*

Boolean. Determines whether lists are enforced to stay as lists with set-slot-if-needed method of vanilla-mixin. Default is nil.

*LOAD-DOCUMENTATION-DATABASE?*

Boolean. Determines whether pre-compiled documentation strings information will be loaded from compiled files. Defaults to T.

*LOAD-SOURCE-CODE-DATABASE?*

Boolean. Determines whether pre-compiled source code information will be loaded from compiled files. Defaults to T.

*OUT-OF-BOUNDS-SEQUENCE-REFERENCE-ACTION*

Keyword symbol :warn, :error, or :silent. Determines what happens when you try to access a member of a GDL sequence which is out of bounds. If :warn or :silent, an out-of-bounds reference will simply return nil. If :error, it will throw an error as was the old behavior. Defaults to :error.

*REMEMBER-PREVIOUS-SLOT-VALUES?*

Boolean. Determines whether the system keeps track of previous slot values (accessible with previous-value function) after bashings are done. Leave this set to nil to improve memory performance.

*RUN-WITH-CIRCULAR-REFERENCE-DETECTION?*

Boolean. This is a runtime switch. Determines whether the system detects circular references in messages. Defaults to NIL.

*RUN-WITH-DEPENDENCY-TRACKING?*

Boolean. This is a runtime switch. Determines whether the system keeps track of object and message dependencies at runtime, thereby enabling the modification of messages and subsequent proper demand-driven recomputation of other messages in the object hierarchy. This switch must be set at the beginning of a session; switching it in the middle of a session (especially from NIL to T) will have unpredictable effects and very likely will result in incorrect operation. Defaults to T.

*UNDECLARED-PARAMETERS-ENABLED?*

Boolean. This is a compile-time switch. Determines whether the system will handle inputs passed to child parts through :parameters plists, where the input is not declared in any other part as either an input-slot or computed-slot. If you leave this as NIL when compiling your application you may see an improvement in runtime performance of up to 10% as compared to applications compiled with it set to T. Defaults to NIL.

*ZERO-EPSILON*

Number. The value used to test for closeness to zero in some functions. Defaults to 0.001

Undocumented

*%FORMAT%*

*ALLOWED-PART-DOCUMENTATION-KEYWORDS*

*COMPILE-WITH-DEPENDENCY-RECORDING?*

*CURRENT-VERSION*

*DISPLAY-CONTROLS*

*DUMMY-VERSION*

*ERROR-ON-RESERVED-WORDS?*

*FORCE-RESTORE-SLOT-DEFAULT?*

*GS-PATH*

*ONCLICK-FUNCTION*

*PAPER-SIZE-PLIST*

*PAPER-SIZE-TABLE*

*PATCH-FASLS*

*REPORT-GDL-REDEFINITIONS?*

*RESERVED-WORD-PROTECTED-PACKAGES*

*RETAIN-OBJECT-IDENTITY-ON-TYPE-CHANGE?*

*RGB-CUBE-COLORS*

*RUN-WITH-DEPENDENCY-RECORDING?*

*SKIN*

*STREAM*

*UI-SERVER*

Private

*COLOR-PLIST*

Plist. Maps color name keywords to string containing HTML-style hex RGB color value, e.g. "#FFFFFF" for pure white.

*ROOT-CHECKING-ENABLED?*

Boolean. Determines whether dependency-tracking carries over between objects which do not share a common root. Default is T which means dependency-tracking does <b>not</b> carry over (the checking prevents it).

Undocumented

*COLOR-PLIST-SORTED*

*COMPILING-CHANGES*

*DEBUG-OBJECT*

*DEBUG?*

*DEP-HASH-THRESHHOLD*

*DEPENDENCY-HASH*

*EAGER-SETTING-ENABLED?*

*ERROR-ON-NOT-HANDLED?*

*FEATURES-TO-INITIALIZE*

*LEAF-RESETS*

*MESSAGE-CATEGORIES*

*NOTIFY-CONS*

*PRODUCTION-BUILD?*

*THESE-FEATURES*

*TILL-NOW*

*UNBOUND-SLOTS*

ARGS-ARG

PARENT-ARG

PART-ARG

SELF-ARG

VAL-ARG

CLASS

Public

Undocumented

BASE-FORMAT

BASE-RULE-OBJECT

GDL-CLASS

GDL-FORMAT-CLASS

GDL-REMOTE

GDL-SKIN-CLASS

NULL-OBJECT

NULL-PART

QUANTIFICATION

REMOTE-OBJECT

VANILLA-MIXIN

VANILLA-MIXIN*

Private

Undocumented

BASE-GDL-UI

GDL-BASIS

MATRIX-SEQUENCE

RADIAL-SEQUENCE

ROOT-PATH-CONTAINER

STANDARD-SEQUENCE

VARIABLE-SEQUENCE

CONSTANT

Public

+PHI+

Number (Constant). The Golden Ratio.

2PI

Number (Constant). Twice the internal Lisp value for pi.

PI/2

Number (Constant). Half the internal Lisp value for pi.

Undocumented

+KAPPA+

Private

Undocumented

+RESERVED-WORDS+