Module Dylan

Whenever possible, we have tried to keep the Dylan module pristine and unextended, preferring to add our extensions to separate modules or libraries.  However, this is not always possible, particularly when it involves extending the behavior of a function or macro that is exported from the Dylan module.  Currently, Gwydion compilers support these extensions to the Dylan module as described below.

Keyed-by clause

Gwydion compilers support keyed-by clauses in for statements.  The format of such a clause is “var keyed-by key in collection”.  var is bound to each element in collection, and key is bound to the element’s key value.

Using clause

Gwydion compilers support using clauses in for statements.  The format of such a clause is “var in collection using protocol”.  The protocol will be used instead of forward-iteration-protocol.  The protocol argument must be a variable name, not an expression.  These using clauses may be used together with keyed-by: “var keyed-by key in collection using protocol”.

Define function

Gwydion compilers have an additional type of top level definition, “define function” (see function-definer), which creates a constant binding in the current module and initializes it to a new function.  The usage of define function is similar to that of define method (see method-definer).  The following is an example:

define function cube (x)
x * x * x;
end function cube;

A similar result might be had by writing

define constant cube = method (x)
x * x * x;
end method;

or

define method cube (x)
x * x * x;
end method cube;

Subclass specializers

Gwydion compilers supports subclass specializers via the limited function.  A subclass specializer causes a method to be invoked whenever the generic function was called on a value that is the specified class or any subclass of the specified class.  The method is never invoked on a value that is an instance (direct or indirect) of the specified class, only when the value is a subclass of the specified class.  The following is an example:

define method make
(result-class :: limited(<class>, subclass-of: <my-class>));
let x = next-method();
do-special-logging-or-something(x);
x;
end method;

Exported from

Summary
Whenever possible, we have tried to keep the Dylan module pristine and unextended, preferring to add our extensions to separate modules or libraries.

Dylan names

A macro.
Returns eight values used to implement iteration over the collection argument.
Defines a constant binding in the current module and initializes it to a new function.
A macro.
Returns a limited subtype of a class.
The common-dylan library.
In the process of working with Dylan, the Gwydion Project has come up with numerous extensions to the Dylan language.
Returns the difference of its arguments.
A macro.
Returns the quotient of its arguments.
Raises an object to a specified power.
Logical negation.
Compares two objects for inequality.
Compares two objects for nonidentity.
Holds the largest positive <integer>.
Holds the smallest negative <integer>.
Multiplies two objects and returns the product.
A macro.
Adds two objects and returns the sum.
Returns true if its first operand is less than or equal to its second operand.
The class of conditions used to terminate a computation.
The class of sequences whose elements are arranged according to a Cartesian coordinate system.
The class of boolean values.
The class of vectors with elements that are eight-bit characters.
The class of characters.
The class of all Dylan classes.
The class of collections, aggregate data structures.
The class of complex numbers, including real numbers.
The class of objects used by the condition system to connect a signaler with an appropriate handler.
The class of double-ended queues.
The class of double-precision floating-point numbers.
The class with only one instance, the empty list.
The class of conditions that represent something invalid about the program.
The class of all collections that are not sequences.
The class of extended-precision floating-point numbers.
The class of floating-point numbers.
The class of objects that can be applied to arguments.
The class of functions that are made up of a number of individual methods.
The class of integers.
The class of linked lists.
The class of functions that are applicable to arguments of a specified type.
The class of collections that may be modified.
The class of explicit key collections that can have elements replaced.
The class of sequences that may be modified.
The class of all numbers.
The class of all Dylan objects.
The class of tables that compare keys using ==.
The class of lists that can have new values assigned to their heads and tails.
The class of arithmetic sequences.
The class of rational numbers.
The class of real numbers.
The class of conditions used to correct an unusual situation.
The class of errors that are generated by sealing violations.
The class of collections whose keys are consecutive integers starting from zero.
The class of conditions that cannot be safely ignored.
The class of error conditions that consist of just an error message constructed from a format string and arguments.
The class of simple vectors that may have elements of any type.
A default class of restarts.
The class of simple and efficient vectors.
A default class of warnings that are described by a warning string.
The class of single-precision floating-point numbers.
The class of singletons.
The class of collections that may grow or shrinking to accommodate adding or removing elements.
The class of vectors that are stretchy.
The class of sequences with elements that are characters.
The class of symbols.
The class of tables (also known as hash tables).
The class of all types, including classes and other types.
The class of error conditions generated by type checks.
The class of vectors with elements that are sixteen-bit Unicode characters.
The class of arrays of rank one (i.e., exactly one dimension).
The class of conditions that are interesting to users but can safely be ignored.
Compares two objects for identity.
A macro.
Returns the absolute value of its argument.
Adds an element to a sequence.
Adds an element to a sequence, possibly modifying the sequence.
Adds a method to a generic function.
Adds a new element to a sequence.
Adds a new element to a sequence, possibly modifying the sequence.
Returns the class precedence list of a class.
Returns a function that always returns a particular object.
Returns the first true value obtained by iterating over one or more collections.
Tests if a function is applicable to sample arguments.
Calls function and returns the values that function returns.
Returns the array element indicated by a set of indices.
Sets the array element indicated by a set of indices.
Coerces an object to a type.
Performs an arithmetic shift on the binary representation of its first argument.
Coerces an object to lowercase and returns the resulting new object.
Coerces an object to lowercase in place.
The method on <string> is equivalent to map-into(string, as-uppercase, string).
Coerces an object to uppercase in place.
Returns eight values used to implement reverse iteration over the collection argument.
A macro.
A macro.
Invokes the debugger.
A macro.
Truncates a real number toward positive infinity.
Returns the ceiling of the quotient of two numbers.
Signals a correctable error.
Checks an object to ensure that it is an instance of a specified type.
Returns those elements of a sequence that satisfy a predicate.
Returns those elements of a sequence that correspond to those in another sequence that satisfy a predicate.
Defines a constant binding in the current module and initializes it to a new class.
Returns a function that expresses the complement of a predicate.
Returns the composition of one or more functions.
Returns a sequence containing all the elements of all the sequences, in order.
Returns the concatenation of one or more sequences in a sequence of a specified type.
Returns the sequence of format arguments that was supplied as an initialization argument when the simple-condition was created.
Returns the format string that was supplied as an initialization argument when the simple-condition was created.
Returns a function that expresses the conjunction of one or more predicates.
Defines and initializes a constant binding in the current module.
Creates a freshly allocated sequence containing the elements of source between start and end.
Returns a function that applies function to curried-args plus its own arguments, in that order.
Called if no dynamic handler handles a condition.
Returns the size of a specified dimension of an array.
Returns the dimensions of an array, as a sequence of integers.
Returns the direct subclasses of a class.
Returns the direct superclasses of a class.
Returns a function that expresses the disjunction of one or more predicates.
Iterates over one or more collections for side effect.
Applies a function to all dynamically active handlers, the most recently established first.
A macro.
Returns the collection element associated with a particular key.
Sets the collection element associated with a particular key.
Returns true if its argument is empty.
Returns true if its argument is an even number.
Returns true if a predicate returns true when applied to all corresponding elements of a set of collections.
Fills a collection with a specified value.
Returns the key in a collection such that the corresponding collection element satisfies a predicate.
Returns the method in a generic function that has particular specializers.
Returns the first element of a sequence.
Sets the first element of a mutable sequence.
Truncates a real number toward negative infinity.
Returns the floor of the quotient of two numbers.
Returns information about the arguments accepted by a function.
Returns information about the values returned by a function.
Returns the specializers of a function.
Returns the greatest common divisor of its two arguments.
Defines a constant binding in the current module and initializes it to a new generic function.
Returns the mandatory keywords of a generic function, if any.
Returns the methods of a generic function.
Returns the head of a list.
Sets the head of a pair to contain an object and returns the object.
Returns its argument.
A macro.
Performs instance initialization that cannot be specified declaratively by a class definition.
Returns true if object is a general instance of type.
Returns true if its argument is an integer.
Returns the intersection of two sequences, a new sequence containing only those elements of sequence1 that also appear in sequence2.
Returns a sequence containing the keys of its collection argument.
Returns the function used by its collection argument to compare keys.
Returns the last element of sequence.
Replaces the last element of a mutable sequence with a new value.
Returns the least common multiple of its two arguments.
A macro.
Returns the bitwise and of its arguments.
Tests the value of a particular bit in its argument.
Returns the bitwise inclusive or of its arguments.
Returns the bitwise not of its argument.
Returns the bitwise exclusive or of its arguments.
Returns a general instance of its first argument.
Iterates over one or more collections and collects the results in a freshly allocated collection.
Iterates over one or more collections and collects the results in a freshly allocated collection of a specified type.
Iterates over one or more collections and collects the results in an existing mutable collection.
Returns the greatest of its arguments.
Returns true if collection contains value as determined by test.
Returns a hash id created from the merging of two argument hash ids.
Returns the least of its arguments.
Returns the second value of #floor/#.
Returns the negation of its argument.
Returns the class of which object is a direct instance.
Returns a hash-code for object that corresponds to the equivalence predicate ==.
Returns true if its argument is an odd number.
Removes and returns the first element of a deque.
Removes and returns an element from the end of a deque.
Returns true if its argument is positive.
Adds an element to the front of a deque.
Adds an element to the end of a deque.
Returns the number of dimensions of an array.
Returns a function that applies function to curried-args plus its own arguments, with the curried-args occurring last.
Returns the result of combining the elements of collection and initial-value according to function.
Returns the combination of the elements of collection according to function.
Returns the second value of #truncate/#.
Removes an element from a sequence.
Removes an element from a sequence, possibly modifying the sequence.
Returns a sequence without duplicates.
Returns a sequence without duplicates, possibly modifying the sequence.
Modifies collection so that it no longer has a key equal to key.
Removes a method from a generic function.
Replaces those elements of mutable-collection for which predicate returns true.
Replaces a portion of a sequence with the elements of another sequence.
Called to query the user and restart.
Returns true if a condition’s recovery protocol allows returning values.
Returns a description of a condition’s returned values.
Queries the user for values to return.
Returns a sequence containing the same elements as a source sequence, but in reverse order.
Returns a sequence containing the same elements as a source sequence, but in reverse order.
Rounds a real number toward the nearest mathematical integer.
Rounds off the quotient of two numbers.
Returns the row-major index position of an array element.
Returns the second element of a sequence.
Sets the second element of a mutable sequence.
A macro.
Returns a new object that has the same contents as its argument.
Signals a condition.
Returns the size of its argument.
Sets the size of an object.
Tests whether a slot has been initialized.
Returns a sequence containing the elements of a source sequence sorted into ascending order.
Returns a sequence containing the elements of a source sequence sorted into ascending order.
Returns all the methods in a generic function that are applicable to sample arguments, sorted in order of specificity.
Returns the position where a pattern appears in a sequence.
Returns true if type1 is a subtype of type2.
Returns the test-function and hash-function for the <table>.
Returns the tail of a list.
Sets the tail of a pair to contain an object and returns the object.
Returns the third element of a sequence.
Sets the third element of a mutable sequence.
Truncates a real number toward zero.
Returns the truncated quotient of two numbers.
Returns the expected type of the type check that led to the type error.
A generic function.
Returns the value that was not of the expected type, and thereby led to the type error.
Returns an appropriate type for creating mutable copies of its argument.
Returns the union of two or more types.
Returns the union of two sequences, a sequence containing every element of sequence1 and sequence2.
A macro.
A macro.
Returns its arguments as multiple values.
Defines and initializes a variable binding in the current module.
A macro.
Returns true if its argument is equal to zero.