[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Return true if x is undefined (handled specially by all translators).
Return true if x is undefined (handled specially by all translators).
Return true if x is undefined (handled specially by all translators).
Return true if x is undefined (handled specially by all translators).
Return true if x is undefined (handled specially by all translators).
Return true if x is undefined (handled specially by all translators).
Return true if x is undefined (handled specially by all translators).
Return true if x is undefined (handled specially by all translators).
Return true if x is undefined (handled specially by all translators).
Return true if x is defined (handled specially by all translators).
Return true if x is defined (handled specially by all translators).
Return true if x is defined (handled specially by all translators).
Return true if x is defined (handled specially by all translators).
Return true if x is defined (handled specially by all translators).
Return true if x is defined (handled specially by all translators).
Return true if x is defined (handled specially by all translators).
Return true if x is defined (handled specially by all translators).
Return true if x is defined (handled specially by all translators).
Return true if x and y are literally the same object (or simple number). Analogue to the Common Lisp EQL and C++ and Java’s ==.
Return true if x and y are eq?
or equivalent literals
such as strings that also might be wrapped in non-identical wrappers. For
the case where x or y are plain literals such as strings or integers, the
STELLA translator substitutes the equality test appropriate for the particular
target language and does not actually call this function. For cases where
x or y are known to be of type STANDARD-OBJECT, the STELLA translator
substitutes the faster eq?
test inline.
Return true if x and y are eql?
or considered equal
by a user-defined object-equal?
method. This implements a fully extensible
equality test similar to Java’s equals
method. Note that writers of custom
object-equal?
methods must also implement a corresponding equal-hash-code
method.
Return true if x and y are eq?
.
Return true if x and y are literal wrappers whose
literals are considered eql?
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A float approximation of the mathematical constant pi.
Return the sum of all arguments.
If only x was supplied return the result of 0 - x. Otherwise, return the result of (...((x - arg1) - arg2) - ... - argN).
Return the product of all arguments.
If only x was supplied return the result of 1 / x. Otherwise, return the result of (...((x / arg1) / arg2 ) / ... / argN).
Add 1 to expression and return the result.
Subtract 1 from expression and return the result.
Increment the value of place and return the result. place can be either a variable name or a slot reference. Increment by the optional increment (which can be a float) or 1 otherwise.
Decrement the value of place and return the result. place can be either a variable name or a slot reference. Decrement by the optional decrement (which can be a float) or 1 otherwise.
Return true if x and y are numbers of exactly the same magnitude.
Return true if x is less than y.
Return true if x is less than or equal to y.
Return true if x is greater than or equal to y.
Return true if x is greater than y.
Not yet implemented.
Not yet implemented.
Not yet implemented.
Not yet implemented.
Not yet implemented.
Not yet implemented.
Not yet implemented.
Return the greatest common divisor of x and y.
Return the smallest integer >= n.
Return the biggest integer <= n.
Round n to the closest integer and return the result.
Return the absolute value of x.
Return the absolute value of x.
Not yet implemented.
Not yet implemented.
Return the square root of n.
Return the e to the power n.
Return x ^ y.
Return the natural logarithm (base e) of n.
Return the logarithm (base 10) of n.
Return the sine of n radians.
Return the cosine of n radians.
Return the tangent of n radians.
Return the arcsine of n in radians.
Return the arccosine of n in radians.
Return the arc tangent of n in radians.
Return the arc tangent of x / y in radians.
Generate a random integer in the interval [0..n-1]. The random number generator is seeded based on the current time every time STELLA starts up; however, your mileage may vary depending on the native language implementation.
Convert i to its string representation and return the result. This is more efficient than using a string stream.
Convert a string representation of an integer into an integer.
Use parse-long-integer
if the syntax of string needs to be checked for errors.
Convert f to its string representation and return the result. This is more efficient than using a string stream.
Convert a string representation of a float into a float.
Use parse-float
if the syntax of string needs to be checked for errors.
Print f in fixed-point format with nDecimals behind the decimal point and return the result as a string.
Return a literal object whose value is the INTEGER value.
Unwrap wrapper and return the result. Return NULL if wrapper is NULL.
Return a literal object whose value is the FLOAT value.
Unwrap wrapper and return the result. Return NULL if wrapper is NULL.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Return the 8-bit ASCII code of ch as an integer.
Return the character encoded by code (0 <= code <= 255).
Return TRUE if ch represents a digit.
Return TRUE if ch represents a letter.
Return TRUE if ch represents an upper-case character.
Return TRUE if ch represents a lower-case character.
Return TRUE if ch is a white space character.
If ch is lowercase, return its uppercase version, otherwise, return ch unmodified.
If ch is uppercase, return its lowercase version,
otherwise, return ch unmodified. If only the first character of
a sequence of characters is to be capitalized, character-capitalize
should be used instead.
Return the capitalized character for ch. This is generally the same as the uppercase character, except for obscure non-English characters in Java. It should be used if only the first character of a sequence of characters is to be capitalized.
Convert c into a one-element string and return the result.
Return a literal object whose value is the CHARACTER value.
Unwrap wrapper and return the result. Return NULL if wrapper is NULL.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Return true if x and y are equal strings or are both undefined. This
test is substituted automatically by the STELLA translator if eql?
is applied
to strings.
Return true if x and y are equal strings ignoring character case or are both undefined.
Return true if x is the empty string ""
Return true if x is not the empty string ""
Compare x and y lexicographically, and return -1, 0, or 1, depending on whether x is less than, equal, or greater than y. If case-sensitive? is true, then case does matter for the comparison
Return true if x is lexicographically < y, considering case.
Return true if x is lexicographically <= y, considering case.
Return true if x is lexicographically >= y, considering case.
Return true if x is lexicographically > y, considering case.
Return true if x is lexicographically < y, ignoring case.
Return true if x is lexicographically <= y, ignoring case.
Return true if x is lexicographically >= y, ignoring case.
Return true if x is lexicographically > y, ignoring case.
Return TRUE if all letters in s are upper case.
Return TRUE if all letters in s are lower case.
Return a new string filled with size initchars.
Return a new mutable string filled with size initchars.
Return a new uninitialized mutable string of size.
Return the first character of self.
Return the first character of self (settable via setf
).
Return the second character of self.
Return the second character of self (settable via setf
).
Return the third character of self.
Return the third character of self (settable via setf
).
Return the fourth character of self.
Return the fourth character of self (settable via setf
).
Return the fifth character of self.
Return the fifth character of self (settable via setf
).
Return the character in self at position.
Return the character in self at position.
Not documented.
Return the length of the string self.
Return the length of the string self.
Not documented.
Return the position of character within string (counting from zero); or return NULL if character does not occur within string. If start was supplied as non-NULL, only consider the substring starting at start, however, the returned position will always be relative to the entire string.
Return the last position of character within string (counting from zero); or return NULL if character does not occur within string. If end was supplied as non-NULL, only consider the substring ending at end, however, the returned position will always be relative to the entire string.
Return start position of the left-most occurrence of substring in string, beginning from start. Return NULL if it is not a substring. The comparison is exact.
Return a copy of string.
Return an upper-case copy of string.
Return a lower-case copy of string.
Return a capitalized version of string.
Return a new string representing the concatenation of string1, string2, and otherStrings. The two mandatory parameters allow us to optimize the common binary case by not relying on the somewhat less efficient variable arguments mechanism.
Return a substring of string beginning at position start and ending up to but not including position end, counting from zero. An end value of NULL stands for the rest of the string.
Remove all occurences of char from string.
Substitute all occurences of old-char with new-char in the string self.
Substitute all occurences of old-char with new-char in the string self.
Replace all occurrences of old in string with new.
For each occurrence of a <var> string from vars&values in template replace it with its corresponding <value> string. Replacement is done in sequence which means (part of) a value might be replaced further with a later <var> and <value>.
Inserts characters from source begining at start and
ending at end into target starting at target-index. If end is null
,
then the entire length of the string is used. The copy of characters is affected
by the case-conversion keyword which should be one of
:UPCASE :DOWNCASE :CAPITALIZE :PRESERVE.
The final value of target-index is returned.
Return a literal object whose value is the STRING value.
Return a literal object whose value is the MUTABLE-STRING value.
Unwrap wrapper and return the result. Return NULL if wrapper is NULL.
Unwrap wrapper and return the result. Return NULL if wrapper is NULL.
Copy s into a mutable string with the same content. In Lisp and C++ this simply copies s.
Convert s into a regular string with the same content. In Lisp and C++ this is a no-op.
Convert i to its string representation and return the result. This is more efficient than using a string stream.
Convert a string representation of an integer into an integer.
Use parse-long-integer
if the syntax of string needs to be checked for errors.
Convert f to its string representation and return the result. This is more efficient than using a string stream.
Convert a string representation of a float into a float.
Use parse-float
if the syntax of string needs to be checked for errors.
Print f in fixed-point format with nDecimals behind the decimal point and return the result as a string.
Convert c into a one-element string and return the result.
Print expression onto a string and return the result.
Printing is done with *printReadably?*
set to true and with *printPretty?*
set to false.
Stringify a parse tree relative to module, or
*module*
if no module is specified.
Read a STELLA expression from string and return the result.
This is identical to read-s-expression-from-string
.
Unstringify relative to module, or *MODULE*
if no
module is specified.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
CONS
Lists and TreesNot documented.
Not documented.
Not documented.
Not documented.
Not documented.
Return true
iff self equals nil
.
Return true
iff self is not equal to nil
.
Return true
iff x equals nil
.
Return true
iff the cons trees tree1 and tree2 are
structurally equivalent. Uses an eql?
test.
Return true
iff the cons trees tree1 and tree2 are
structurally equivalent. Uses equal?
to test equality of subtrees.
Return an equal?
hash code for self. Note that this
is O(N) in the number of elements of self.
Return a cons record that points to value and rest.
Return the first element of self. The first element
of self can be set with setf
. Note that (first NIL)
= null
.
Return the second element of self. The second element
of self can be set with setf
. Note that (second NIL)
= null
.
Return the third element of self. The third element
of self can be set with setf
. Note that (third NIL)
= null
.
Return the fourth element of self. The fourth element
of self can be set with setf
. Note that (fourth NIL)
= null
.
Return the fifth element of self. The fifth element
of self can be set with setf
. Note, that (fifth NIL)
= null
.
Return the element of self at position. The nth element
of self can be set with setf
. Note, that (nth NIL <pos>)
= null
.
Apply rest
position times to self.
Return the last element of self.
Generate all but the last element of the cons list self.
Return the last cons of self.
Return the length of the CONS list self.
Return true
iff object is a member of the cons list
self (uses an eql?
test).
Return true
iff object is a member of the cons list
self (uses an eq?
test).
Return the position of object within the cons-list
self (counting from zero); or return null
if object does not occur within
self (uses an eql?
test). If start was supplied as non-‘null’, only
consider the sublist starting at start, however, the returned position
will always be relative to the entire list.
Return the position of object within the cons-list
self (counting from zero); or return null
if object does not occur within
self (uses an eql?
test). If start
was supplied as non-‘null’, only
consider the sublist ending at end, however, the returned position
will always be relative to the entire list.
Destructively reverse the members of the cons list self.
Destructively remove all entries in the cons list self that
match value. Unless the remaining list is nil
, insure that the cons that
heads the list is unchanged.
Destructively remove duplicates from self and return the result. Removes all but the first occurrence of items in the list. Preserves the original order of the remaining members. Runs in linear time.
Destructively removes all members of the cons list
self for which test? evaluates to true
. test
takes a single
argument of type OBJECT and returns true
or false
. Returns a cons list.
In case the first element is removed, the return result should be
assigned to a variable.
Destructively replace each appearance of outValue by inValue in the cons list self.
Return a cons list consisting of the concatenation of list1, list2, and otherLists. The operation is destructive wrt all but the last list argument which is left intact. The two mandatory parameters allow us to optimize the common binary case by not relying on the somewhat less efficient variable arguments mechanism.
Return a cons list representing the concatenation of consList1 and consList2. The concatenation is NOT destructive.
Return a cons list consisting of the concatenation of list1 and self. A copy of list1 is prepended to self. This operation results in structure sharing of self; to avoid this, self should not be pointed to by anything other than the tail of the prepended copy.
Push value onto the cons list variable.
Push value onto the cons list variable, unless value is already a member of the list.
Pops a value from the cons list variable.
Return a cons list containing values, in order.
Return a list of conses that make up the list values,
terminated by the last value rather than by nil
. Assumes that
at least one value is passed in.
Return a copy of the cons list self.
Return a copy of the cons tree self.
Destructively replace each appearance of oldValue by
newValue in the cons tree tree. Return the tree. Uses an eql?
test.
Return true
iff the value value is embedded within
the cons tree tree. Uses an eql?
test.
Not documented.
Not documented.
Access an arbitrary element of tree identified by a path specified as a list of index values. The first index specifies the index-th element of tree, the second index the index-th subelement of that element, etc. Example:
(cons-tree-nth (quote (a (b (c d e) f) g)) 1 1 2) => e |
Access an arbitrary sublist of tree identified by a path
specified as a list of index values. The first index specifies the
index-th element of tree, the second index the index-th subelement
of that element, ..., the last index specifies the nth-rest
of the previous
element (different from cons-tree-nth
). Example:
(cons-tree-nth-rest (quote (a (b (c d e) f) g)) 1 1 1) => (d e) |
Match pattern against tree and return a list of
variable bindings if they match, or NULL otherwise. bindings can
be NULL or an initial list of bindings to consider. Pattern variables
use KIF syntax, i.e., they need to start with a ?
character. A
single question mark is interpreted as the anonymous variable. Example:
(match-cons-tree (quote (a (b (a d) e) (a d) f g)) (quote (a (?x ?y ?) ?y ? g)) NULL) => |kv|(<?Y,(A D)> <?X,B>) |
Variables can’t be quoted but quoting can effectively be achieved by inserting to-be-quoted variables bound to themselves into bindings.
Predicate version of match-cons-tree
(which see).
Return self.
Not documented.
Not documented.
Perform a stable, destructive sort of self according to
predicate, and return the result. If predicate has a <
semantics, the
result will be in ascending order. It is not guaranteed that self will
point to the beginning of the sorted result. If predicate is null
, a
suitable <
predicate is chosen depending on the first element of self,
and it is assumed that all elements of self have the same type (supported
element types are GENERALIZED-SYMBOL, STRING, INTEGER, and FLOAT).
Just like sort
but assumes each element of self is a tuple (a cons)
whose n-th element (0-based) will be used for comparison.
Return nil
iff self is null
or self otherwise.
If true
conses will be pretty printed.
If true
conses will be printed as readable Stella code.
When true
pretty-print Stella and translated code.
Since (Lisp) pretty-printing is somewhat slow, turning this off speeds up
file translation, but it also makes translated output very unreadable.
7.5.1 CONS Lists as Sets |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Return true if every element of self also occurs in otherList.
Uses an eql?
test and a simple quadratic-time algorithm. Note that
this does not check whether self and otherList actually are sets.
Return true if every element of self occurs in otherList and vice versa.
Uses an eql?
test and a simple quadratic-time algorithm. Note that
this does not check whether self and otherList actually are sets.
Return the set union of self and otherList. Uses an eql?
test
and a simple quadratic-time algorithm. Note that the result is only
guaranteed to be a set if both self and otherList are sets.
Return the set intersection of self and otherList. Uses an eql?
test and a simple quadratic-time algorithm. Note that the result is only
guaranteed to be a set if both self and otherList are sets.
Return the set difference of self and otherList (i.e., all elements
that are in self but not in otherSet
). Uses an eql?
test and a simple
quadratic-time algorithm. Note that the result is only guaranteed to be a
set if both self and otherList are sets.
Return the set difference of self and otherList by destructively
removing elements from self that also occur in otherList. Uses an eql?
test and a simple quadratic-time algorithm. Note that the result is only
guaranteed to be a set if self is a set.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Not documented.
Not documented.
Not documented.
Not documented.
Return TRUE unless self is NULL or the NIL-LIST
.
Return TRUE iff self is NULL or the NIL-LIST
.
Return TRUE if the list self has no members.
Return TRUE if the list self has at least one member.
Return TRUE iff the lists x and y are structurally
equivalent. Uses equal?
to test equality of elements.
Return an equal?
hash code for self. Note that this
is O(N) in the number of elements of self.
Return a list containing values, in order.
Return the first item in the list self, or NULL if empty.
Return the second item in the list self, or NULL if empty.
Return the third item in the list self, or NULL if empty.
Return the fourth item in the list self, or NULL if empty.
Return the fifth item in the list self, or NULL if empty.
Return the nth item in the list self, or NULL if empty.
Return a cons list of all but the first item in the list self.
Return the last element of self.
Generate all but the last element of the list self.
Not documented.
Return TRUE iff object is a member of the list
self (uses an eql?
test).
Return TRUE iff object is a member of the cons list
self (uses an eq?
test).
Return the position of object within the list
self (counting from zero); or return NULL if object does not occur within
self (uses an eql?
test). If start was supplied as non-NULL, only
consider the sublist starting at start, however, the returned position
will always be relative to the entire list.
Return the position of object within the list
self (counting from zero); or return NULL if object does not occur within
self (uses an eql?
test). If end was supplied as non-NULL, only
consider the sublist ending at end, however, the returned position
will always be relative to the entire list.
Add value to the front of the list self.
Add value to the front of the list self.
Add value to the front of the list self unless its already a member.
Insert value as the last entry in the list self.
Reverse the members of self (in place).
Destructively remove all entries in self that match value.
Destructively remove duplicates from self and return the result. Preserves the original order of the remaining members.
Not documented.
Destructively remove all members of the list self for which
test? evaluates to TRUE. test
takes a single argument of type OBJECT and
returns TRUE or FALSE. Returns self.
Remove and return the first element in the list self. Return NULL if the list is empty.
Destructively replace each appearance of outValue by inValue in the list self.
Copy list2 and all otherLists onto the end of list1. The operation is destructive wrt list1, but leaves all other lists intact. The two mandatory parameters allow us to optimize the common binary case by not relying on the somewhat less efficient variable arguments mechanism.
Copy list2 onto the front of the list self. The operation is destructive wrt self, but leaves list2 intact.
Return a copy of the list self. The conses in the copy are freshly allocated.
Make self an empty list.
Return a list of elements in self.
Not documented.
Not documented.
Perform a stable, destructive sort of self according to
predicate, and return the result. If predicate has a <
semantics, the
result will be in ascending order. If predicate is NULL, a suitable
<
predicate is chosen depending on the first element of self, and it
is assumed that all elements of self have the same type (supported
element types are GENERALIZED-SYMBOL, STRING, INTEGER, and FLOAT).
Return NIL-LIST iff self is NULL or self otherwise.
7.6.1 Lists as Sets |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Similar to CONS
lists LIST
’s can also be treated as sets
and support the set manipulations below. Note that LIST
constructors do not check for proper set-hood and may have surprising
results if a list contains duplicate elements.
Return true if every element of self also occurs in otherList.
Uses an eql?
test and a simple quadratic-time algorithm. Note that
this does not check whether self and otherList actually are sets.
Return true if every element of self occurs in otherList and vice versa.
Uses an eql?
test and a simple quadratic-time algorithm. Note that
this does not check whether self and otherList actually are sets.
Return the set union of self and otherList. Uses an eql?
test
and a simple quadratic-time algorithm. Note that the result is only
guaranteed to be a set if both self and otherList are sets.
Return the set intersection of self and otherList. Uses an eql?
test and a simple quadratic-time algorithm. Note that the result is only
guaranteed to be a set if both self and otherList are sets.
Return the set difference of self and otherList (i.e., all elements
that are in self but not in otherSet
). Uses an eql?
test and a simple
quadratic-time algorithm. Note that the result is only guaranteed to be a
set if both self and otherList are sets.
Return the set difference of self and otherList by destructively
removing elements from self that also occur in otherList. Uses an eql?
test and a simple quadratic-time algorithm. Note that the result is only
guaranteed to be a set if self is a set.
SET
is a subclass of LIST
that overrides certain
LIST
operations to prevent duplicate elements. The following
additional or modified operations are supported:
Not documented.
Not documented.
Add value to the set self unless it is already a member.
Add value to the front of set self unless it is already a member.
Add value to the end of set self unless it is already a member.
Destructively replace old with new in the set self unless new is already a member.
Union set2 and all otherSets onto the end of set1. The operation is destructive wrt set1, but leaves all other sets intact. The two mandatory parameters allow us to optimize the common binary case by not relying on the somewhat less efficient variable arguments mechanism.
Return TRUE iff x and y are SET’s with equivalent members.
Uses equal?
to test equality of elements. This is more general than
equivalent-sets?
, since that only uses an eql?
test.
Return an equal?
hash code for self. Note that this
is O(N) in the number of elements of self.
Return a set containing values, in order.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Return TRUE if x and y represent the same set of key/value pairs..
Return an equal?
hash code for self. Note that this
is O(N) in the number of entries of self.
Not documented.
Not documented.
Insert the entry <‘key’, value> into the property list self. If a previous entry existed with key key, that entry is replaced.
Remove the entry that matches the key key. Return the value of the matching entry, or NULL if there is no matching entry. Assumes that at most one entry matches key.
Return a copy of the list self. The conses in the copy are freshly allocated.
Make self an empty property list.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Create, fill-in, and return a new KV-CONS.
Return a copy of the cons list consList
.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Return TRUE if x and y represent the same set of key/value pairs.
Return an equal?
hash code for self. Note that this
is O(N) in the number of entries of self.
Not documented.
Not documented.
Destructively reverse the members of the list self.
Insert the entry <‘key’, value> into the association self. If a previous entry existed with key key, that entry is replaced.
Remove the entry that matches the key key. Return the value of the matching entry, or NULL if there is no matching entry. Assumes that at most one entry matches key.
Insert an entry <‘key’,value> to self unless an identical entry already exists. This can generate duplicate entries for key.
Remove the entry that matches <‘key’,value>. Assumes that more than one entry can match key.
Make value be the new first element of self. Note that
the rest
slot of value should be null
, since it will be overwritten.
This might duplicate an existing entry. If a previous entry existed with the
same key as value, that entry is retained, but shadowed by this new entry.
Add a new entry <‘key’, value> to the front of the association self. This might duplicate an existing entry. If a previous entry existed with key key, that entry is retained, but shadowed by this new entry.
Remove and return the value of the first element of the
kv-list self. It does NOT return the KV-CONS object. Return null
if
the list is empty.
Return a copy of the kv-list self. The kv-conses in the copy are freshly allocated.
Make self an empty dictionary.
Return a list of key-value pairs in self.
Not documented.
Not documented.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Return true
if self has length 0.
Return true
if self has length > 0.
Return TRUE iff the vectors x and y are structurally
equivalent. Uses equal?
to test equality of elements.
Return an equal?
hash code for self.
Return a vector containing values, in order.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Return the last item in the vector self.
Generate all but the last element of the vector self.
Not documented.
Not documented.
Return the position of object within the vector
self (counting from zero); or return null
if object does not occur within
self (uses an eql?
test). If start was supplied as non-‘null’, only
consider the portion starting at start, however, the returned position
will always be relative to the entire vector.
Return the position of object within the vector
self (counting from zero); or return null
if object does not occur within
self (uses an eql?
test). If end was supplied as non-‘null’, only
consider the portion ending at index end, however, the returned position
will always be relative to the entire vector.
Not documented.
Return a copy of the vector self.
Not documented.
Change the size of self to size. If size is smaller than the current size of self the vector will be truncated. Otherwise, the internal array of self will be grown to size and unused elements will be initialized to NULL.
Return a list of elements in self.
Not documented.
Append value to the END of the sequence self. Resize the array if necessary.
Remove value from the sequence self, and left shift the values after it to close the gap.
Not documented.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
STELLA provides its own implementation of hash tables for cases where language-native implementations are not available, or where additional features are needed.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
If supplied, the initial hash table will be sized to hold at least that many elements.
Not documented.
If true use equal?
as the
equality test and equal-hash-code
as the hash function, otherwise,
use eql?
and hash-code
(the default).
Lookup the entry identified by key in self and
return its value, or NULL if no such entry exists. Uses an eql?
test by default or equal?
if equal-test?
of self is TRUE.
Set the value of the entry identified by key in self
to value or add a new entry if no entry with key exists yet. Uses an
eql?
test by default or equal?
if equal-test?
of self is TRUE.
Remove the entry identified by key from self. Uses an
eql?
test by default or equal?
if equal-test?
of self is TRUE.
Return the number of entries in self.
Return TRUE if self has zero entries.
Return TRUE if self has at least 1 entry.
Return a copy of the hash table self. The bucket table and buckets are freshly allocated, however, the keys and values of entries are not copied themselves (similar to what we do for lists, etc.).
Remove all entries from self. This will result in a re-initialization of the table upon the first insertion into self.
Collect all entries of self into a cons list of
(<key> <value>)
pairs and return the result.
Return TRUE if x and y represent the same set of key/value pairs.
Return an equal?
hash code for self. Note that this
is O(N) in the number of entries of self.
Allocate an iterator for self.
Hashing objects into STELLA hash tables is accomplished via
hash-code
and equal-hash-code
methods. These methods are
implemented for all built-in STELLA types but are user extensible for
cases where special functionality on user-defined objects is needed.
Defining new hash-code
methods should only be necessary if new
wrapper types are defined, since for all types descending from
STANDARD-OBJECT
the built-in method should be adequate.
Return a hash code for self (can be negative). Two objects that are eq?
are guaranteed to generate the same hash code. Two objects that are not eq?
do not necessarily generate different hash codes. Similar to hash-code
but
always hashes on the address of self even if it is a wrapper.
Return a hash code for self (can be negative). Two objects that are eql?
are guaranteed to generate the same hash code. Two objects that are not eql?
do not necessarily generate different hash codes.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Return a hash code for self (can be negative). Two objects that are equal?
are guaranteed to generate the same hash code (provided, that writers of
object-equal?
methods also implemented the appropriate equal-hash-code
method). Two objects that are not equal?
do not necessarily generate different
hash codes.
The following low-level utilities are available to implement specialized
hashing schemes or for defining new versions of equal-hash-code
.
Map the hash code code onto a bucket index for a hash table
of size (i.e., onto the interval [0..size-1]. This is just like rem
for
positive hash codes but also works for negative hash codes by mapping those
onto a positive number first. Note, that the sign conversion mapping is not
equivalent to calling the abs
function (it simply masks the sign bit for
speed) and therefore really only makes sense for hash codes.
Rotate arg to the right by 1 position. This means shift arg to the right by one and feed in args bit zero from the left. In Lisp the result will stay in positive FIXNUM range. In C++ and Java this might return a negative value which might be equal to NULL-INTEGER. Important: to make this inlinable, it must be called with an atom (i.e., constant or variable) as its argument. This function is primarily useful for hashing sequences of items where the hash code should take the sequential order of elements into account (e.g., lists).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
KEY-VALUE-MAP
is a full-featured dictionary class that supports
eql?
or extensible equal?
equality tests, O(1) access
operations even for large numbers of entries by using a hash table,
light-weight KV-CONS
representation for small tables and
iteration even if the dictionary is represented by a hash table (note
that in STELLA we cannot iterate over regular HASH-TABLE
’s, since
native Lisp hash tables do not allow us to implement a hash table
iterator). Since large KEY-VALUE-MAP
’s are implemented via
STELLA-HASH-TABLE
’s, we can support iteration.
Full-featured dictionary class that supports eql?
or
equal?
equality tests, O(1) access operations even for large numbers
of entries by using a hash table, light-weight KV-CONS representation for
small tables and iteration even if the dictionary is represented by a
hash table.
Not documented.
If true use equal?
as the
equality test (and equal-hash-code
as the hash function), otherwise,
use eql?
(and hash-code
) (the default).
If supplied, the initial table will be sized to hold at least that many elements.
Not documented.
Lookup the entry identified by key in self and
return its value, or NULL if no such entry exists. Uses an eql?
test by default or equal?
if equal-test?
of self is TRUE.
Set the value of the entry identified by key in self
to value or add a new entry if no entry with key exists yet. Uses an
eql?
test by default or equal?
if equal-test?
of self is TRUE.
Remove the entry identified by key from self. Uses an
eql?
test by default or equal?
if equal-test?
of self is TRUE.
Return the number of entries in self.
Return TRUE if self has zero entries.
Return TRUE if self has at least 1 entry.
Return a copy of the map self. All entries are freshly allocated, however, the keys and values of entries are not copied themselves (similar to what we do for lists, etc.).
Reset self to have zero entries.
Allocate an iterator for self. The only modifying operations allowed during iteration are removal of the current element or changing its value. All other removal or insertion operations might lead to corruption or undefined results.
Collect all entries of self into a cons list of
(<key> <value>)
pairs and return the result.
Return TRUE if x and y represent the same set of key/value pairs.
Return an equal?
hash code for self. Note that this
is O(N) in the number of entries of self.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
HASH-SET
is a full-featured set class that supports eql?
or extensible equal?
equality tests, O(1) insert and
member?
operations, O(N) intersection
etc. operations even
for large numbers of entries by using a STELLA hash table, light-weight
KV-CONS
representation for small sets and iteration even if the
set is represented by a hash table. The only minor drawback right now
is that we waste one value slot per entry, since we piggy-back off
KEY-VALUE-MAP
’s, however, that wastes at most 25% space.
Full-featured set class that supports eql?
or equal?
equality tests, O(1) insert and member?
operations & O(N) intersection
etc. operations even for large numbers of entries by using a hash table,
light-weight KV-CONS representation for small sets and iteration even if the
set is represented by a hash table. The only minor drawback right now is that
this wastes a value slot per entry, since we piggy-back off KEY-VALUE-MAP’s,
however, that wastes at most 25% space.
Return an eql?
HASH-SET containing values.
Return TRUE iff object is a member of the set self.
Uses an eql?
test by default or equal?
if equal-test?
of self is TRUE.
Add value to the set self unless it is already a member.
Uses an eql?
test by default or equal?
if equal-test?
of self is TRUE.
Destructively remove value from the set self if it is a member and
return self. Uses an eql?
test by default or equal?
if equal-test?
of
self is TRUE.
Destructively remove all elements of the set self for which test? evaluates to TRUE. test? takes a single argument of type OBJECT and returns TRUE or FALSE. Returns self.
Remove and return an arbitrary element of the set self.
Return NULL if the set is empty. Performance note: for large sets implemented
via hash tables it takes O(N) to empty out the set with repeated calls to pop
,
since the emptier the table gets, the longer it takes to find an element.
Therefore, it is usually better to use iteration with embedded removals for
such cases.
Destructively replace old with new in the set self
unless new is already a member. Uses an eql?
test by default or equal?
if equal-test?
of self is TRUE.
Return a copy of the set self. All entries are freshly allocated, however, the values are not copied themselves (similar to what we do for lists, etc.).
Collect all entries of self into a cons list and return the result.
Return true if every element of self also occurs in otherSet.
Uses an eql?
test by default or equal?
if equal-test?
of self is TRUE.
Return true if every element of self occurs in otherSet and vice versa.
Uses an eql?
test by default or equal?
if equal-test?
of self is TRUE.
Return the set intersection of self and otherSet as a new set.
Uses an eql?
test by default or equal?
if equal-test?
of self is TRUE.
Return the set union of self and otherSet as a new set.
Uses an eql?
test by default or equal?
if equal-test?
of self is TRUE.
Return the set difference of self and otherSet as a new set (i.e.,
all elements that are in self but not in otherSet). Uses an eql?
test
by default or equal?
if equal-test?
of self is TRUE.
Return the set difference of self and otherSet by destructively
removing elements from self that also occur in otherSet. Uses an eql?
test by default or equal?
if equal-test?
of self is TRUE.
Return TRUE iff sets x and y are HASH-SET’s with equivalent members.
Uses an eql?
test by default or equal?
if equal-test?
of self
is TRUE.
This is equivalent to calling equivalent-sets?
.
Return an equal?
hash code for self. Note that this
is O(N) in the number of elements of self.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Return TRUE if the sequence represented by self has no elements. Side-effect free.
Iterate over values of self, returning TRUE
if one of them is eql
to ’value.
Iterate over self, and count how many items there are. Bad idea if self iterates over an infinite collection, since in that case it will run forever.’
Return the first item of the sequence represented by self, or NULL if it is empty. Destructively uses up the first iteration element.
Return self after skipping over the first n elements in the (remainder of the) iteration.
Return an iterator that first generates all values of iterator1, then those of iterator2, and then those of all otherIterators. The generated values can be filtered by supplying a filter function to the resulting iterator.
Return a list of elements generated by self.
Apply the stored next?
function to self.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Return the first symbol with name visible from the current module.
Return a newly-created or existing symbol with name name.
Remove self from its home module and the symbol table.
Return the first symbol with name visible from module.
If local? only consider symbols directly interned in module.
If module is null
, use *MODULE*
instead.
Look for a symbol named name in module (if local? do not consider inherited modules). If none exists, intern it locally in module. Return the existing or newly-created symbol.
Return a newly-created or existing symbol with name newName which is interned in the same module as baseSymbol.
Return true
if self is visible from the current module.
Return the list of symbols with name visible from module.
More specific symbols (relative to the module precedence order defined by
visible-modules
) come earlier in the list. If module is null
, start
from *MODULE*
instead. If enforceShadowing? is true, do not return any
symbols that are shadowed due to some :SHADOW declaration.
Import symbol into module and return the imported symbol. Signal an error if a different symbol with the same name already exists locally in module. Any symbol with the same name visible in module by inheritance will be shadowed by the newly imported symbol.
Safe version of import-symbol
(which see). Only imports symbol if
no symbol with that name is currently interned or visible in module.
Returns symbol if it was imported or the conflicting symbol in module
otherwise.
Return the first surrogate with name visible from the current module.
Return a newly-created or existing surrogate with name name.
Remove self from its home module and the surrogate table.
Return the first surrogate with name visible from module.
If local? only consider surrogates directly interned in module.
If module is null
, use *MODULE*
instead.
Look for a symbol named name in module (if local? do not consider inherited modules). If none exists, intern it locally in module. Return the existing or newly-created symbol.
Return a newly-created or existing surrogate with name newName which is interned in the same module as baseSymbol.
Return true
if self is visible from the current module.
Return the list of surrogates with name visible from module.
More specific surrogates (relative to the module precedence order defined by
visible-modules
) come earlier in the list. If module is null
, start
from *MODULE*
instead. If enforceShadowing? is true, do not return any
surrogates that are shadowed due to some :SHADOW declaration.
Import surrogate into module and return the imported surrogate. Signal an error if a different surrogate with the same name already exists locally in module. Any surrogate with the same name visible in module by inheritance will be shadowed by the newly imported surrogate.
Safe version of import-surrogate
(which see). Only imports surrogate if
no surrogate with that name is currently interned or visible in module.
Returns surrogate if it was imported or the conflicting surrogate in module
otherwise.
Return the keyword with name if it exists.
Return a newly-created or existing keyword with name name. Storage note: a COPY of name is stored in the keyword
Return a transient symbol with a name beginning with prefix and ending with a globally gensym’d integer.
Not documented.
Return the property list of symbol. The symbol-plist
of a symbol can be set with setf
. IMPORTANT: Property list are modified
destructively, hence, if you supply it as a whole make sure to always supply
a modfiable copy, e.g., by using bquote
.
Return the property of symbol whose key is eq?
to key.
Symbol properties can be set with setf
.
Return the value of symbol. Note, that this value is not
visible to code that references a variable with the same name as symbol.
The symbol-value
is simply a special property that can always be accessed
in constant time. The symbol-value
of a symbol can be changed with setf
.
Convert surrogate into a symbol with the same name and module.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Return the context located at pathName, or null
if no such context exists. If error? is true
, throw an exception
if no context is found, otherwise silently return null
.
Destroy all objects belonging to self or any of its subcontexts.
Execute body within the context resulting from contextForm.
Make the translator happy.
Destroy the context self, and recursively destroy all contexts that inherit self.
Change the current context to be the context context.
Change the current context to be the context named contextName.
Change the current context to the one named name. Return the
value of the new current context. If no name is supplied, return
the pre-existing value of the current context. cc
is a no-op if the
context reference cannot be successfully evaluated.
Define (or redefine) a module named name. The accepted syntax is:
(defmodule <module-name> [:documentation <docstring>] [:includes {<module-name> | (<module-name>*)}] [:uses {<module-name> | (<module-name>*)}] [:lisp-package <package-name-string>] [:java-package <package-specification-string>] [:cpp-namespace <namespace-name-string>] [:java-catchall-class [:api? {TRUE | FALSE}] [:case-sensitive? {TRUE | FALSE}] [:shadow (<symbol>*)] [:java-catchall-class <class-name-string>] [<other-options>*]) |
name can be a string or a symbol.
Modules include objects from other modules via two separate mechanisms:
(1) they inherit from their parents specified via the :includes
option
and/or a fully qualified module name, and (2) they inherit from used
modules specified via the :uses
option. The main difference between
the two mechanisms is that inheritance from parents is transitive, while
uses-links are only followed one level deep. I.e., a module A that uses
B will see all objects of B (and any of B’s parents) but not see anything
from modules used by B. Another difference is that only objects declared
as public can be inherited via uses-links (this is not yet enforced).
Note that - contrary to Lisp - there are separate name spaces for classes,
functions, and variables. For example, a module could inherit the class
CONS
from the STELLA
module, but shadow the function of the same name.
The above discussion of :includes
and :uses
semantics keyed on the
inheritance/visibility of symbols. The PowerLoom system makes another
very important distinction: If a module A
is inherited directly or
indirectly via :includes
specification(s) by a submodule B
, then all
definitions and facts asserted in A
are visible in B
. This is not the
cases for :uses
; the :uses
options does not impact inheritance of
propositions at all.
The list of modules specified in the
:includes
option plus (if supplied) the parent in the path used for
name become the new module’s parents. If no :uses
option was
supplied, the new module will use the STELLA
module by default,
otherwise, it will use the set of specified modules.
If :case-sensitive?
is supplied as TRUE, symbols in the module
will be interned case-sensitively, otherwise (the default), they
will be converted to uppercase before they get interned. That
means that any reference from inside a case-sensitive module to a
non-case-sensitive module will have to use uppercase names for
symbols in the non-case-sensitive module. The standard system
modules are all NOT case sensitive.
Modules can shadow definitions of functions and classes inherited
from parents or used modules. Shadowing is done automatically,
but generates a warning unless the shadowed type or function name
is listed in the :shadow
option of the module definition .
Examples:
(defmodule "PL-KERNEL/PL-USER" :uses ("LOGIC" "STELLA") :package "PL-USER") (defmodule PL-USER/GENEALOGY) |
The remaining options are relevant only for modules that contain STELLA code. Modules used only to contain knowledge base definitions and assertions have no use for them:
The keywords :lisp-package
, :java-package
, and :cpp-package
specify
the name of a native package or name space in which symbols of the module
should be allocated when they get translated into one of Lisp, Java, or
C++. By default, Lisp symbols are allocated in the STELLA
package, and
C++ names are translated without any prefixes. The rules that the STELLA
translator uses to attach translated Java objects to classes and packages
are somewhat complex. Use :java-package option to specify a list of
package names (separated by periods) that prefix the Java object in this
module. Use :java-catchall-class to specify the name of the Java class to
contain all global & special variables, parameter-less functions and functions
defined on arguments that are not classes in the current module.
The default value will be the name of the module.
When set to TRUE, the :api? option tells the PowerLoom User Manual
generator that all functions defined in this module should be included in
the API section. Additionally, the Java translator makes all API
functions synchronized
.
Return the module located at pathName, or null
if no such module exists. The search looks at ancestors and top-most
(cardinal) modules. If error? is true
, throw an exception if no
module is found.
Return a module located at pathname if one exists, otherwise create one
Destroy all objects belonging to module name or any of its children. If no name is supplied, the current module will be cleared after confirming with the user. Important modules such as STELLA are protected against accidental clearing.
Destroy the module self, and recursively destroy all contexts that inherit self.
Destroy the context self, and recursively destroy all contexts that inherit self.
Return a list of all modules visible from module from (or *module*
if from is NULL. The generated modules are generated from most to
least-specific and will start with the module from.
Execute body within the module resulting from moduleForm.
*module*
is an acceptable moduleForm. It will locally rebind
*module*
and *context*
and shield the outer bindings from changes.
Change the current module to the module named name.
Change the current module to be the module module.
Change the current module to be the module named moduleName.
Create a new world below the world or module parentContext. Optionally, specify a name.
Spawn a new world that is a child of the current context, and change the current context to the new world.
Destroy the current world and change the current context to be its parent. Return the current context. Nothing happens if there is no current world.
Destroy the context self, and recursively destroy all contexts that inherit self.
Execute body within the world resulting from worldForm.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Read one STELLA s-expression from stream and return
the result. Return true
as the second value on EOF.
Read one STELLA s-expression from string and return the result.
Read one line from stream and return the result.
This differs from native-read-line
in that it is not platform-dependent.
It recognizes any of the three common line ending formats: CR, LF, CR-LF
in any combination. It is not as fast as native-read-line
, however.
Read one character from inputStream and return the result.
Return true
as the second value on EOF.
Unread ch from inputStream. Signal an error if ch was not the last character read.
Read a line of input from STANDARD-INPUT and return true
if the input was y
or false
if the input was n
. Loop until either
y
or n
was entered. If message is non-‘null’ prompt with it before
the input is read. See also special variable *USER-QUERY-ACTION*
.
Read a line of input from STANDARD-INPUT and return true
if the input was yes
or false
if the input was no
. Loop until either
yes
or no
was entered. If message is non-‘null’ prompt with it before
the input is read. See also special variable *USER-QUERY-ACTION*
.
Flush all buffered output of self.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Open file fileName for input and return the resulting input stream.
By default signal an error if the file does not exist. The only legal
option so far is :IF-NOT-EXISTS
(or :IF-NOT-EXISTS-ACTION
) which
specifies what to do in case the file does not exist. If its value is
:ERROR
then an error will be signaled. If it is :ABORT
or :PROBE
the opening operation will be aborted and NULL will be returned.
Open file fileName for output and return the resulting output stream.
By default the file will be created or overwritten if it already exists.
If :IF-EXISTS
(or :IF-EXISTS-ACTION
) is one of the options its value
specifies what to do in case the file already exists. If the value is
:SUPERSEDE
the pre-existing file will be overwritten. If the value is
:APPEND
the preexisting file will be appended to (if the file did not
yet exist the file will simply be created). If the value is :ERROR
then
an error will be signaled. If it is :ABORT
or :PROBE
the opening operation
will be aborted and NULL will be returned.
If :IF-NOT-EXISTS
(or :IF-NOT-EXISTS-ACTION
) is one of the options its
value specifies what to do in case the file does not already exist. If the
value is :CREATE
, the file will simply be created. If the value is
:CREATE-PATH
the file will be created plus any non-existing directories
in the directory path of fileName will also be created. If the value is
:ERROR
then an error will be signaled. If it is :ABORT
or :PROBE
the
opening operation will be aborted and NULL will be returned.
Close the stream self.
Close all currently open file streams. Use for emergencies or for cleanup.
Sets up an unwind-protected form which opens a file for
input and closes it afterwards. The stream for reading is bound to the
variable provided in the macro form.
Syntax is (WITH-INPUT-FILE (var filename options*) body+)
where options
can be any that are legal for open-input-file
(which see).
Sets up an unwind-protected form which opens a file for
output and closes it afterwards. The stream for writing is bound to the
variable provided in the macro form.
Syntax is (WITH-OUTPUT-FILE (var filename options*) body+)
where options
can be any that are legal for open-output-file
(which see).
Return true if file fileName exists. Note that this does
not necessarily mean that the file can also be read.
IMPORTANT Java idiosyncrasy: if file foo/bar
exists and is not a directory,
Java will also say foo/bar/
exists, which is different behavior than in Lisp
and C++. For this reason, make sure to always use probe-directory?
to test
whether a directory exists.
Return the time at which file fileName was last modified or NULL if that cannot be determined.
Return the length of file fileName in bytes or NULL if that cannot be determined.
Copy file fromFile to file toFile, clobbering any data already in toFile.
Delete the file fileName.
Rename the file fromFile to toFile.
Return a file name of the form <prefix>NNNNNN<suffix>
which is guaranteed to not refer to any existing file. A null prefix
defaults to tmpfile
, a null suffix defaults to the empty string.
The number portion NNNNNN will correpond to a random number between 0
and 999999. If no qualifying filename can be found after 100 attempts,
NULL will be returned. Note that it is possible due to multi-threading
or processing that the generated filename becomes used by another thread
or OS process. If necessary, this case can be handled by the caller.
Return directory as a file name, i.e., without a terminating directory separator.
Return the level-th parent directory component of directory including the final directory separator, or the empty string if directory does not have that many parents.
Return file interpreted as a directory, i.e., with a terminating directory separator. If file is the empty string simply return the empty string, i.e., interpret it as the current directory instead of the root directory.
Return the directory component of file including the final directory separator or the empty string if file does not include a directory. Note that for purposes of this function, a logical host is considered part of the directory portion of file
Return the file name portion of file by removing any directory and logical host components.
Remove files extension (or type) if there is any and return the result.
Return files extension (or type) if it has any including the separator character.
Remove files directory (including logical host) and extension components and return the result.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
Not documented.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Returns the current time in UTC as multiple values of year month day day-of-week hour minute second millisecond. Currently millisecond will always be zero (even in Java where it is technically available).
Returns the current time zone offset from UTC as a float, considering the effects of daylight savings time.
Create a calendar date with current time and date.
Create a calendar date with the specified components. year must be the complete year (i.e., a year of 98 is 98 A.D in the 1st century). timezone is a real number in the range -12.0 to +14.0 where UTC is zone 0.0; The number is the number of hours to add to UTC to arrive at local time.
Tries very hard to make sense out of the argument date-time-string and
returns a time structure if successful. If not, it returns null
.
If error-on-mismatch? is true, parse-date-time will signal an error instead of
returning null
.
Default values are 00:00:00 local time on the current date
Returns a decoded time object for date interpreted in timezone timezone is the number of hours added to UTC to get local time. It is in the range -12.0 to +14.0 where UTC is zone 0.0
Returns a calendar date object for time-structure.
Not yet implemented.
Returns a calendar date object representing the date and time
parsed from the input string. If no valid parse is found,
null
is returned.
Not yet implemented.
Returns the YEAR, MONTH, DAY, DAY-OF-WEEK on which the given julian-day begins at noon.
Returns the day of the week for yyyy-mm-dd.
Returns the day of the week for julian-day
Returns the Julian day that starts at noon on yyyy-mm-dd. yyyy is the year. mm is the month. dd is the day of month. Negative years are B.C. Remember there is no year zero.
Returns the Julian Day and fraction of day of the Nth occurence since January 1, 1900 of moon PHASE. PHASE is one of :NEW-MOON, :FIRST-QUARTER, :FULL-MOON, :LAST-QUARTER
Returns multiple values of hours, minutes, seconds, milliseconds for time specified in milliseconds.
Returns the modified Julian day during which julian-daystarts at noon.
Returns the modified Julian day during which julian-day
starts at noon.
Add t1 to t2. If one of t1 or t2 is a calendar date, then the result is a calendar date. If both t1 and t2 are relative dates, then the result is a relative date. t1 and t2 cannot both be calendar dates.
Divides the relative date t1 by t2. t2 must be either a relative date or a wrapped number. If t2 is a relative date, then the return value will be a wrapped float. If t2 is a wrapped number, then the reutrn value will be a relative date.
Multiplies a relative date by a wrapped number. One of t1 or t2 must be a relative date and the other a wrapped number.
Subtract t2 from t1. If t1 is a calendar date, then t2 can be either a calendar date (in which case the return value is a relative date) or it can be a relative date (in which case the return value is a calendar date). If t1 is a relative date, then t2 must also be a relative date and a relative date is returned.
Return the current CPU time. If the current OS/Language
combination does not support measuring of CPU time, return real time instead.
Use ticktock-difference
to measure the time difference between values
returned by this function. This is an attempt to provide some platform
independent support to measure (at least approximately) consumed CPU time.
The difference in two TICKTOCK time values in seconds where t1 is the earlier time. The resolution is implementation dependent but will normally be some fractional value of a second.
The minimum theoretically detectable resolution of the difference in two TICKTOCK time values in seconds. This resolution is implementation dependent. It may also not be realizable in practice, since the timing grain size may be larger than this resolution.
The program will sleep for the indicated number of seconds. Fractional values are allowed, but the results are implementation dependent: Common Lisp uses the fractions natively, Java with a resolution of 0.001, and C++ can only use integral values.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Creates and interns an XML element object name using namespace-name
to refer to namespace. If namespace is null
, then the element will
be interned in the null namespace. namespace must otherwise be a URI.
Creates and interns an XML global attribute object with name using namespace-name to refer to namespace. namespacemust be a URI.
Make an XML-LOCAL-ATTRIBUTE named name associated with element
Return the XML tag object of an XML expression.
Return the list of attributes of an XML expression (may be empty).
Return the list of content elements of an XML expression (may be empty).
Return the CDATA content of a CDATA form. Does NOT make sure that form actually is a CDATA form, so bad things can happen if it is given wrong input.
Return true
if item is an XML declaration object
Return true
if item is an XML element object
Return true
if item is an XML attribute object
Return true
if item is an XML CDATA tag object
Return true
if form is a CONS headed by a CDATA tag
Returns true
if tag is an XML element with the name name
in namespace namespace. Note that namespace is the full URI, not an abbreviation.
Also, namespace may be null
, in which case tag must not have a namespace
associated with it.
Return true
if attribute is an XML attribute with name name
in namespace namespace. Note that namespace is the full URI, not an
abbreviation. Also, namespace may be null
, in which case attribute
must not have a namespace associated with it.
Return true
if attribute is a global XML attribute with name name
in namespace namespace. Note that namespace is the full URI, not an
abbreviation. Also, namespace may be null
, in which case attribute
must not have a namespace associated with it.
Return true
if attribute is a local XML attribute with name name.
Note that namespace must be null
and that the attributes parent element
element is not considered by the match. To take the parent element into
account use xml-local-attribute-match?
.
Return true if attribute is a local attribute with name and whose parent element matches element-name and element-namespace.
Find the XML attribute in attributes with name and namespace and return its value. Note that it is assumed that all attributes come from the same known tag, hence, the parent elements of any local attributes are not considered by the lookup.
A case form for matching item against XML element tags. Each
element of clauses should be a clause with the form
("tagname" ...) or
(("tagname" "namespace-uri") ...)
The clause heads can optionally be symbols instead of strings. The key forms the
parameters to the method xml-element-match?
, with a missing namespace argument
passed as NULL.
The namespace argument will be evaluated, so one can use bound variables in place of a fixed string. As a special case, if the namespace argument is :ANY, then the test will be done for a match on the tag name alone.
Read one balanced XML expression from stream and return
its s-expression representation (see xml-token-list-to-s-expression
). If
startTagName
is non-‘null’, skip all tags until a start tag matching start-tag
is encountered. XML namespaces are ignored for outside of the start tag.
Use s-expression representation to specify start-tag, e.g., (KIF (:version "1.0"))
.
The tag can be an XML element object, a symbol, a string or a cons. If the tag is a cons
the first element can also be (name namespace) pair.
Return true
as the second value on EOF.
CHANGE WARNING: It is anticipated that this function will change to a) Properly take XML namespaces into account and b) require XML element objects instead of strings as the second argument. This change will not be backwards-compatible.
Return an XML-expression-iterator (which see) reading from
stream. regionTag can be used to define delimited regions from which
expressions should be considered. Use s-expression representation to specify
regionTag, e.g., (KIF (:version "1.0"))
. The tag can be an XML element
object, a symbol, a string or a cons. If the tag is a cons the first element
can also be (name namespace) pair.
Prints xml-expression on stream. Indentation begins with the
value of indent. If this is the null
integer, no indentation is
performed. Otherwise it should normally be specified as 0 (zero) for
top-level calls.
It is assumed that the xml-expression is a well-formed CONS-list
representation of an XML form. It expects a form like that form
returned by read-XML-expression
.
Also handles a list of xml forms such as that returned by XML-expressions
.
In that case, each of the forms is indented by indent spaces.
Resets Hashtables used for interning XML elements and global attribute objects. This will allow garbage collection of no-longer used objects, but will also mean that newly parsed xml elements and global attributes will not be eq? to already existing ones with the same name.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This is a catch-all section for functions and methods that haven’t been categorized yet into any of the previous sections. They are in random order and many of them will never be part of the official STELLA interface. So beware!
Not documented.
Return the element of self at position [i]
.
Return the 1D address of the element at position [i]
.
This is useful for fast element-wise iteration that doesn’t need arithmetic.
Set the element of self at position [i]
to value
and return the result.
Return the element of self at position [i, j]
.
Return the 1D address of the element at position [i, j]
.
This is useful for fast element-wise iteration that doesn’t need arithmetic.
Set the element of self at position [i, j]
to value
and return the result.
Return the absolute value of x.
Install demon in the location(s) specified by its internal structure.
True if self or a superslot of self is marked active.
Add value to property in configuration and return it. If a previous value exists add value to the end (listify the old value if it is not yet a list). Otherwise, create a new list containing value. Use the global system configuration table if configuration is NULL.
Fill in substitution-list with date information for the current
date and time. See add-date-substitution
for details.
Fill in substitution-list with template variable substitions for the names YEAR, MONTH, MON, DAY, HOUR, MINUTE, SECOND, TIMEZONE, DAY-OF-WEEK, DOW with their values for date. Also, pre-formatted DATE, TIME and ISO8601 variables are set.
TIMEZONE is in the format "{+|-}hhmm". MONTH is the full English month name and MON is the numeric month. DAY-OF-WEEK is an English string and DOW is the first three letters. Minutes and seconds are zero-padded.
These substitutions can be used with substitute-template-variables-in-string
Insert the function named hookFunction into hookList.
Append the directories listed in the |-separated path to the end of the STELLA load path. Return the resulting load path.
Add value to the end of propertys (a string or symbol) value list in the configuration table. Coerces the current value to a list or initializes the list if it is as yet undefined. Allows incremental addition of values to list-valued propertys. Note that property is evaluated and will need to be quoted if supplied as a symbol. Symbols will also be upcased if this command is run in a non-case-sensitive module.
Enable trace messages identified by any of the listed keywords. After
calling (add-trace
<keyword>) code guarded by (trace-if
<keyword> ...)
will be executed when it is encountered.
Returns the first index into source, starting from start, of the first character that is not white space.
Iterate over all classes visible from module. If local?, return only classes interned in module. If module is null, return all classes interned everywhere.
Return an iterator that generates all contexts.
Evaluate each of the forms in forms, and return TRUE if none of them are NULL.
Iterate over all functions visible from module. If local?, return only functions bound to symbols interned in module. If module is null, return all functions defined everywhere.
Generate a sequence of all modules included by self, inclusive, starting from the highest ancestor and working down to self (which is last).
Iterate over all methods visible from module. If local?, return only methods interned in module. If module is null, return all methods interned everywhere.
Return an iterator that generates all modules.
Iterate over all functions visible from module. If local?, return only functions bound to symbols interned in module. If module is null, return all functions defined everywhere.
Iterate over all public methods visible from module. If local?, return only methods interned in module. If module is null, return all methods interned everywhere.
Returns a CONS of all of the systems required by system-name
Iterate over all slots visible from module. If local?, return only methods interned in module. If module is null, return all methods interned everywhere.
Return an iterator that generates all subcontexts of
self
(not including self
) in the order specified by traversal (one
of :preorder, :inorder, :postorder or :topdown).
Iterate over all surrogates visible from module. If local?, return only surrogates interned in module. If module is null, return all surrogates interned everywhere.
Iterate over all symbols visible from module. If local?, return only symbols interned in module. If module is null, return all symbols interned everywhere.
Iterate over all variables visible from module. If local?, return only variables bound to symbols interned in module. If module is null, return all variables defined everywhere.
Allocate a cross product iterator for a list of domains.
Iterator objects return themselves when asked
for an iterator (they occupy the same position as a collection
within a foreach
statement).
Alias for clone-memoized-iterator
.
Return the most specific :allocation facet, or :instance if all inherited values are NULL.
Append char to the END of the string self. Resize the buffer if necessary.
Append value to the END of the string self. Resize the buffer if necessary.
Apply code to arguments, returning a value of type OBJECT. Currently limited to at most 10 arguments.
Apply code to arguments, returning a value of type BOOLEAN.
Apply code to arguments, returning a value of type FLOAT.
Apply code to arguments, returning a value of type INTEGER.
Apply code to arguments, returning a value of type LONG-INTEGER.
Apply code to arguments, returning a value of type OBJECT.
Apply code to arguments, returning a value of type STRING.
Autoload function qualifiedName from system systemName. If it is already present in the system, simply return its code. If cache is defined, return its value if defined, otherwise, set its value to the function found. If the function failed to be defined by loading systemName and error? is true, raise an error. Otherwise, simply return NULL.
Converts (x y z) into a float. The return value is x + y/60 + z/3600. This can be used to convert from Degree-Minute-Second to decimal degrees or from Hour-Minute-Second format to decimal hours.
Return true if string is either NULL, empty, or only contains white space characters.
Interrupt the program and print message. Continue after confirmation with the user.
Increase the indentation level for subsequent log messages.
Read from stream filling buffer between start and end (depending on how many characters are available). Return the actual end pointer to the input read into buffer. EOF is indicated by the return value being equal to start.
Write from buffer to stream, using data in the buffer starting at position start stopping just before end.
Returns the date part of the string representation of date
adjusted for timezone. Format is YYYY-MMM-DD, where MMM is a three letter
English abbreviation of the month if numeric-month? is false
and a two
digit numeric value if numeric-month? is true
. The value false
is
recommended.
Returns an ISO-8601 string representation of date adjusted for timezone.
The Format is YYYY-MM-DDThh:mm:ss z:zz. The timezone as an offset
hh:mm is included if include-timezone? is true
.
Recommended values for the flag is true
.
Returns a string representation of date adjusted for timezone.
The Format is YYYY-MMM-DD hh:mm:ss z.z, where MMM is a three letter
English abbreviation of the month if numeric-month? is false
and a two
digit numeric value if numeric-month? is true
. The timezone as a
float offset z.z is included if include-timezone? is true
.
Recommended values for the flags are false
and true
respectively.
Returns the time part of the string representation of date
adjusted for timezone. The timezone is included in the string if
include-timezone? is true
. The value true
is recommended.
Milliseconds will be included if include-millis? is true
.
Hours will be zero-padded to length 2 if pad-hours? is true
.
Destroy all objects belonging to module name or any of its children. If no name is supplied, the current module will be cleared after confirming with the user. Important modules such as STELLA are protected against accidental clearing.
Computes the slot at the base of a renaming chain for slot.
Name of the slot at the base of a renaming chain for slot.
Perform a run-time type check, and then return value.
Change the current context to the one named name. Return the
value of the new current context. If no name is supplied, return
the pre-existing value of the current context. cc
is a no-op if the
context reference cannot be successfully evaluated.
In CommonLisp, if the new context is case sensitive, then change
the readtable case to the value of CL-USER::*STELLA-CASE-SENSITIVE-READ-MODE*
[default = :INVERT], otherwise to :UPCASE.
Lookup slot slotName on object and return the lispified
slot value (see lispify
). If dontConvert? is TRUE, the returned slot value
will not be lispified. Generate a warning if no such slot exists on object.
In a call directly from Lisp slotName can also be supplied as a Lisp symbol.
Lookup slot slotName on object and set its value to
the stellafied value (see stellafy
). If dontConvert? is TRUE, value
will not be stellafied before it gets assigned. Generate a warning if no
such slot exists on object, or if value has the wrong type. In a call
directly from Lisp slotName can also be supplied as a Lisp symbol.
Translate a Stella file to Common-Lisp. If relative?, concatenate root directory to file.
Translate a Stella system named system-name to Common Lisp.
Remove all finalized classes from *UNFINALIZED-CLASSES*
,
and set *NEWLY-UNFINALIZED-CLASSES?*
to false
.
Clear self by setting its active length to zero.
Clear self by setting its active length to zero.
Clear self by setting its active length to zero.
Remove property in configuration and return the previous value. Use the global system configuration table if configuration is NULL.
Clear all buffered raw and tokenized input of self.
Reset list to its empty state.
Reset all currently active recycle lists to their empty state.
Clears out the system definition named name. If
name is null
, then clear out all system definitions. This function
is useful when changes have been made to the system definition, and one
wants to have it reloaded from the standard location in the file system.
Disable all tracing previously enabled with add-trace
.
Clone the memoized iterator self so it can be used to iterate over the collection represented by self, while allowing to iterate over it multiple times via multiple clones.
Convenience macro to splice Lisp expressions into STELLA expressions
without upsetting the translator during interactive sessions.
If code is a currently bound Lisp variable, this tries to infer the
type of the resulting expression from the object code is bound to
and generates an appropriate cast. clv
stands for Common-Lisp Value
or Verbatim.
Coerce the argument list variable restVariable into a CONS list containing all its elements (uses argument list iteration to do so). If restVariable already is a CONS due to argument listification, this is a no-op.
Coerce value to type. Return NULL if not possible.
Return the boolean object represented by object. Return NULL if coercion is not possible.
Coerce number
to a float value or NULL if not possible.
Coerce the collection self into a HASH-SET. Use an equal test if equalTest? is TRUE (equalTest? will be ignored if self already is a HASH-SET).
Coerce object into a string. If no standard coercion is possible, simply stringify object.
Return the (generalized) symbol represented by name.
Return null
if name is undefined or does not represent a string.
Return the boolean object represented by value. Return NULL if coercion is not possible or raise an error if error? is TRUE.
Coerce value to a float value if possible, return NULL otherwise or raise an error if error? is true.
Coerce value into a string if possible, return NULL otherwise or raise an error if error? is true.
Coerce value to type. Return NULL if not possible or raise an error if error? is TRUE.
Use a VRLET to collect values. Input can have one of the following forms:
(collect <var> in <expression> [where <test> <var>]) (collect <collect-expression> foreach <var> in <expression> {as ...}* [where <test> <var>] [do ...]) |
The second form really accepts an arbitrary foreach
expression following
the foreach
keyword.
True if slot values are collections.
Return true
if method is an evaluable command.
Compare x and y and return -1, 0, or 1, depending on whether
x is less than, equal, or greater than y relative to collation. Currently
supported values for collation are :ascii-case-sensitive, :ascii-case-insensitive
:ascii-case-normalized. The first two correspond to string-compare
called with
the appropriate third argument. :ascii-case-normalized calls the function
string-compare-case-normalized
(which see).
True if fillers of this slot are components of the owner slot, and therefore should be deleted if the owner is deleted.
name-components is a cons to be processed into a namestring.
:prefix
and :suffix
are strings that will NOT be case-converted.
:case
is one of :UPCASE :TitleCase :titleCaseX :downcase :Capitalize
default is :TitleCase
:separator
is a string that should separate word elements. It does not
separate the prefix or suffix. Default is ""
:translation-table
should be a STRING-HASH-TABLE hash table that strings into their
desired printed representation as a string. In general the argument
will be strings, but that is not strictly necessary.
Non-keyword version of compose-namestring
, which will probably be
easier to use when called from non-Lisp languages.
Compute the module indicated by the STELLA name name and return it. Return the bare symbol name as the second value. name does not necessarily have to be qualified in which case the current module is returned. name is assumed to be the printed representation of a STELLA symbol, surrogate or keyword.
Compute any root directories for sources, native and Lisp binary directories in case they were not explicitly specified in systems definition. Raises an error in case any of those root directories is missing and can’t be computed.
Intelligently join file and otherFiles into a concatenated path where each component is separated by a single separator (similar to Python’s os.path.join). Keeps the result a logical pathname as long as possible, but converts to physical as soon as any of otherFiles contain a physical directory separator.
Load the configuration file value. This will modify currently set system properties defined in value with new values but leave all other currently set properties as they are.
Perform STELLA run-time configuration. If supplied, load the configuration file file first which should be supplied with a physical pathname.
If object
is a CONS, return it. Otherwise, return
a singleton cons list containing it.
Convert count command line arguments into a CONS list.
Signal error message, placing non-string arguments in quotes.
Return a copy of the vector sequence self.
Return a copy of the vector sequence self.
Return a copy of the heap self.
Return a copy of string.
Copy in verbatimely to out. Does the right thing for binary data.
Dynamically determine the byte offset where the native value for slot starts in self.
This basically performs the function of the C++ macro offsetof
but does it dynamically. Of course, it
relies on a working read/write-slot-value
mechanism and we currently primarily use this for the Python API.
This basically writes value changes of slot to determine a byte position where a change occurred and
then restores the original value (which can be NULL). This handles all native OBJECT and LITERAL slots
but does not handle special slots such as dynamic-slots
or hardwired slots or other non-standard types.
Translate the system systemName to C++.
Translate statement to C++ and print the result.
Create a new list object with the same type as self.
If directory does not yet exist, create it and any of its parents that do not yet exist. If directory already does exist, this simply is a no-op.
Funcallable version of the new
operator.
Return an instance of the class named by type. If initial-value-pairs
is supplied, it has to be a key/value list similar to what’s accepted by new
and the named slots will be initialized with the supplied values. Similar to
new
, all required arguments for type must be included. Since all the
slot initialization, etc. is handled dynamically at run time, create-object
is much slower than new
; therefore, it should only be used if type cannot
be known at translation time.
Transform date into a version string according to granularity which is at least :days and defaults to :seconds.
Detach demon from the location(s) specified by its internal structure.
Returns an ISO-8601 string representation of date The Format is YYYY-MM-DDThh:mm:ss+zz:zz, with the string stopping at when a null value is first encountered. The time zone will only be included (if present) if a time value is given.
Keyword options: :break-on-cap one of :YES :NO :CLEVER default is :CLEVER :break-on-number one of :YES :NO :CLEVER default is :CLEVER :break-on-separators string default is "-_ "
DECOMPOSE-NAMESTRING returns a cons of STRING-WRAPPERS that are the decomposition of the
input STRING. The arguments are used as follows:
namestring is the input string.
:break-on-cap is a keyword controlling whether changes in capitalization is used
to indicate word boundaries. If :YES, then all capitalization
changes delineate words. If :CLEVER, then unbroken runs of
capitalized letters are treated as acronyms and remain grouped.
If :NO or NULL, there is no breaking of words based on capitalization.
:break-on-number is a flag controlling whether encountering a number indicates
a word boundary. If :YES, then each run of numbers is treated as
a word separate from surrounding words. If :CLEVER, then an
attempt is made to recognize ordinal numbers (ie, 101st) and
treat them as separate words. If :NO or NULL, there is no breaking
of words when numbers are encountered.
:break-on-separators A string of characters which constitute word delimiters in
the input word. This is used to determine how to break
the name into individual words. Defaults are space, -
and _
.
Non-keyword version of decompose-namestring
, which will probably be
easier to use when called from non-Lisp languages.
Default handler that tries to set a system property based on option and value.
Returns the current value of default expression when the slot has not been assigned a value.
Define a demon name and attach it to a class or slot.
Define a class or slot demon. Options are :create, :destroy, :class, :slot, :guard?, :code, :method, :inherit?, and :documentation.
Define a STELLA global variable object based on definition, and initialize its variable-native-object slot to nativeObject (which is primarily needed for C++).
Define property with value for the logical host host.
As a side-effect, this also defines host as a logical host (both
property and value can be supplied as NULL). If :ROOT-DIRECTORY
is specified, all pathnames with host are assumed to be relative to
that directory (even if they are absolute) and will be rerooted upon
translation. :ROOT-DIRECTORY can be a logical or physical pathname.
If :LISP-TRANSLATIONS is specified, those will be used verbatimely as
the value of (CL:logical-pathname-translations host)
if we are
running in Lisp, which allows us to depend on the native
CL:translate-logical-pathname
for more complex translation operations.
Define or redefine a module named name having the options options. Return the new module.
Return a Stella class with name name. Caution: If the class already exists, the Stella class object gets redefined, but the native C++ class is not redefined.
Define a stella global variable using a parse tree derived from stringifiedSource.
Define a new Stella method object (a slot), and attach it to the class identified by the first parameter in inputParameters.
Return true if x is defined (handled specially by all translators).
Return true if x is defined (handled specially by all translators).
Defines a function called MAIN which will have the appropriate signature for the target translation language. The signature will be: C++: public static int main (int v1, char** v2) {<body>} Java: public static void main (String [] v2) {<body>} Lisp: (defun main (&rest args) <body>) The argument varList must have two symbols, which will be the names for the INTEGER argument count and an array of STRINGs with the argument values. It can also be empty to indicate that no command line arguments will be handled. The startup function for the containing system will automatically be called before body is executed unless the option :STARTUP-SYSTEM? was supplied as FALSE. There can only be one DEFMAIN per module.
Define a system of files that collectively define a Stella application. Required options are: :directory – the relative path from the respective source/native/binary root directory to the directory containing the system files. Can be a string or a list of strings (do not include directory separators). :files – a list of files in the system, containing strings and lists of strings; the latter defines exploded paths to files in subdirectories. Optional options are: :data-files – a list of files like the :files keyword, which contain data or other content that should not be processed, but instead copied verbatim to the native directory :required-systems – a list of systems (strings) that should be loaded prior to loading this system. :cardinal-module – the name (a string) of the principal module for this system. :copyright-header – string with a header for inclusion into all translated files produced by Stella. :lisp-only-files – Like the :files keyword, but these are only included :cpp-only-files in the translation for the specific language, namely :java-only-files Common Lisp, C++ or Java
Default deleted?
method which always returns FALSE. Objects
that inherit DYNAMIC-SLOTS-MIXIN also inherit the dynamically-allocated slot
deleted-object?
which is read/writable with specializations of this method.
Print a description of an object in :verbose, :terse, or :source modes.
Prints a description of self to stream stream. mode can be :terse, :verbose, or :source. The :terse mode is often equivalent to the standard print function.
Destroy the Stella class self. Unfinalize its subclasses (if it has any).
Destroy the Stella class self and all its subclasses.
Return three parse trees representing the name, parameters, and code body of the parse tree method-tree. Fill options-table with a dictionary of method options. Storage note: Options are treated specially because the other return values are subtrees of method-tree, while options-table is a newly-created cons tree. Note also, the parameter and body trees are destructively removed from method-tree.
Return a dictionary of collectionType containing values
, in order.
Currently supported collectionTypes are @HASH-TABLE, @STELLA-HASH-TABLE,
@KEY-VALUE-LIST, @KEY-VALUE-MAP and @PROPERTY-LIST.
Returns an iterator that generates all direct super classes of self.
Enable memoization and use of memoized expression results.
Return true if the STELLA feature is currently disabled.
Return true if the intersection of self and otherList is empty.
This is always true if at least one of the two sets is the empty set.
Uses an eql?
test and a simple quadratic-time algorithm. Note that
this does not check whether self and otherList actually are sets.
Return the integer quotient from dividing x by y.
Return the integer quotient from dividing x by y.
Remove the function named hookFunction from hookList.
Remove the directories listed in the |-separated path from the PowerLoom load path.
Clear or remove value for the slot slot on self. CAUTION: Assumes that collection-valued slots are non-null.
Disable trace messages identified by any of the listed keywords. After
calling (drop-trace
<keyword>) code guarded by (trace-if
<keyword> ...)
will not be executed when it is encountered.
Return TRUE if ch is in the upper half of the byte set such as UTF-8 codes, etc.
If value1 is defined, return that, else return value2.
Return true if x is the wrapped empty string ""
Return true
if self has length 0.
Return TRUE if self is empty.
Return true
if self has length 0.
Enable memoization and use of memoized expression results.
Return true if the STELLA feature is currently enabled.
Return TRUE if the substring of string ending at end ends with suffix. If end is NULL it defaults to the length of string.
Ensure all physical directories in the directory portion of fileName exist.
Ensures that filename does not exist. If it does,
an exception of type FILE-ALREADY-EXISTS-EXCEPTION
is thrown
with context supplying context for the error message.
Ensures that filename exists. If not, an exception of
type NO-SUCH-FILE-EXCEPTION
is thrown with context supplying
context for the error message.
Ensure self is big enough to accommodate an additional item of size.
Return true
if the strings s1 and s2 are the same
except for the amounts of whitespace separating words. Leading or
trailing whitespace is also not considered.
Signal error message, placing non-string arguments in quotes.
Interpret an –eval-in-module option. value is expected
to be of the form (<module-name> <s-expression>)
.
Interpret an –eval option by evaluating value.
Evaluate the expression expression and return the result.
Currently, only the evaluation of (possibly nested) commands and global
variables is supported. The second return value indicates the actual type
of the result (which might have been wrapped), and the third return value
indicates whether an error occurred during the evaluation. Expressions
are simple to program in Common Lisp, since they are built into the language,
and relatively awkward in Java and C++. Users of either of those
languages are more likely to want to call evaluate-string
.
Evaluate the expression represented by expression and return the result.
This is equivalent to (evaluate (unstringify expression))
.
Return true if x is an even number.
Return true if x is an even number.
Print the exception context of e to a string and return the result.
Accesses the error message of the exception e.
Return the nearest class extension that records instances of the class self.
Checks to see if this attribute is the literal marking either a PUBLIC or SYSTEM literal for an XML Elternal ID. (See 4.2.2)
Return the root of self which is assumed to be non-empty.
Return the file name portion of file by removing any
physical device components. This is just like logical-pathname-without-host
but only looks for one-character device strings as used in Windows.
Read the content of file and return it as a string.
Fill in substitution-list with template variable substitions
for the names YEAR and DATE which correspond to the current year and date.
These substitutions can then be used with substitute-template-variables-in-string
DEPRECATED. Use add-date-subsitution
or add-current-date-substitution
instead.
Finalize all currently unfinalized classes.
Finalize all currently unfinalized classes and slots.
Finalize all currently unfinalized slots.
Try to find file in the current load path and, if found,
return its full name. If file can’t be found literally, try to find it
with any of the listed extensions added. If extensions is NULL it defaults
to *stella-file-extensions*
, therefore, to not default to any extensions
the value has to be supplied as NIL.
Finds the length of the matching prefix strings of string1 and string2, starting at position start1 and start2 respectively. The search will end when end1 or end2 is reached. If either end1 or end2 is null, then they will be set to the length of their respective strings.
Finds the first position in each of string1 and string2 where
they mismatch, starting at position start1 and start2 respectively.
The search will end when end1 or end2 is reached. If either end1
or end2 is null, then they will be set to the length of their respective
strings. If there is no mismatch, then null
values are returned.
Try to find a STELLA source file based on the name and system components of nativeFileName. This will generally search the current STELLA systems path, since the tree where a native file resides is not necessarily the one where the corresponding source file is also. This will only work for Lisp and C++ files where the basename of translated files corresponds to the source file from which they were derived. The main purpose for this is to support the Emacs Lisp/STELLA interface to find function definitions.
Try to find an existing system definition file for a system named name
in the current STELLA_SYSTEMS_PATH or built-in implicit systems path. Return NULL if no
such definition file can be found. See build-stella-systems-path
on where it looks.
Given a system definition system try to determine the root directory of the STELLA installation containing this system based on its definition file.
Given a system definition file sysDefFile try to determine the root directory of the STELLA installation containing this system by looking for top-level native directories.
Return the result of the first form in forms whose value is defined or NULL otherwise.
Returns a cons of x in a base-60 form. That means
the first value will be the integer part of x, the next value
the iteger value of the fraction part of x times 60 and the
third value the fraction part of x time 3600. If all-integers?
is true
, then the last value will be rounded to an integer.
This can be used to convert from decimal degree values to Degree-Minute-Second
or from decimal hours to Hour-Minute-Second format.
True modulus for floats. Return the result of x mod modulo
.
Note: In C++ and Java, mod
has more overhead than the similar
function rem
. The answers returned by mod
and rem
are only
different when the signs of x and modulo
are different.
Format date just like format-date-to-stream
(which see), but return the result as a string.
Perform formatted printing of date relative to timezone onto stream. date
has to be either a calendar-date or a decoded-date-time object. timezone can be null to indicate
the local timezone, or a float or supported timezone name. control is a format control string whose
characters are printed literally, unless they are a %-code such as one of these (inspired by the codes
supported by the Unix date command):
%% a literal %
%a abbreviated weekday name (e.g., Sun)
%A full weekday name (e.g., Sunday)
%b abbreviated month name (e.g., Jan)
%B full month name (e.g., January)
%d day of month (e.g., 01)
%D date; same as %m/%d/%y
%F full date; same as %Y-%m-%d
%H hour (00..23)
%I hour (01..12)
%m month (01..12)
%M minute (00..59)
%p either AM or PM
%r 12-hour clock time (e.g., 11:11:04 PM)
%R 24-hour hour and minute; same as %H:%M
%S second (00..60)
%T time; same as %H:%M:%S
%y last two digits of year (00..99)
%Y year
%z +hhmm numeric time zone (e.g., -0400)
%:z +hhmm numeric time zone (e.g., -04:00)
%Z alphabetic time zone abbreviation (e.g., EDT)
By default, numeric fields are padded with zeroes. The following optional flags may follow %
:
- (hyphen) do not pad the field
_ (underscore) pad with spaces
0 (zero) pad with zeros
^ use upper case if possible
, use lower case if possible
Formats input to be (at least) length long, using padchar to fill if necessary. align must be one of :LEFT, :RIGHT, :CENTER and will control how input will be justified in the resulting string. If truncate? is true, then then an overlength string will be truncated, using the opposite of align to pick the truncation direction.
Default method. Deallocate storage for self.
Remove all pointers between self and other objects, and then deallocate the storage for self.
Call free on each value in the hash table self.
Return the amount of free space in self.
Return the floating point remainder from dividing x by y. The
sign of the result is always the same as the sign of x. This has slightly
different behavior than the mod
function, and has less overhead in C++ and
Java, which don’t have direct support for a true modulus function.
Protect object from garbage collection. Returns a handle that can later
be passed to gc-release-object
to release object from garbage collection protection.
Release the object pointed to by handle from garbage collection protection and return the protected object. This frees handle but does not necessarily mean that the object will be garbage collected, it just can be again, once all references to it disappear.
Generates a random UUID (Type 4), according to the guidelines of IETF RFC 4122 (see http://www.ietf.org/rfc/rfc4122.txt )
Take 16 random bytes (octets), put them all behind each other, for the description the numbering starts with byte 1 (most significant, first) to byte 16 (least significant, last). Then put in the version and variant. To put in the version, take the 7th byte and perform an and operation using 0x0f, followed by an or operation with 0x40. To put in the variant, take the 9th byte and perform an and operation using 0x3f, followed by an or operation with 0x80. To make the string representation, take the hexadecimal presentation of bytes 1-4 (without 0x in front of it) let them follow by a -, then take bytes 5 and 6, - bytes 7 and 8, - bytes 9 and 10, - then followed by bytes 11-16.
Generates a UUID of the specified type. Legal types are a subset of the IETF RFC 4122 (see http://www.ietf.org/rfc/rfc4122.txt ) UUID types. Currently supported are: :TYPE-4 :RANDOM A type-4 (random) UUID. These are synonyms.
Returns multiple values of year, month, day and day of week for date in timezone. timezone is the number of hours added to UTC to get local time. It is in the range -12.0 to +14.0 where UTC is zone 0.0
Return the accessor code to read slot on an object of type class,
or NULL if no such accessor exists. In that case, print a warning if warn? is TRUE.
NOTE: the accessor expects canonical-slot-name
s (which see).
Return the native object of variable which can be used to access its runtime value. In Lisp this is the Lisp symbol which holds the variable value, in C++ this is the address of the variable, and in Java this is the declared Field object. For C++ native object addresses are initialized at startup time, for Lisp and Java native objects will be accessed upon first call and then cached in the slot.
Compute a language-specific native subdirectory that should be used for files of type. If type does not naturally suggest which native language it is associated with, key in on the current translation output language. Returns the empty string for unhandled types.
Return the current STELLA load path.
Returns the standard time zone offset from UTC as a float, without considering the effects of daylight savings time.
Returns the time zone offset from UTC (as a float) that is applicable to the given date. Assumes that the date is one that is valid for the underlying programming language. If not, then returns 0.0
Return a valid log stream for module.
Lookup the value of property for the logical host host.
Compute a native source subdirectory that should be used for files of type. If type does not naturally suggest which native language it is associated with, key in on the current translation output language. Returns the empty string for unhandled types.
Lookup property (a string or symbol) in the configuration table and return its value. If it is undefined, return the optional defaultValue. Note that property is evaluated and will need to be quoted if supplied as a symbol. Symbols will also be upcased if this command is run in a non-case- sensitive module.
Return the quoted tree with name tree-name.
Given a file, determine which STELLA installation root directory tree it naturally belongs to based on its extension (i.e., source, native or binary).
Given a normalized file type, determine which STELLA installation root directory tree it naturally belongs to (i.e., source, native or binary).
Return the slot named slot-name on the class representing the type of self.
Return a class with name class-name. If none exists, break
if error?, else return null
.
Return a class with name class-name. If non exists, break
if error?, else return null
.
Return a class with name class-name. If none exists, break
if error?, else return null
.
Return a system named name. If no such system is currently defined, look for a system definition file for name in standard locations and try to load it. If no matching system could be found or loaded and error? is true, raise an error, otherwise, simply return NULL.
Compute a last-modified date for system based on its most recently modified source file.
Compute a native system subdirectory that should be used for files of type. If type does not naturally suggest which native language it is associated with, key in on the current translation output language. Returns the empty string for unhandled types.
Compute a version string for system which is either based on an explicit :version
annotation on systems definition, the readable value of an existing *<system>-version[-string]*
,
variable or on its most recent modification date of any of its source files.
Return a suitable directory for temporary files.
Uses the value of stella.tempDirectory
if defined; otherwise, it
will use a suitable OS-specific default. The returned directory will
end in a separator for immediate concatenation with a physical filename.
Returns multiple values of hours, minutes, seconds, milliseconds for the calendar date date in timezone. timezone is the number of hours added to UTC to get local time. It is in the range -12.0 to +14.0 where UTC is zone 0.0
User-level macro to access the most recently parsed token as a float. This assumes correct signed float syntax and only checks for overflows. The main benefit for this is that it doesn’t generate strings and wrappers. Float parsing and conversion is generally hairy and we are probably not covering all special cases here; but we are fast :-)
User-level macro to access the most recently parsed token as an integer. This assumes correct signed integer syntax and only checks for overflows.
User-level macro to access the most recently parsed token as a long integer. This assumes correct signed long-integer syntax and only checks for overflows.
Return the last base url attribute in the attribute list of this element if it exists. Otherwise NULL.
Return the value of the OS environment variable varname. If it is not defined or if its value is the empty string and a deflt is provided, return the default value instead.
Return the type spec for the global variable global.
Generate a hash-code for string and return it. Two strings that are equal but not eq will generate the same code. The hash-code is based on seedCode which usually will be 0. However, seedCode can also be used to supply the result of a previous hash operation to achieve hashing on sequences of strings without actually having to concatenate them.
Return the root of self (NULL if self is empty).
The root contains the minimum element of a min-heap with <
predicate.
Restore the heap property of self according to its
predicate
. Normally, this is not needed, since insert operations
preserve the heap property. However, this can be useful after bulk
insertion of values or if predicate
has been changed.
Helper for advance-past-whitespace
that requires end to be properly set.
Helping function for find-matching-prefix
that requires end1 and end2
to be properly set up.
Return the module located at pathName, or null
if no such module exists. The search looks at ancestors and top-most
(cardinal) modules. If error? is true
, throw an exception if no
module is found.
Print documentation about all currently registered option handlers.
Helper method for print-outline
Helper method for print-outline
Helper method for print-outline
Helper method for print-outline
Helper method for print-outline
Convert the base-16 hex character c into a base-10 number.
Return the home module of self.
Expand to thenForm if the current translator output language equals language. Otherwise, expand to elseForm. This can be used to conditionally translate Stella code.
Expand to thenForm if feature is a currently enabled STELLA environment feature. Otherwise, expand to elseForm. This can be used to conditionally translate Stella code.
Ignore unused variables with NoOp setq
statements.
Translate a single Stella expression tree and return the result. For C++ and Java print the translation to standard output and return NIL instead.
Helper function that indents outline printings for level
current-depth on stream using the value of the global
variable *OUTLINE-INDENT-STRING*
Print informative message, placing non-string arguments in quotes, and terminating with a newline.
Return an initial value for the class self.
Return an initial value for self, or null
. The
initial value can be defined by the slot itself, inherited from an
equivalent slot, or inherit from the :initial-value option for the
class representing the type of self.
Initialize the elements of self with initialValue.
Initialize the STELLA hash table self. This is a no-op and primarily exists to shadow the standard initializer inherited from ABSTRACT-HASH-TABLE. STELLA hash tables are initialized at the first insertion operation.
Defines the value of a slot before it has been assigned a value.
Append value to the END of the sequence self. Resize the array if necessary.
Insert value into self and restore the heap property.
Signal an error if there is no more room in self. Maintains self as
a Min-heap if selfs predicate
has <
semantics; otherwise as a Max-heap.
Insert value into self and restore the heap property.
If self has available room, simply insert value. If the heap is full, only
insert value if it is better than the current root (i.e., if value is
greater than the minimum of self for the case of a min-heap where selfs
predicate
has <
semantics). In that case, replace the root of self
and restore the heap property. This is useful to build and maintain a
heap with some top-N elements (relative to predicate
) where the root (or
minimum) of self is the currently weakest element at the end of the list.
Convert i to its string representation and return the result. This is a convenience function that expects regular integers as opposed to longs which is useful in contexts where we do automatic unwrapping based on the target.
Return the 1-based position of the left-most bit in x. If x is negative, we only count the value bits, not the sign.
Return the 1-based position of the left-most non-zero digit in the base-10 representation of x. If x is negative, we only consider its absolute value, not the sign. This effectively computes the minimum number of base-10 digits to represent x, with the exception of x=0.
Convert i to a string representation in hexadecimal notation and return the result.
Convert i to a string representation in base and return the result. base must be positive and not more than 36.
Note that in the C++ version, only 8, 10 and 16 will work as base arguments,
since that is all the underlying implementation supports. Other argument
values will be treated as 10
.
Returns true
if x is the floating point representation of an integer.
Parse name which is assumed to be the printed
representation of a STELLA symbol, surrogate or keyword, intern
it into the current or specified module and return the result.
This is identical to calling unstringify
on name but 10-15
times faster.
Old name for process-command-line-arguments
(which see).
Return true
iff object is an instance of the class named type.
Translate the system systemName to Java.
Translate statement to C++ and print the result.
Return TRUE if name is prefixed by :
.
Convert self into a property list with identical and identically ordered keys and values.
Return the last item in the vector self.
Return the last item in the heap self which will be the
largest or best item if self is a sorted min-heap with a <
predicate.
Return the last character in self.
Iterate over self, and count how many items there are.
Return the length of the currently filled portion of self.
Return the total number of elements in self.
Return the total number of elements in self.
Reset the length of self to newLength. Fill in NULL characters if newLength is greater than the current length. This is the safe way to reset the fill pointer.
Convert a Stella thing as much as possible into a Common-Lisp analogue. The currently supported thing types are CONS, LIST, KEY-VALUE-LIST, ITERATOR, SYMBOL, KEYWORD, and all wrapped and unwrapped literal types. BOOLEANs are translated into Lisp’s CL:T and CL:NIL logic. Unsupported types are left unchanged.
Lispify thing which is assumed to be a (possibly wrapped) Stella boolean.
Return all the files and sub-directories in directory sorted by name. Each returned file is a bare file name without a directory component. If a file is a directory, it will look just like a plain file. This means consumers might have to explicitly test whether a file is a directory depending on what they do. Excludes . and .. directories. Handles logical pathnames but resulting files will always use physical pathname syntax. This is mostly consistent across native languages, but some differences still exist - e.g., Lisp will convert . or .. into absolute pathnames.
Just like list-directory-files
(which see) but also recurses into
subdirectories. Files at the top level of directory will be bare file names without
a directory component. Files in subdirectories will be prefixed with the relative
subdirectory path starting right below directory. The sort order is lexicographic
within directories which results in a depth-first presentation order of files.
Returns a cons of all modules defined in PowerLoom. If kb-only?
is true
, then any modules which are code only or just namespaces are not returned.
Return a list of elements in self.
Return self.
Return a list of key-value pairs in self.
Return a list of elements in self.
Return a list of elements generated by self.
Read a configuration file and return its content as a configuration table. Also enter each property read into the global system configuration table. Assumes Java-style property file syntax. Each property name is represented as a wrapped string and each value as a wrapped string/integer/float or boolean.
Read STELLA commands from file and evaluate them.
The file should begin with an in-module
declaration that specifies
the module within which all remaining commands are to be evaluated
The remaining commands are evaluated one-by-one, applying the function
evaluate
to each of them.
Load the file value using the STELLA load-file
command.
Modify the current file load path according to option and value.
Natively language
-compile out-of-date translated files of system
systemName (only supported for Lisp at the moment) and then load them
into the running system. Return true if at least one file was compiled.
The following keyword/value options
are recognized:
:language
: can be used as an alternative to the optional language argument.
If not specified, the language of the running implementation is assumed.
:force-recompilation?
(default false): if true, files will be compiled
whether or not their compilations are up-to-date.
:startup?
(default true): if true, the system startup function will
be called once all files have been loaded.
:recursive?
(default false): if true, perform load-system
with the provided
options on systemName as well as all its required systems and so on. Required
systems will be processed first. Note that even without this option, any required
systems that have not yet been loaded or started up will also be processed, since
that is assumed when loading systemName and supporting modules from a definition file.
:root-source-directory
, :root-native-directory
, :root-binary-directory
: if
specified these directories will be used to override the respective paths provided
in system definitions or computed as defaults from a system’s home location.
Return TRUE if level is lower than or equal to the current log level of module. Return FALSE if any of them are undefined.
Log all elements of message to modules log stream if
logLevel is the same or lower than the modules log level. Interprets EOL
or :EOL to print a line terminator.
Return the logarithm (base 2) of n.
Log all elements of message to modules log stream if
logLevel is the same or lower than the modules log level. Interprets EOL
or :EOL to print a line terminator.
Return a class with name name. Scan all visible surrogates looking for one that has a class defined for it.
Return a class with name name. Scan all visible surrogates looking for one that has a class defined for it.
Variant of string.lookup-class
that can specify a
starting module through a qualifiedName.
Return a namespace-qualified C++ translation of the class type named by qualifiedName or NULL if no such STELLA class exists.
If name names an evaluable command return its associated
command object; otherwise, return null
. Currently, commands are not
polymorphic, i.e., they can only be implemented by functions.
Look up a function with name that can be evaluated via apply
just like a command, regardless of whether it was marked as such.
Lookup property in configuration and return its value. Use the global system configuration table if configuration is NULL. Return defaultValue if property is not defined.
Lookup property in configuration, assume it is a multi-valued property and return its value(s) as a list. Use the global system configuration table if configuration is NULL. Return defaultValue if property is not defined or NIL is no default value is specified.
Return the demon named name.
Return the function defined for functionSymbol, if it exists.
Return a function with name name visible from the current module. Scan all visible symbols looking for one that has a function defined for it.
Variant of lookup-function-by-name
that can specify a starting
module through a qualifiedName.
Return a global variable with name self.
Return a global variable with name self.
Return a global variable with name self.
Return a global variable with name visible from the current module. Scan all visible symbols looking for one that has a global variable defined for it. NOTE: this is more robust than STRING.lookup-global-variable which will fail if there is a local symbol with name which shadows one higher up that is the name of a global.
Variant of lookup-global-variable-by-name
that can specify a starting
module through a qualifiedName.
Lookup a local slot with slot-name on class.
Lookup logging parameter for module. Use default if no value is defined.
If name has a macro definition, return the method object holding its expander function.
Return a slot owned by the class class with name slot-name. Multiply inherited slots are disambiguated by a left-to-right class precedence order for classes with multiple parents (similar to CLOS).
Lookup a slot via dotted notation with a possibly qualified class name.
Examples: "cons.first" or "stella/cons.first". This is a variant of string-to-slot
in describe.ste that actually obeys the class module if it is given. This also returns
the specified class as a second value which might differ from the slot’s owner class.
Lookup a slot via dotted notation with a possibly qualified class name.
Examples: "cons.first" or "stella/cons.first". This is a variant of string-to-slot
in describe.ste that actually obeys the class module if it is given.
Parse name which is assumed to be the printed
representation of a STELLA symbol, surrogate or keyword, and try
to look it up according to its type. This is a lookup version of
intern-stella-name
(which see) for cases where we don’t necessarily
want to create a symbol in case it doesn’t exist already.
Lookup key in self and return the result. Return default if no value was found.
Lookup key in self and return the result. Return default if no value was found.
Translate statement to Common-Lisp and print the result.
Make an absolute file-name string from filePath with directory location and file extension determined by type and relative?. type is the main determiner for whether we are creating a source, native or binary pathname in the respective root directories, and it also controls the new extension of the resulting pathname replacing any one on filePath. If relative? is TRUE, then the respective root directory prefix is appended, plus any additional relevant language, system and source subdirectories. If relative? is FALSE, then the current directory prefix of filePath as indicated by its extension is switched to the new root directory indicated by type. In this case, only the root and language directories are inserted, but all the remaining source directory components are left the same (thus, this will generally not do the right thing for Java file names). This function takes the dynamic state of currently active systems and modules into account.
Keyword options: :break-on-cap one of :YES :NO :CLEVER default is :CLEVER :break-on-number one of :YES :NO :CLEVER default is :CLEVER :break-on-separators string default is "-_ " :remove-prefix string :remove-suffix string
:case one of :UPCASE :TitleCase :titleCaseX :downcase :Capitalize :preserve default is :TitleCase :separator string default is "" :add-prefix string :add-suffix string
MAKE-MATCHING-NAME returns a matching name (a string) for the input name (a string).
A matching name is constructed by breaking the input into words
and then applying
appropriate transforms. The arguments are used as follows:
original is the input name. It is a string.
:break-on-cap is a keyword controlling whether changes in capitalization is used
to indicate word boundaries. If :YES, then all capitalization
changes delineate words. If :CLEVER, then unbroken runs of
capitalized letters are treated as acronyms and remain grouped.
If :NO or NULL, there is no breaking of words based on capitalization.
:break-on-number is a flag controlling whether encountering a number indicates
a word boundary. If :YES, then each run of numbers is treated as
a word separate from surrounding words. If :CLEVER, then an
attempt is made to recognize ordinal numbers (ie, 101st) and
treat them as separate words. If :NO or NULL, there is no breaking
of words when numbers are encountered.
:break-on-separators A string of characters which constitute word delimiters in
the input word. This is used to determine how to break
the name into individual words. Defaults are space, -
and _
.
:remove-prefix Specifies a prefix or suffix that is stripped from the input
:remove-suffix name before any other processing. This allows the removal of
any naming convention dictated prefixes or suffixes.
:add-prefix Specifies a prefix or suffix that is added to the output name
:add-suffix after all other processing. This allows the addition of any
naming convention dictated prefixes or suffixes.
:case The case of the resulting name. This is applied to the name
before adding prefixes or suffixes. The two title case options
differ only in how the first word of the name is treated.
:TitleCase capitalizes the first letter of the first word and
also the first letter of all other words.
:TitleCaseX does not capitalizes the first letter of the first
word but capitalizes the first letter of all subsequent words.
:preserve results in no change in case.
:separator This is a string specifying the word separator to use in the
returned name. An empty string (the default) means that the
resulting words are concatenated without any separation. This
normally only makes sense when using one of the title case values
for the case keyword.
Non-keyword version of make-matching-name
, which will probably be
easier to use when called from non-Lisp languages.
Translate all out-of-date files of system systemName
into language
(the first optional argument of language&options) and
then compile and load them (the latter is only possible for Lisp right now).
The following keyword/value options
are recognized:
:language
: can be used as an alternative to the optional language argument.
If not specified, the language of the running implementation is assumed.
:two-pass?
: if true, all files will be scanned twice, once to
load the signatures of objects defined in them, and once to actually
translate the definitions. Otherwise, the translator will make one pass in
the case that the system is already loaded (and is being remade), and two
passes otherwise.
:development-settings?
(default false): if true translation will favor
safe, readable and debuggable code over efficiency (according to the value
of :development-settings
on the system definition). If false, efficiency
will be favored instead (according to the value of :production-settings
on the system definition).
:production-settings?
(default true): inverse to :development-settings?
.
:force-translation?
(default false): if true, files will be translated
whether or not their translations are up-to-date.
:force-recompilation?
(default false): if true, translated files will be
recompiled whether or not their compilations are up-to-date (only supported
in Lisp right now).
:load-system?
(default true): if true, compiled files will be loaded into
the current STELLA image (only supported in Lisp and Java right now).
:startup?
(default true): if true, the system startup function will
be called once all files have been loaded.
:recursive?
(default false): if true, perform make-system
with the provided
options on systemName as well as all its required systems and so on. Required
systems will be processed first. Note that even without this option, any required
systems that have not yet been loaded or started up will also be processed, since
that is assumed when loading systemName and supporting modules from a definition file.
:root-source-directory
, :root-native-directory
, :root-binary-directory
: if
specified these directories will be used to override the respective paths provided
in system definitions or computed as defaults from a system’s home location.
Make a canonical system definition file name for a system named name.
Variant of make-temporary-file-name
that actually
allocates the file to prevent other processes from using that name.
This is still not fully thread safe - for that we would need a file lock -
but maybe a bit better in avoiding collisions.
Return the maximum of x and y. If either is NULL, return the other.
Return the maximum of x and y. If either is NULL, return the other.
Return the maximum of x and y. If either is NULL, return the other.
Return the maximum of x and y. If y is NULL, return x.
Iterate over values of self and return TRUE
if one of them is eql?
to ’value.
Return true iff object is a member of the collection self.
Return TRUE if value is a member of the sequence self.
Compute the value of an expression and memoize it relative to
the values of inputArgs.
inputArgs should characterize the complete set of values upon which
the computation of the result depended.
Calls to memoize
should be of the form
(memoize (<arg>+) {:<option> <value>}* <expression>)
and have the status of an expression. The following options are supported:
:timestamps A single or list of keywords specifying the names of
timestamps which when bumped should invalidate all
entries currently memoized in this table.
:name Names the memoization table so it can be shared by other
memoization sites. By default, a gensymed name is used.
CAUTION: IT IS ASSUMED THAT ALL ENTRIES IN A MEMOZATION
TABLE DEPEND ON THE SAME NUMBER OF ARGUMENTS!!
:max-values The maximum number of values to be memoized. Only the
:max-values
most recently used values will be kept
in the memoization table, older values will be discarded
and recomputed if needed. Without a :max-values
specification, the memoization table will grow
indefinitely.
PERFORMANCE NOTES: For most efficient lookup, input arguments that vary the most should be listed first. Also, arguments of type STANDARD-OBJECT (and all its subtypes) can be memoized more efficiently than arguments of type OBJECT or wrapped literals (with the exception of BOOLEANs).
Parse baseFile, supply any missing components from defaults if supplied and return the result.
Replace any null valued fields in self with values from default. The day of the week will be set consistently, if possible.
Replace only null valued fields in self that represent larger time units than the smallest non-null in self with values from default. The day of the week will be set consistently, if possible. Example: if self just has the month being non-null, then only the year will be filled in from default. If the day and minute were non-null, then hour, month and year will be filled.
This can be useful when one doesn’t want to extend the precision of the answer.
Return the minimum of x and y. If either is NULL, return the other.
Return the minimum of x and y. If either is NULL, return the other.
Return the minimum of x and y. If either is NULL, return the other.
Return the minimum of x and y. If y is NULL, return x.
True modulus. Return the result of x mod modulo
.
Note: In C++ and Java, mod
has more overhead than the similar
function rem
. The answers returned by mod
and rem
are only
different when the signs of x and modulo
are different.
True modulus. Return the result of x mod modulo
.
Note: In C++ and Java, mod
has more overhead than the similar
function rem
. The answers returned by mod
and rem
are only
different when the signs of x and modulo
are different.
Return true
if class has more than one direct superclass.
Return TRUE if module has more than one parent.
Return FALSE always, since worlds never have more than one parent.
Return the string represented by name. Return null
if name is undefined or does not represent a string.
Delete the file fileName. This does not handle any necessary pathname translations or error conditions.
Return the length of file fileName in bytes or NULL if that cannot be determined. This does not handle any necessary pathname translations or error conditions.
Return the time at which file fileName was last modified or NULL if that cannot be determined. This does not handle any necessary pathname translations or error conditions.
Return true if file fileName exists and is a directory. Note that this does not necessarily mean that the directory can also be read. This does not handle any necessary pathname translations or error conditions.
Return true if file fileName exists. Note that this does not necessarily mean that the file can also be read. This does not handle any necessary pathname translations or error conditions.
Read one line from inputStream using the native language
readline algorithm and return the result. On EOF return null
Rename the file fromFile to toFile. This does not handle any necessary pathname translations or error conditions.
Generate the next value of the memoized iterator self (or
one of its clones) by either using one of the values generated so far or by
generating and saving the next value of the base-iterator
.
Return true
if the collection self forbids duplicate values.
Return true if x is not the wrapped empty string ""
Return true
if self has length > 0.
Return true
if self has length > 0.
Returns the index into source, starting from start, of the first character that is not included in match.
Helper for non-matching-position
that requires end to not be null
.
Return the character in self at position.
Return the element in self at position.
Set the character in self at position to ch.
Return true if x is undefined (handled specially by all translators).
Return true if x is undefined (handled specially by all translators).
Generic number comparison that works with integers, longs and floats.
Return TRUE iff the sequences x and y are structurally
equivalent. Uses equal?
to test equality of elements.
Return true if x is an odd number.
Return true if x is an odd number.
If test is TRUE, return the result of evaluating expression.
Open a TCP/IP network stream to host at port and return the result as an input/output stream pair.
Return true
if the collection self is ordered.
Helper function that returns true
if current-depth exceeds depth-limit.
This functions uses the convention that a null
or negative value of
depth-limit means the depth is unlimited. In those cases it always
returns false.
Returns the list of parameters names of self.
Tries very hard to make sense out of the argument date-time-string and
returns a time structure if successful. If not, it returns null
.
If error-on-mismatch? is true, parse-date-time will signal an error instead of
returning null
.
Default values are 00:00:00 in the given timezone on the current date. If the
given time-zone value is null
, then the local time zone for the given date
and time will be used as determined by the operating system.
Tries very hard to make sense out of the argument date-time-string and
returns a time structure if successful. If not, it returns null
.
If error-on-mismatch? is true, parse-date-time will signal an error instead of
returning null
.
Default values are passed in via base-date-time. If the timezone field that
is passed in is NULL, then the local time zone for the parsed date/time will
be used.
If merge-null-fields? is true
, then default values from base-time-date
will be merged into missing components. If false
, then they won’t be merged
in for null components but can still be used as a basis for interpreatation of
relative time strings like "now" or "yesterday"
Convert a float value string into a float. Leading and trailing whitespace is allowed. Raise an error if we have illegal number syntax which makes it preferable over the naive C++ stringToFloat conversion function which just returns 0.
Convert an integer value string into an integer. Leading and trailing whitespace is allowed. Raise an error if we have illegal number syntax which makes it preferable over the naive C++ stringToInteger conversion function which just returns 0.
Convert a long integer value string into a long integer. Leading and trailing whitespace is allowed. Raise an error if we have illegal number syntax which makes it preferable over the naive C++ stringToInteger conversion function which just returns 0.
Parse options, check their validity according to legalOptions&Types and return the result as a PROPERTY-LIST. legalOptions&Types has to either be NULL or a flat list of legal <keyword> <coercionType> pairs. A type specifcation of @IDENTITY means don’t perform any coercion. If coercionError? is TRUE, raise an error if a coercion failed. If allowOtherKeys? is TRUE options other than those specified in legalOptions&Types are allowed but won’t be coerced since we don’t know their type. A special implicit :options keyword that does not need to be declared can be used to pass in an already parsed options list from a caller, which will then be analyzed and used instead.
Parse the printed representation name of a STELLA symbol, surrogate or
keyword and return its symbol name, module name and type (which is either
:SYMBOL, :SURROGATE or :KEYWORD). name can be qualified and must use the
exact same syntax and escape characters that would be used if it were to be
read by read-s-expression-from-string
(or unstringify
). If
enableCaseConversion? is TRUE, the returned symbol name will be upcased if
the current module is case-insensitive; otherwise, it will be returned as is.
Raises a read exception if name does not represent a symbol.
This function is available primarily for efficiency, since it is about
10-15 times faster than unstringify
.
Return a hash table prime of at least minSize.
Convert self into a key-value list with identical and identically ordered keys and values.
Return true if x is greater than 0.
Return true if x is greater than 0.
Remove the first element from the STELLA load path and return the removed element.
Returns the primary type of self. Gets defined automatically for every non-abstract subclass of OBJECT.
Return true
if self is not a defined relation.
Print arguments to the standard output stream.
Print all properties defined in configuration to stream.
Prints system dependent information about the context of the specified exception e. For example, in Java it prints a stack trace. In Lisp, it is vendor dependent.
Print an outline of thing and its subparts on stream.
If depth is non-negative, only depth levels will be printed.
If named? is TRUE
, then only named entities will be printed.
This function is intended to be used on things like modules, contexts, concepts, etc. that have hierarchical structure. If thing doesn’t have a hierarchical structure, it will just be printed.
Print all current configuration property information to standard output.
Print the current state of all recycle lists.
(print-spaces [stream] N) prints N spaces onto stream. If no stream form is provided, then STANDARD-OUTPUT will be used.
Print the list of enabled and disabled STELLA features.
Print all unbound surrogates visible from the module named by the first
argument (a symbol or string). Look at all modules if no module name or
null
was supplied. If the second argument is true
, only consider
surrogates interned in the specified module.
Print all declared but not yet defined functions and methods in module. If local? is true, do not consider any parent modules of module. If module is NULL, look at all modules in the system. This is handy to pinpoint forward declarations that haven’t been followed up by actual definitions.
Print all undefined or bad (indirect) super classes of class.
Iterate over all private methods attached to class.
Iterate over all private storage-slots attached to class.
Return true
if self is not public.
Return true if file fileName exists and is a directory. Note that this does not necessarily mean that the directory can also be read.
Interpret any command line arguments for which handlers have been registered.
Leave any remaining unprocessed arguments in *unprocessed-command-line-arguments*
.
If any unprocessed arguments use option syntax (that is they start with a -
), proceed
according to unhandledOptionAction which can be one of :ignore, :warn or :error.
This ensures that at any point in the option processing, *unprocessed-command-line-arguments*
accurately reflects the arguments which have been either skipped or not handled yet.
Takes an S-Expression representing a doctype and processes into a DOCTYPE object.
Translate statement to Common-Lisp and print the result.
Iterate over all private methods attached to class.
Iterate over all public storage-slots attached to class.
Return an iterator over public slots of self.
Return an iterator over public slots of self.
True if self or one it its ancestors is marked public.
Add the directories listed in the |-separated path to the front of the STELLA load path. Return the resulting load path.
Push value onto the cons list place.
Set or insert value for the slot slot on self. CAUTION: Assumes that collection-valued slots are non-null.
Return TRUE if name is a symbol or surrogate qualified with a module
pathname or a module pathname ending with a /
. Assumes that name
is the printed representation of a STELLA symbol (potentially containing
escape characters).
Interpreted global variable reader which reads and returns its native value which will be wrapped if necessary. This will access the value at the top of the special stack.
Read one line from stream and return the result and
a keyword that indicates the terminator for that line ending:
:CR
:LF
:CRLF
or :EOF
. This is not platform-dependent
and differs from read-line
by returning a second value. It
may hang when used on interactive streams such as terminal or
network streams with only CR line endings. It should only be
used on file or string input streams.
Interpreted variable reader which reads a native code variable represented by var of type type and returns its value which will be wrapped if necessary. If var is a special variable, this will access the current dynamic value at the top of the special stack. This relies upon type being completely accurate and bad things will happen if it is not.
Read and return a (possibly wrapped) value for the slot slot on self.
Read all of the top-level XML expressions from filename and return them in a list.
Name of a method called to read the value of the slot self.
Register a command line option. :key identifies the name of the option which
will usually start with a dash such as -e
or --eval
. :key2 and :key3 can be used to supply
additional options (e.g., long option formats). To supply even more keys, a list can be supplied
with the :keys option. If a :property is supplied, this option simply sets or adds to the values
of the specified system configuration property. If a :handler name is specified, its function
will be used to interpret the values of the option. :documentation can be used to supply a
documentation string which will be printed by the help-option-handler
(usually bound to -?
).
:value-type describes what type an option value should be coerced to before assigning it to the
specified configuration :property. :n-arguments describes how many arguments this option
takes. This will be 0 for simple switches and can be 1 or greater than one for option handlers
that need one or more arguments. :default-value defines the value to use for zero-argument
:property options. If :multi-valued? is true, values of multiple occurrences of the option will be
added to the specified configuration :property. :error-action can be one of :ignore, :warn or
:error to specify what to do in case an error is encountered during option processing.
Register the function named demonName as the demon for property.
Demons will be run as after demons on every configuration table update. Set the
property stella.test.propertyDemon
to see a test demon in action.
Return true
if x can be represented by a regular integer.
If pathName is a logical pathname translate it, however, remove the :root-directory prefix of the logical host. Otherwise, return pathName as is.
Return the remainder from dividing x by y. The
sign of the result is always the same as the sign of x. This has slightly
different behavior than the mod
function, and has less overhead in C++ and
Java, which don’t have direct support for a true modulus function.
Return the remainder from dividing x by y. The
sign of the result is always the same as the sign of x. This has slightly
different behavior than the mod
function, and has less overhead in C++ and
Java, which don’t have direct support for a true modulus function.
Remove value from property in configuration and return it. Use the global system configuration table if configuration is NULL.
Return self with duplicates removed. Preserves the original order of the remaining members.
remove-duplicates
(which see) using an equal?
test.
IMPORTANT: since this uses hashing to speed things up, an equal-hash-code
method needs to be defined for this to work.
remove-duplicates
(which see) using an equal?
test.
Replace the current root of self with value and restore
the heap property. Signal an error if self is empty. Maintains self as
a Min-heap if selfs predicate
has <
semantics; otherwise as a Max-heap.
Returns a list of names of required slots for self.
True if a value must be assigned to this slot at creation time.
Reset self to its initially allocated state. Note, that this is somewhat expensive, costing almost as much as allocating the iterator.
Reset STELLA features to their default settings.
Change the size of self to size. If size is smaller than the current size of self, it’s buffer will be truncated.
Reverse the order of elements in the active portion of self.
Create a reverse interval object.
Accessor to determine the currently active binary directory root. If it is defined as an option in the currently active system action, use that. If we have an active system, use its value, otherwise use the STELLA default value.
Accessor to determine the currently active native directory root. If it is defined as an option in the currently active system action, use that. If we have an active system, use its value, otherwise use the STELLA default value.
Accessor to determine the currently active sources directory root. If it is defined as an option in the currently active system action, use that. If we have an active system, use its value, otherwise use the STELLA default value.
Run all hook functions in hooklist, applying each one to argument.
Return true if the executable code is a Common Lisp application.
Returns the keyword for the language the current implementation is running in.
Returns an information string about the current running system environment.
Variant of compare-strings
that also tolerates NULL values.
NULL sorts after everything else in any collation.
Return a hash code for self. Just like equal-hash-code
- which see, but also works for NULL. equal-hash-code
methods that expect to
handle NULL components should use this function for recursive calls.
Return a hash code for self. Just like hash-code
- which see, but also works for NULL.
Alias for lookup-slot
. Kept for backwards compatibility.
Signal warning message, placing non-string arguments in quotes.
Save table as a configuration file. Uses a Java-style property file syntax.
Save value to stream as a properly formatted configuration value.
Return true
iff the value value is embedded within
the cons tree tree. Uses an eql?
test. Does not descend into any
cons whose first element matches an element of filter.
If self is a string or a symbol, search for an object named
self of type type
. Otherwise, if self is an object, return it.
Seeds the random number generator based on the current time.
Seeds the random number generator based on the current time and /dev/random if it is available.
Return a sequence containing values, in order.
Set a call log break point to count. Execution will be interrupted right at the entry of the countth logged function call.
Set property in configuration to value and return it. Use the global system configuration table if configuration is NULL.
Sets the current date into values-structure
Sets the current date and time into values-structure
Sets the current time into values-structure
Set the STELLA load path to the |-separated directories listed in path. Return the resulting load path.
Set the log-level for module to level. This is a convenience function for this common operation.
Set logging parameters for module. The supported parameters are: :LOG-LEVELS - a cons list of legal levels in ascending log level order; for example, (:NONE :LOW :MEDIUM :HIGH) or (0 1 2 3). :LEVEL - the current log level for module :STREAM - the stream or file to log to (defaults to STANDARD-OUTPUT) :PREFIX - the prefix to use to identify the module (defaults to module) :MAX-WIDTH - logging output lines will be kept to approximately this width (defaults to 10000, minimum width of about 30 is used to print line header information).
Set optimization levels for the qualities safety, debug, speed, and space.
Set property (a string or symbol) in the configuration table to value. Note that property is evaluated and will need to be quoted if supplied as a symbol. Symbols will also be upcased if this command is run in a non-case-sensitive module.
Enable all listed STELLA features.
Set output language to new-language. Return previous language.
Assign variable the result of evaluating expression, and return TRUE if expression is not NULL else return FALSE.
Return true
if symbol is shadowed in its home module.
Shift arg to the right by count positions and 0-extend from the left if arg is positive or 1-extend if it is negative. This is an arithmetic shift that preserve the sign of arg and is equivalent to dividing arg by 2** count.
Shift arg to the right by count positions and 0-extend from the left if arg is positive or 1-extend if it is negative. This is an arithmetic shift that preserve the sign of arg and is equivalent to dividing arg by 2** count.
Signal error message, placing non-string arguments in quotes.
Specialized version of signal
that throws a READ-EXCEPTION.
Perform a destructive sort of self according to
predicate, and return the result. If predicate has a <
semantics, the
result will be in ascending order. If predicate is null
, a
suitable <
predicate is chosen depending on the first element of self,
and it is assumed that all elements of self have the same type (supported
element types are GENERALIZED-SYMBOL, STRING, INTEGER, and FLOAT).
Sort the heap self according to predicate (in
ascending order if predicate has <
semantics). If predicate
is NULL simply use selfs internal predicate (the normal case).
If it is different from selfs internal predicate, heapify self first
according to the new predicate, store the new predicate in self and
then sort the heap. Note that a sorted array automatically satisfies
the heap property. This is slightly different than a regular heap
sort due to the way HEAP’s are maintained; however, the complexity is
the same.
Just like sort
but assumes each element of self has a slot
whose value will be used for comparison. Elements must be descendants of
STANDARD OBJECT. Note that while this will work with literal-valued slots,
it will cause value wrapping everytime slot is read.
Just like sort
but assumes each element of self has a slot
whose value will be used for comparison. Elements must be descendants of
STANDARD OBJECT. Note that while this will work with literal-valued slots,
it will cause value wrapping everytime slot is read.
Just like sort
but assumes each element of self is a tuple (a cons)
whose n-th element (0-based) will be used for comparison.
Split input into separate strings based on the separator character.
Start function call logging to fileName.
Return TRUE if string starts with prefix starting from start (which defaults to 0 if it is supplied as NULL).
Return true
if self is a native collection.
Returns information about the current Stella implementation. Useful when reporting problems.
STELLA version of integer-to-string-in-base
which is faster than
the C++ version we have but slower than the native Java version.
Return true if self is a member of the STELLA class OBJECT
.
Return a string identifying the current version of STELLA.
Partial inverse to lispify
. Convert the Lisp object
thing into a Stella analogue of type targetType.
Note: See also stellify
. it is similar, but guesses targetType on its own,
and makes somewhat different translations.
Convert a Lisp object into a STELLA object.
Stop function call logging and close the current log file.
Return the current position of the file input cursor in self.
Return the current position of the file input cursor in self.
Set the current position of the file input cursor in self to newpos.
Set the current position of the file input cursor in self to newpos. If self has any tokenizer state associated with it, this will also reset to the start state of the tokenizer table; otherwise, behavior would be unpredictable unless the character class of the new position is exactly the same as the one following the most recent token.
Read all of the input from stream
and return it as a string.
Compare x and y and return -1, 0, or 1, depending on whether
x is less than, equal, or greater than y relative to the :ascii-case-normalized
collation. In this collation a < A < b
which gives strings that only differ in case a
definite order while otherwise behaving identically to :ascii-case-insensitive. This is
similar to using a Java Collator for Locale.US with strength set to TERTIARY (which see).
Return start position of the left-most occurrence of substring in string, beginning from start. Return NULL if it is not a substring. The comparison ignores differences in letter case.
Returns a calendar date object representing the date and time
parsed from the input-date string. Default values for missing fields and
the interpretation of relative references come from default-date. If the
default-date is null
, the current date will be used. If a null set of
defaults is desired, use *NULL-DECODED-DATE-TIME*
.
If no valid parse is found, null
is returned.
Returns a decoded date-time object representing the date
and time parsed from the input string. If no valid parse is found,
null
is returned.
Convert a string representation of an integer into an integer.
This is a convenience function that ensures a regular integer return value. If
string represents a long integer, the behavior is undefined. Use parse-integer
if the syntax of string needs to be checked for errors.
Return a surrogate with the name self visible in the current module. Very tricky: The logic is designed to avoid returning an inherited surrogate that has no value. In that case, a new local surrogate is created that shadows the inherited surrogate.
Parses and returns an time-duration object corresponding to duration.
The syntax for time duration strings is "{plus|minus} N days[; M ms]" where N and M are
integer values for days and milliseconds. If no valid parse is found, null
is returned.
Remove any leading and trailing white space from string and return a copy of the trimmed substring (which might be empty if we had all white space). If no white space was removed, string is returned unmodified and uncopied.
Return true
if subClass is a subclass of superClass.
Return a substring of string
beginning at position start
and ending up to but not including position end, counting from zero. An
end value of NULL stands for the rest of the string.
Return a substring of string beginning at position start and ending up to but not including position end, counting from zero. An end value of NULL stands for the rest of the string.
Substitute all occurences of of a member of old-chars with the corresponding member of new-chars in the string self. Returns a new string.
Substitute all occurences of of a member of old-chars with the corresponding member of new-chars in the string self. IMPORTANT: The return value should be used instead of relying on destructive substitution, since the substitution will not be destructive in all translated languages.
Return true
iff the class named sub-type is a subclass
of the class named super-type.
Returns an iterator that generates all proper super classes of self.
Return TRUE if name is prefixed by SURROGATE-PREFIX-CHARACTER
.
Converts self into a surrogate.
Converts self into a surrogate (same semantics
as symbol-to-surrogate
which see).
Converts self into a surrogate.
Default method. Sweep up all self-type objects.
Return a surrogate with the same name as self.
Very tricky: The logic is designed to avoid returning an inherited surrogate
that has no value. In that case, a new local surrogate is created that shadows
the inherited surrogate. Unlike string-to-surrogate
, the search starts first
from the home context of self, and if that fails, then it restarts in
*module*.
Convert self into a surrogate with the same name and module.
Return a default value expression, or if self has dynamic storage, an initial value expression.
Return a default value expression, or if self has dynamic storage, an initial value expression.
Return true
if system name has either been loaded
or initialized with its startup function.
Return true
if system name has been loaded.
Terminate and exit the program with normal exit code.
A test demon for the property demon machinery which simply prints arguments.
Return a substring of string
beginning at position start
and ending up to but not including position end
, counting from zero. An
end
value of NULL stands for the rest of the string.
Returns a string representation of date
Format zone
as an hh:mm or hhmm string depending on include-colon?
Switch between Common Lisp and C++ as output languages.
Simple tokenizer that is somewhere between Java’s StringTokenizer and StreamTokenizer in functionality. It doens’t specially support number tokens nor comment strings/sequences even though this could be added at the expense of some extra complexity. Returns a list of (<token-string> <token-type>) pairs, where the token type is one of :TEXT, :PUNCTUATION or :QUOTE, i.e., all white space is ignored and escape characters are handled and removed. For example:
(tokenize-string "for(i='fo^'o'; i>0; i++)" "()=<>+-;" "'" "^") => (("for" :TEXT) ("(" :PUNCTUATION) ("i" :TEXT) ("=" :PUNCTUATION) ("'" :QUOTE) ("fo'o" :TEXT) ("'" :QUOTE) (";" :PUNCTUATION) ("i" :TEXT) (">" :PUNCTUATION) ("0" :TEXT) (";" :PUNCTUATION) ("i" :TEXT) ("++)" :PUNCTUATION)) |
NOTE: this aggregates multiple punctuation characters that immediately
follow each other into a single token which is (generally) useful to pickup
multi-character operators such as ++, >=, etc. It’s still easy to pick them
apart in a post-processing step if necessary (e.g., for the ++)
case above),
so we leave this for now as a feature.
Return TRUE if directory is a top-level STELLA installation directory containing one or more STELLA systems. We currently determine this solely by looking for the existence of at least one relevant top-level native directory. This is needed to find system root directories and other relevant STELLA installation directories.
If keyword is a trace keyword that has been enabled with add-trace
print all the elements in body to standard output. Otherwise, do nothing.
keyword can also be a list of keywords in which case printing is done if
one or more of them are trace enabled.
Translate all of the STELLA source files in system systemName into
language
(the optional first argument). The following keyword/value
options
are recognized:
:language
: can be used as an alternative to the optional language argument.
If not specified, the language of the running implementation is assumed.
:two-pass?
(default false): if true, all files will be scanned twice, once
to load the signatures of objects defined in them, and once to actually
translate the definitions.
:force-translation?
(default false): if true, files will be translated
whether or not their translations are up-to-date.
:development-settings?
(default false): if true translation will favor
safe, readable and debuggable code over efficiency (according to the value
of :development-settings
on the system definition). If false, efficiency
will be favored instead (according to the value of :production-settings
on the system definition).
:production-settings?
(default true): inverse to :development-settings?
.
:recursive?
(default false): if true, perform translate-system
with the provided
options on systemName as well as all its required systems and so on. Required
systems will be processed first. Note that even without this option, any required
systems that have not yet been loaded or started up will also be processed, since
that is assumed when loading systemName and supporting modules from a definition file.
:root-source-directory
, :root-native-directory
, :root-binary-directory
: if
specified these directories will be used to override the respective paths provided
in system definitions or computed as defaults from a system’s home location.
Return true
if current output language is Common-Lisp.
Return true
if current output language is C++
Return true
if current output language is Java
Truncate n toward zero and return the result.
Variant of evaluate
that only evaluates tree if it
represents an evaluable expression. If it does not, tree is returned
unmodified. This can be used to implement commands with mixed argument
evaluation strategies.
Return the most specific class that is a superclass of
both class1 and class2. If there is more than one, arbitrarily pick one.
If there is none, return null
.
Return the most specific type that is a supertype of both type1 and type2. If there is more than one, arbitrarily pick one. If there is none, return @VOID. If one or both types are parametric, also try to generalize parameter types if necessary.
The type of a storage slot is its base type.
If self has a complex type return its
type specifier, otherwise, return type
of self.
Convert type into a symbol with the same name and module.
Return the wrapped type for the type self, or self if it is not a bare literal type.
Iterate over all unbound surrogates visible from module.
Look at all modules if module is null
. If local?, only consider
surrogates interned in module.
Decrease the indentation level for subsequent log messages.
Replaces HTML escape sequences such as & with their associated characters.
Takes a string and replaces %-format URL escape sequences with their real character equivalent according to RFC 2396.
Return all command line arguments which have not yet been processed
by (or been ignored by) process-command-line-arguments
. If arguments have not yet
been processed, this will return NULL.
Unregister all currently registered command line options.
Unregister the command line option identified by key under all its keys.
Unregister any demon for property.
Disable all listed STELLA features.
Shift arg to the right by 1 position and 0-extend from the left. This does not preserve the sign of arg and shifts the sign-bit just like a regular bit. In Common-Lisp we can’t do that directly and need to do some extra masking.
Shift arg to the right by 1 position and 0-extend from the left. This does not preserve the sign of arg and shifts the sign-bit just like a regular bit. In Common-Lisp we can’t do that directly and need to do some extra masking.
Unstringify a STELLA source string relative to module,
or *MODULE*
if no module is specified. This function allocates transient
objects as opposed to unstringify-in-module
or the regular unstringify
.
Unwrap wrapper and return its values as a regular BOOLEAN. Map NULL onto FALSE.
Unwrap wrapper and return the result. Return NULL if wrapper is NULL.
Unwrap wrapper and return the result. Return NULL if wrapper is NULL.
Unwrap wrapper and return the result. Return NULL if wrapper is NULL.
Abstract method needed to allow application of this
method on abstract iterator classes that do not implement it. By having
this here all next?
methods of dictionary iterators MUST use the slot-value
paradigm to set the iterator value.
Signal warning message, placing non-string arguments in quotes.
Sets up an unwind-protected form which opens a network socket stream to a host and port for input and output and closes it afterwards. Separate variables as provided in the call are bound to the input and output streams. Syntax is (WITH-NETWORK-STREAM (varIn varOut hostname port) body+)
Allocate permanent
(as opposed to transient
)
objects within the scope of this declaration.
Set *currentSystemDefinition* to the system definition named system
.
Set *currentSystemDefinitionSubdirectory* to match. Execute body within
that scope.
Allocate transient
(as opposed to permanent
)
objects within the scope of this declaration.
CAUTION: The default assumption is the allocation of permanent objects.
The scope of with-transient-objects
should be as small as possible, and
the user has to make sure that code that wasn’t explicitly written to
account for transient objects will continue to work correctly.
Return a literal object whose value is the BOOLEAN value.
Return a literal object whose value is the FUNCTION-CODE value.
Return a literal object whose value is value. Choose a regular integer wrapper unless value is too large and needs to be stored in a long wrapper.
Return a literal object whose value is the LONG-INTEGER value.
Return a literal object whose value is the METHOD-CODE value.
Return the unwrapped type for the wrapped type self, or self if it is not a wrapped type.
Return the type of the value stored in the wrapper self.
Interpreted global variable writer which sets its native value to value unwrappig it if necessary. This will change the current value at the top of the special stack.
Writes a string and replaces unallowed URL characters according to RFC 2396 with %-format URL escape sequences.
Interpreted variable writer which sets a native code variable represented by var of type type to value which will be unwrapped if necessary. If var is a special variable, this will change the current dynamic value at the top of the special stack. This relies upon type being completely accurate and bad things will happen if it is not.
Write a (possibly wrapped) value for the slot slot on self.
Name of a method called to write the value of the slot self.
Return true
if item is an XML attribute object
Return true
if form is a CONS headed by an XML DECLARATION tag
Return true
if form is a CONS headed by a DOCTYPE tag
Return true
if form is a CONS headed by an XML ELEMENT tag
Return true
if item is an XML attribute object
Return true
if item is an XML attribute object
Return true
if form is a CONS headed by an XML PROCESSING INSTRUCTION tag
Return true
if item is an XML processing instruction object
Convert the XML tokenList (using doctype for guidance) into a
representative s-expression and return the result. The doctype argument is
currently only used for expansion of entity references. It can be null
. The
flag doctype-definition? should be true only when processing the DTD definition
of a DOCTYPE tag, since it enables substitution of parameter entity values.
Every XML tag is represented as a cons-list starting with the tag as its header, followed by a possibly empty list of keyword value pairs representing tag attributes, followed by a possibly empty list of content expressions which might themselves be XML expressions. For example, the expression
<a a1=v1 a2=’v2’> foo <b a3=v3/> bar </a>
becomes
(<a> (<a1> "v1" <a2> "v2") "foo" (<b> (<a3> "v3")) "bar")
when represented as an s-expression. The tag names are subtypes of XML-OBJECT such as XML-ELEMENT, XML-LOCAL-ATTRIBUTE, XML-GLOBAL-ATTRIBUTE, etc. ?, ! and [ prefixed tags are encoded as their own subtypes of XML-OBJECT, namely XML-PROCESSING-INSTRUCTION, XML-DECLARATION, XML-SPECIAL, XML-COMMENT, etc. CDATA is an XML-SPECIAL tag with a name of CDATA.
The name is available using class accessors.
Return a cons tree that (when evaluated) constructs a Stella class object.
Returns a string representing value of at least length size, padded if necessary with 0 characters.
Return true if x is 0.
Return true if x is 0.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by Hans Chalupsky on January 5, 2023 using texi2html 1.82.