|
Jatha Software | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LispValue
LispValueInterface defines the root of the Interfaces that define the datatypes in the system. Most representations will pass around values as this type. User: hewett Date: Nov 7, 2003 Time: 2:49:43 PM
Method Summary | |
---|---|
LispValue |
abs()
Absolute value of a number. |
LispValue |
acos()
Arccos function. |
LispValue |
add(LispValue args)
Returns the sum of the object and the object(s) in the argument list. |
void |
adjustSpecialCount(int amount)
|
LispValue |
append(LispValue otherList)
Append two lists together. |
LispValue |
apply(LispValue args)
Apply a function to an argument list. |
void |
apropos_print(PrintWriter out)
Prints information for the APROPOS function |
LispValue |
asin()
Arcsin function. |
LispValue |
assoc(LispValue index)
Look up a value in an association list. |
LispValue |
atan()
Arctan function. |
LispValue |
atan2(LispValue x)
Arctan function. |
LispValue |
atom()
Returns T if the object is an atom. |
boolean |
basic_atom()
Returns Java true if the object is an atom. |
boolean |
basic_bignump()
Returns Java true if the object is a Bignum. |
boolean |
basic_consp()
Returns Java true if the object is a CONS cell. |
boolean |
basic_constantp()
Returns Java true if the object is a constant. |
boolean |
basic_floatp()
Returns Java true if the object is a floating-point number. |
boolean |
basic_foreignp()
Returns Java true if the object is a reference to an object in a foreign computer language. |
boolean |
basic_functionp()
Returns Java true if the object is a function. |
boolean |
basic_integerp()
Returns Java true if the object is an integer. |
boolean |
basic_keywordp()
Returns Java true if the object is a keyword. |
int |
basic_length()
Returns the Java length of a list or string. |
boolean |
basic_listp()
Returns Java true if the object is a CONS cell or NIL. |
boolean |
basic_macrop()
Returns Java true if the object is a macro. |
boolean |
basic_null()
Returns Java true if the object is NIL. |
boolean |
basic_numberp()
Returns Java true if the object is a number. |
boolean |
basic_stringp()
Returns Java true if the object is a string. |
boolean |
basic_symbolp()
Returns Java true if the object is a symbol. |
LispValue |
bignump()
Returns T if the object is a Bignum. |
LispValue |
boundp()
Returns T if the symbol has been assigned a value. |
LispValue |
butlast()
Returns all but the last of the elements of a list. |
LispValue |
car()
Returns the first element of a list. |
LispValue |
cdr()
Returns all but the first element of a list. |
LispValue |
ceiling()
Returns the smallest integer greater than or equal to the input number. |
LispValue |
characterp()
Returns T if the object is a Character. |
LispValue |
clrhash()
Clears a hash table. |
int |
compareTo(Object o)
|
LispValue |
concatenate(LispValue value)
Concatenate a string to another string. |
LispValue |
consp()
Returns T if the object is a CONS cell. |
LispValue |
constantp()
Returns T if the object is a constant. |
boolean |
contains(LispValue object)
Wrapper for member(). |
LispValue |
copy_list()
Returns a copy of the top level of a list. |
LispValue |
copy()
Returns a full copy of any list, tree, array or table, copying all the leaf elements. |
LispValue |
cos()
Cosine function, argument in radians. |
LispValue |
cot()
Cotangent function, 1/tan(x), argument in radians. |
LispValue |
csc()
Cosecant function, 1/sin(x), argument in radians. |
LispValue |
degreesToRadians()
Converts a numeric value from degrees to radians. |
LispValue |
divide(LispValue args)
Returns the quotient of the object and the object(s) in the argument list. |
LispValue |
documentation(LispValue type)
Returns the documentation string for this symbol, of the type specified. |
LispValue |
eighth()
Returns the 8th element of a list. |
LispValue |
elt(int index)
|
LispValue |
elt(LispValue index)
Returns the nth element of a list. |
LispValue |
eq(LispValue val)
Returns T if the argument is exactly identical to the object. |
LispValue |
eql(LispValue val)
Returns T if the argument is EQ to the object or if the arguments and object are numbers with equal values. |
LispValue |
equal(LispValue val)
Returns T if the argument is EQL or if two strings are STRING= or if two trees have EQUAL subtrees. |
LispValue |
equalNumeric(LispValue arg)
Returns T if the object is EQUAL to its argument. |
LispValue |
factorial()
Compute the factorial of a non-negative integer. |
LispValue |
fboundp()
Returns T if the symbol has an assigned function. |
LispValue |
fifth()
Returns the fifth element of a list, or NIL if the list is shorter than 5 elements. |
LispValue |
first()
Returns the first element of a list. |
LispValue |
floatp()
Returns T if the object is a floating-point number. |
LispValue |
floor()
Returns the largest integer less than or equal to the input number. |
LispValue |
fourth()
Returns the 4th element of a list, or NIL if the list is shorter than 4 elements. |
LispValue |
funcall(LispValue args)
Calls a functio non a list of arguments. |
LispValue |
functionp()
|
int |
get_specialCount()
|
LispValue |
gethash(LispValue key)
Retrieves values from a hash table. |
LispValue |
gethash(LispValue key,
LispValue defawlt)
Retrieves values from a hash table, returning a default value if the key is not in the table. |
Jatha |
getLisp()
|
LispValue |
greaterThan(LispValue arg)
Returns T if the object prepended to the argument list is in strictly decreasing order. |
LispValue |
greaterThanOrEqual(LispValue arg)
Returns T if the object prepended to the argument list is in non-increasing order. |
LispValue |
hash_table_count()
Returns the number of items in the hash table. |
LispValue |
hash_table_rehash_size()
Returns a floating-point number that indicates how large the hash table will be after rehashing, as a percentage of the current size. |
LispValue |
hash_table_rehash_threshold()
Returns a floating-point number that indicates how full the table gets before it will expand and rehash its contents. |
LispValue |
hash_table_size()
Returns the total size of the hash table, including empty slots. |
LispValue |
hash_table_test()
Returns the function used when comparing keys in the hash table. |
LispValue |
hashtablep()
Returns T if the object is a floating-point number. |
LispValue |
integerp()
Returns T if the object is an Integer. |
String |
internal_getName()
|
void |
internal_prin1_as_cdr(PrintStream os)
|
void |
internal_prin1(PrintStream os)
|
void |
internal_princ_as_cdr(PrintStream os)
|
void |
internal_princ(PrintStream os)
|
void |
internal_print_as_cdr(PrintStream os)
|
void |
internal_print(PrintStream os)
|
Iterator |
iterator()
|
LispValue |
keywordp()
Returns T if the object is a keyword. |
LispValue |
last()
Returns the last cons cell in a list. |
LispValue |
length()
Returns the length of a list or string. |
LispValue |
lessThan(LispValue arg)
Returns T if the object prepended to the argument list is in strictly increasing order. |
LispValue |
lessThanOrEqual(LispValue arg)
Returns T if the object prepended to the argument list is in strictly non-decreasing order. |
LispValue |
lisp_null()
Returns T if the object is NIL. |
LispValue |
list()
Creates a list from the object. |
LispValue |
listp()
Returns T if the object is a list. |
LispValue |
max(LispValue args)
Returns the maximum element of a list of numbers. |
LispValue |
member(LispValue elt)
Returns the tail of the list starting at the given element. |
LispValue |
min(LispValue args)
Returns the minimum element of a list of numbers. |
LispValue |
multiply(LispValue args)
Returns the product of the object and the object(s) in the argument list. |
LispValue |
nconc(LispValue arg)
Destructively appends a list to the end of the given list. |
LispValue |
negate()
Return the negative of a number. |
LispValue |
neql(LispValue val)
Not in the LISP standard, but useful so we don't have to compose (NOT (EQL ...)) when creating expressions. |
LispValue |
ninth()
Returns the ninth element of a list, or NIL if the list is shorter than nine elements. |
LispValue |
nreverse()
Destructively reverses the given list. |
LispValue |
nstringCapitalize()
For Common LISP compatibility, but identical to stringCapitalize. |
LispValue |
nstringDowncase()
For Common LISP compatibility, but identical to stringDowncase. |
LispValue |
nstringUpcase()
For Common LISP compatibility, but identical to stringUpcase. |
LispValue |
numberp()
Returns T if the object is any kind of number. |
LispValue |
pop()
Pops a list and returns the first element. |
LispValue |
position(LispValue element)
Returns the index of an element in a sequence. |
LispValue |
prin1()
Prints the value to standard output with *print-escape* bound to T. |
LispValue |
princ()
Prints the output so that it is readable to a person. |
LispValue |
print()
Prints using prin1, except the output is preceded by a newline and terminated by a space. |
LispValue |
push(LispValue value)
Pushes an element onto a list and returns the list. |
LispValue |
radiansToDegrees()
Converts a numeric value from radians to degrees. |
LispValue |
rassoc(LispValue index)
Like ASSOC except it matches the CDR of the cell instead of the CAR. |
LispValue |
readFromString()
Reads a value from the given string. |
LispValue |
reciprocal()
Computes 1/x of the given number. |
LispValue |
remhash(LispValue key)
Removes an element from a hash table. |
LispValue |
remove(LispValue elt)
Returns a copy of a list without all copies of the given element. |
LispValue |
rest()
Synonym for CDR. |
LispValue |
reverse()
Returns the reversed value of a list. |
LispValue |
rplaca(LispValue newCar)
Replaces the CAR of a CONS cell. |
LispValue |
rplacd(LispValue newCdr)
Replaces the CDR of a CONS cell. |
LispValue |
sec()
Secant function, 1/cos(x), argument in radians. |
LispValue |
second()
Returns the second element of a list or NIL if the list is shorter than two elements. |
void |
set_special(boolean value)
|
LispValue |
setf_documentation(LispValue type,
LispValue value)
Sets the documentation string for this symbol of the type specified. |
LispValue |
setf_gethash(LispValue key,
LispValue value)
Sets a value in a hash table. |
LispValue |
setf_symbol_function(LispValue newFunction)
Sets the function of a symbol. |
LispValue |
setf_symbol_plist(LispValue newPlist)
Sets the property list of a symbol. |
LispValue |
setf_symbol_value(LispValue newValue)
Sets the value of a symbol. |
void |
setLisp(Jatha lisp)
|
void |
setPackage(LispPackage newPackage)
|
LispValue |
setq(LispValue newValue)
Assigns a value to a symbol. |
LispValue |
seventh()
Returns the seventh element of a list or NIL if the list is shorter than seven elements. |
LispValue |
sin()
Sine trigonometric function, argument is in radians. |
LispValue |
sixth()
Returns the sixth element of a list or NIL if the list is shorter than six elements. |
boolean |
specialP()
|
LispValue |
sqrt()
Square root, accepts negative numbers. |
LispValue |
string()
Converts a String, Symbol or Character to a string. |
LispValue |
stringCapitalize()
Capitalizes the first character of a string and converts the remaining characters to lower case. |
LispValue |
stringDowncase()
Converts all of the characters to lower case. |
LispValue |
stringEndsWith(LispValue arg)
Not in Common LISP, but useful. |
LispValue |
stringEq(LispValue arg)
Returns T if the argument is an identical string to the object. |
LispValue |
stringEqual(LispValue arg)
Returns T if the argument is an identical string to the object. |
LispValue |
stringGreaterP(LispValue arg)
This is the LISP string-greaterp function. |
LispValue |
stringGreaterThan(LispValue arg)
This is the LISP string> function. |
LispValue |
stringGreaterThanOrEqual(LispValue arg)
This is the LISP string>= function. |
LispValue |
stringLeftTrim()
Trims the left end of the string by deleting whitespace on both ends. |
LispValue |
stringLeftTrim(LispValue deleteBag)
Trims the left end of the string by deleting characters in the input string on both ends. |
LispValue |
stringLessP(LispValue arg)
This is the LISP string-lessp function. |
LispValue |
stringLessThan(LispValue arg)
This is the LISP string< function. |
LispValue |
stringLessThanOrEqual(LispValue arg)
This is the LISP string<= function. |
LispValue |
stringNeq(LispValue arg)
Returns T if the argument is not STRING= the given string. |
LispValue |
stringNotGreaterP(LispValue arg)
This is the LISP string-not-greaterp function. |
LispValue |
stringNotLessP(LispValue arg)
This is the LISP string-not-lessp function. |
LispValue |
stringp()
Returns T if the object is a string. |
LispValue |
stringRightTrim()
Trims the right end of the string by deleting whitespace on both ends. |
LispValue |
stringRightTrim(LispValue deleteBag)
Trims the right end of the string by deleting characters in the input string on both ends. |
LispValue |
stringStartsWith(LispValue arg)
Not in Common LISP, but useful. |
LispValue |
stringTrim()
Trims the string by deleting whitespace on both ends. |
LispValue |
stringTrim(LispValue deleteBag)
Trims the string by deleting characters in the input string on both ends. |
LispValue |
stringUpcase()
Converts all the characters to upper case. |
LispValue |
subst(LispValue newValue,
LispValue oldValue)
Replaces all oldValues in a tree with newValue. |
LispValue |
substring(LispValue start)
Returns the substring of a string starting with the nth element. |
LispValue |
substring(LispValue start,
LispValue end)
Returns the substring of a string starting with the start element and ending just before the end element. |
LispValue |
subtract(LispValue args)
Returns the difference of the object and the object(s) in the argument list. |
LispValue |
symbol_function()
Returns the function assigned to a symbol. |
LispValue |
symbol_name()
Returns a string containing the name of a symbol. |
LispValue |
symbol_package()
Returns the package of a symbol. |
LispValue |
symbol_plist()
Returns the property list of a symbol. |
LispValue |
symbol_value()
Returns the value of a symbol. |
LispValue |
symbolp()
Returns T if the object is a symbol. |
LispValue |
tan()
Tangent trigonometric function, argument is in radians. |
LispValue |
tenth()
Returns the tenth element of a list or NIL if the list is less than ten elements long. |
LispValue |
third()
Returns the third element of a list or NIL if the list is less than three elements long. |
Collection |
toCollection()
Returns the Lisp value as a Collection. |
Object |
toJava()
Returns a Java equivalent of the object. |
Object |
toJava(String typeHint)
Returns a Java equivalent of the object. |
String |
toString()
toString() returns a printed representation
of the form (as printed by (prin1) ) in
a Java string. |
String |
toString(String columnSeparator)
Same as toString unless you are getting a String representation of an array. |
String |
toStringAsCdr_internal(long index)
Counts cdrs so as not to have runaway lists. |
String |
toStringAsCdr()
|
String |
toStringShort()
Prints a short version of the item. |
String |
toStringShort(int numberOfElements)
Prints out a short version of the Array. |
String |
toStringSimple()
Strips double-quotes and leading colons from a LispString value. |
LispValue |
type_of()
|
LispValue |
typep(LispValue type)
|
boolean |
uses(LispValue pkg)
Returns true if this package uses the given package |
LispValue |
zerop()
|
Method Detail |
---|
Jatha getLisp()
void setLisp(Jatha lisp)
String internal_getName()
void internal_princ(PrintStream os)
void internal_princ_as_cdr(PrintStream os)
void internal_prin1(PrintStream os)
void internal_prin1_as_cdr(PrintStream os)
void internal_print(PrintStream os)
void internal_print_as_cdr(PrintStream os)
void apropos_print(PrintWriter out)
boolean basic_atom()
boolean basic_bignump()
boolean basic_consp()
boolean basic_constantp()
boolean basic_floatp()
boolean basic_foreignp()
boolean basic_functionp()
boolean basic_integerp()
boolean basic_keywordp()
int basic_length()
boolean basic_listp()
boolean basic_macrop()
boolean basic_null()
boolean basic_numberp()
boolean basic_stringp()
boolean basic_symbolp()
boolean contains(LispValue object)
int compareTo(Object o)
compareTo
in interface Comparable
Iterator iterator()
Object toJava()
Object toJava(String typeHint)
Collection toCollection()
String toString()
toString()
returns a printed representation
of the form (as printed by (prin1)
) in
a Java string.
toString
in class Object
String toString(String columnSeparator)
columnSeparator
- optional column separator string, defaults to a single space.
String toStringSimple()
String toStringShort()
String toStringShort(int numberOfElements)
numberOfElements
- the maximum number of elements to print.String toStringAsCdr()
String toStringAsCdr_internal(long index)
void set_special(boolean value)
boolean specialP()
void adjustSpecialCount(int amount)
int get_specialCount()
void setPackage(LispPackage newPackage)
LispValue abs()
LispValue append(LispValue otherList)
otherList
- LispValue apply(LispValue args)
args
- LispValue assoc(LispValue index)
index
- LispValue atom()
LispValue bignump()
LispValue boundp()
LispValue butlast()
LispValue car()
LispValue cdr()
LispValue characterp()
LispValue clrhash()
LispValue concatenate(LispValue value)
LispValue consp()
LispValue constantp()
LispValue copy_list()
LispValue copy()
LispValue degreesToRadians()
LispValue eighth()
LispValue elt(LispValue index)
index
- LispValue eq(LispValue val)
LispValue eql(LispValue val)
LispValue equal(LispValue val)
LispValue factorial()
LispValue fboundp()
LispValue floatp()
LispValue fifth()
LispValue first()
LispValue fourth()
LispValue funcall(LispValue args)
LispValue gethash(LispValue key)
LispValue gethash(LispValue key, LispValue defawlt)
LispValue setf_gethash(LispValue key, LispValue value)
LispValue hashtablep()
LispValue hash_table_count()
LispValue hash_table_size()
LispValue hash_table_rehash_size()
LispValue hash_table_rehash_threshold()
LispValue hash_table_test()
LispValue integerp()
LispValue keywordp()
LispValue last()
LispValue length()
LispValue lisp_null()
LispValue list()
LispValue listp()
LispValue member(LispValue elt)
LispValue nconc(LispValue arg)
LispValue negate()
LispValue neql(LispValue val)
LispValue ninth()
LispValue nreverse()
LispValue numberp()
LispValue pop()
LispValue l1 = lisp.makeList(A, B); l1.pop(); // works correctly, l1 is now (B) l1.pop(); // doesn't work correctly. l1 is now (NIL . NIL)Jatha can't reassign l1 as expected.
However, the following does work:
LispValue l1 = new LispSymbol(lisp, "L1"); l1.setq(lisp.makeList(A, B)); l1.pop(); // works correctly. The value of L1 is now (B). l1.pop(); // works correctly. The value of L1 is now NIL. l1.push(A); // works correctly. The value of L1 is now (A). assert(l1.symbol_value().equal(lisp.makeList(A)) == lisp.T);
LispValueNotASymbolException
LispValue position(LispValue element)
LispValue prin1()
LispValue princ()
LispValue print()
LispValue push(LispValue value)
LispValue l1 = LispValue.NIL; l1.push(A); // doesn't work correctly. l1 is still NIL. l1 = l1.push(A); // works correctly.Jatha can't reassign l1 as expected.
However, the following does work:
LispValue l1 = new LispSymbol("L1"); l1.setq(LispValue.NIL); l1.push(B); // works correctly. The value of L1 is now (B). l1.push(A); // works correctly. The value of L1 is now (A B). assert(l1.symbol_value().equal(LispValueFactory.makeList(A, B)) == LispValue.T);
LispValueNotASymbolException
LispValue rassoc(LispValue index)
LispValue readFromString()
LispValue reciprocal()
LispValue remhash(LispValue key)
LispValue remove(LispValue elt)
LispValue rest()
LispValue reverse()
LispValue rplaca(LispValue newCar)
LispValue rplacd(LispValue newCdr)
LispValue second()
LispValue setf_symbol_function(LispValue newFunction)
LispValue setf_symbol_plist(LispValue newPlist)
LispValue setf_symbol_value(LispValue newValue)
LispValue setq(LispValue newValue)
LispValue seventh()
LispValue sixth()
LispValue string()
LispValue stringp()
LispValue stringUpcase()
LispValue stringDowncase()
LispValue stringCapitalize()
LispValue nstringUpcase()
LispValue nstringDowncase()
LispValue nstringCapitalize()
LispValue stringEqual(LispValue arg)
LispValue stringEq(LispValue arg)
LispValue stringNeq(LispValue arg)
LispValue stringLessThan(LispValue arg)
LispValue stringLessP(LispValue arg)
LispValue stringGreaterThan(LispValue arg)
LispValue stringGreaterP(LispValue arg)
LispValue stringLessThanOrEqual(LispValue arg)
LispValue stringGreaterThanOrEqual(LispValue arg)
LispValue stringNotLessP(LispValue arg)
LispValue stringNotGreaterP(LispValue arg)
LispValue stringEndsWith(LispValue arg)
LispValue stringStartsWith(LispValue arg)
LispValue stringTrim()
LispValue stringTrim(LispValue deleteBag)
LispValue stringLeftTrim()
LispValue stringLeftTrim(LispValue deleteBag)
LispValue stringRightTrim()
LispValue stringRightTrim(LispValue deleteBag)
LispValue subst(LispValue newValue, LispValue oldValue)
LispValue substring(LispValue start)
LispValue substring(LispValue start, LispValue end)
LispValue symbolp()
LispValue symbol_function() throws LispException
LispException
LispValue symbol_name()
LispValue symbol_package()
LispValue symbol_plist()
LispValue symbol_value() throws LispException
LispException
LispValue tenth()
LispValue third()
LispValue radiansToDegrees()
LispValue type_of()
LispValue typep(LispValue type)
LispValue zerop()
LispValue add(LispValue args)
+
function in LISP.
LispValue divide(LispValue args)
/
function in LISP.
LispValue multiply(LispValue args)
*
function in LISP.
LispValue subtract(LispValue args)
-
function in LISP.
LispValue greaterThan(LispValue arg)
LispValue greaterThanOrEqual(LispValue arg)
LispValue lessThan(LispValue arg)
LispValue lessThanOrEqual(LispValue arg)
LispValue equalNumeric(LispValue arg)
LispValue max(LispValue args)
LispValue min(LispValue args)
LispValue acos()
LispValue asin()
LispValue atan()
LispValue atan2(LispValue x)
LispValue cos()
LispValue csc()
LispValue cot()
LispValue sec()
LispValue sin()
LispValue sqrt()
LispValue tan()
LispValue ceiling()
LispValue floor()
LispValue elt(int index)
LispValue functionp()
LispValue documentation(LispValue type)
type
- a symbol
LispValue setf_documentation(LispValue type, LispValue value)
type
- a symbolvalue
- a lispstring
boolean uses(LispValue pkg)
|
Jatha Software | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |