Jatha Software

org.jatha.dynatype
Interface LispValue

All Superinterfaces:
Comparable
All Known Subinterfaces:
LispAtom, LispBignum, LispCharacter, LispComplex, LispCons, LispConsOrNil, LispConstant, LispForeignObject, LispFunction, LispHashTable, LispInteger, LispJavaObject, LispKeyword, LispMacro, LispNil, LispNumber, LispPackage, LispReal, LispString, LispSymbol
All Known Implementing Classes:
AbsoluteValuePrimitive, AddOnePrimitive, AddPrimitive, AppendPrimitive, ApplyPrimitive, AproposPrimitive, ArcCosinePrimitive, ArcSinePrimitive, ArcTangent2Primitive, ArcTangentPrimitive, AssocPrimitive, AtomPrimitive, BackquotePrimitive, BlockPrimitive, BoundpPrimitive, ButlastPrimitive, CarPrimitive, CdrPrimitive, CeilingPrimitive, CharacterpPrimitive, ClrhashPrimitive, ConcatenatePrimitive, ConspPrimitive, ConsPrimitive, ConstantpPrimitive, CopyListPrimitive, CosecantPrimitive, CosinePrimitive, CotangentPrimitive, DefconstantPrimitive, DefparameterPrimitive, DefvarPrimitive, DegreesToRadiansPrimitive, DividePrimitive, DocumentationPrimitive, EighthPrimitive, EltPrimitive, EqlPrimitive, EqPrimitive, EqualNumericPrimitive, EvalPrimitive, ExitPrimitive, ExportPrimitive, FactorialPrimitive, FboundpPrimitive, FifthPrimitive, FindPackagePrimitive, FirstPrimitive, FloatpPrimitive, FloorPrimitive, FourthPrimitive, FreePrimitive, FuncallPrimitive, FunctionPrimitive, GcFullPrimitive, GcPrimitive, GethashPrimitive, GoPrimitive, GreaterThanOrEqualPrimitive, GreaterThanPrimitive, GrindefPrimitive, HashtableCountPrimitive, HashtablepPrimitive, HashtableRehashSizePrimitive, HashtableRehashThresholdPrimitive, HashtableSizePrimitive, HashtableTestPrimitive, ImportPrimitive, IntegerpPrimitive, InternPrimitive, KeywordpPrimitive, LastPrimitive, LengthPrimitive, LessThanOrEqualPrimitive, LessThanPrimitive, LispConsIterator, LispPrimitive, ListAllPackagesPrimitive, ListpPrimitive, ListPrimitive, ListStarPrimitive, LoadFromJarPrimitive, LoadPrimitive, Macroexpand1Primitive, MacroexpandPrimitive, MakeHashTablePrimitive, MakepackagePrimitive, MaxPrimitive, MemberPrimitive, MinPrimitive, MultiplyPrimitive, NconcPrimitive, NinthPrimitive, NotPrimitive, NreversePrimitive, NStringCapitalizePrimitive, NStringDowncasePrimitive, NStringUpcasePrimitive, NullPrimitive, NumberpPrimitive, opAP, opBLK, opDAP, opDUM, opJOIN, opLD, opLD_GLOBAL, opLDC, opLDF, opLDFC, opLDR, opLIS, opNIL, opRAP, opRTN, opRTN_IF, opRTN_IT, opSEL, opSP_BIND, opSP_UNBIND, opSTOP, opT, opTAG_B, opTAG_E, opTEST, PackageNamePrimitive, PackageNicknamesPrimitive, PackageUseListPrimitive, PopPrimitive, PositionPrimitive, Prin1Primitive, PrincPrimitive, PrintPrimitive, PushPrimitive, QuotePrimitive, RadiansToDegreesPrimitive, RassocPrimitive, ReadFromStringPrimitive, ReciprocalPrimitive, RemhashPrimitive, RemovePrimitive, RestPrimitive, ReturnFromPrimitive, ReversePrimitive, RplacaPrimitive, RplacdPrimitive, SecantPrimitive, SECDop, SECDRegister, SecondPrimitive, SetfDocumentationPrimitive, SetfGethashPrimitive, SetfSymbolFunctionPrimitive, SetfSymbolPlistPrimitive, SetfSymbolValuePrimitive, SetPrimitive, SetqPrimitive, SeventhPrimitive, ShadowingImportPrimitive, ShadowPrimitive, SinePrimitive, SixthPrimitive, SquareRootPrimitive, StandardLispAtom, StandardLispBignum, StandardLispCharacter, StandardLispComplex, StandardLispCons, StandardLispConsOrNil, StandardLispConstant, StandardLispForeignObject, StandardLispFunction, StandardLispHashTable, StandardLispInteger, StandardLispJavaObject, StandardLispKeyword, StandardLispMacro, StandardLispNIL, StandardLispNumber, StandardLispPackage, StandardLispReal, StandardLispString, StandardLispSymbol, StandardLispValue, StringCapitalizePrimitive, StringDowncasePrimitive, StringEndsWithPrimitive, StringEqPrimitive, StringEqualPrimitive, StringGreaterpPrimitive, StringGreaterThanOrEqualPrimitive, StringGreaterThanPrimitive, StringLeftTrimPrimitive, StringLesspPrimitive, StringLessThanOrEqualPrimitive, StringLessThanPrimitive, StringNeqPrimitive, StringNotGreaterpPrimitive, StringNotLesspPrimitive, StringpPrimitive, StringPrimitive, StringRightTrimPrimitive, StringStartsWithPrimitive, StringTrimPrimitive, StringUpcasePrimitive, SubstPrimitive, SubtractOnePrimitive, SubtractPrimitive, SymbolFunctionPrimitive, SymbolNamePrimitive, SymbolPackagePrimitive, SymbolPlistPrimitive, SymbolpPrimitive, SymbolValuePrimitive, TagbodyPrimitive, TangentPrimitive, TenthPrimitive, ThirdPrimitive, TimePrimitive, TracePrimitive, TypeOfPrimitive, UsePackagePrimitive, ZeropPrimitive

public interface LispValue
extends Comparable

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

getLisp

Jatha getLisp()

setLisp

void setLisp(Jatha lisp)

internal_getName

String internal_getName()

internal_princ

void internal_princ(PrintStream os)

internal_princ_as_cdr

void internal_princ_as_cdr(PrintStream os)

internal_prin1

void internal_prin1(PrintStream os)

internal_prin1_as_cdr

void internal_prin1_as_cdr(PrintStream os)

internal_print

void internal_print(PrintStream os)

internal_print_as_cdr

void internal_print_as_cdr(PrintStream os)

apropos_print

void apropos_print(PrintWriter out)
Prints information for the APROPOS function


basic_atom

boolean basic_atom()
Returns Java true if the object is an atom.


basic_bignump

boolean basic_bignump()
Returns Java true if the object is a Bignum.


basic_consp

boolean basic_consp()
Returns Java true if the object is a CONS cell.


basic_constantp

boolean basic_constantp()
Returns Java true if the object is a constant.


basic_floatp

boolean basic_floatp()
Returns Java true if the object is a floating-point number.


basic_foreignp

boolean basic_foreignp()
Returns Java true if the object is a reference to an object in a foreign computer language.


basic_functionp

boolean basic_functionp()
Returns Java true if the object is a function.


basic_integerp

boolean basic_integerp()
Returns Java true if the object is an integer.


basic_keywordp

boolean basic_keywordp()
Returns Java true if the object is a keyword.


basic_length

int basic_length()
Returns the Java length of a list or string.


basic_listp

boolean basic_listp()
Returns Java true if the object is a CONS cell or NIL.


basic_macrop

boolean basic_macrop()
Returns Java true if the object is a macro.


basic_null

boolean basic_null()
Returns Java true if the object is NIL.


basic_numberp

boolean basic_numberp()
Returns Java true if the object is a number.


basic_stringp

boolean basic_stringp()
Returns Java true if the object is a string.


basic_symbolp

boolean basic_symbolp()
Returns Java true if the object is a symbol.


contains

boolean contains(LispValue object)
Wrapper for member().

Returns:
true if the object is in the list.

compareTo

int compareTo(Object o)
Specified by:
compareTo in interface Comparable

iterator

Iterator iterator()

toJava

Object toJava()
Returns a Java equivalent of the object. For example, the number 3 is returned as an instance of new Integer(3). If it can't be converted to a more useful Java object, it returns a String representation.


toJava

Object toJava(String typeHint)
Returns a Java equivalent of the object. For example, the number 3 is returned as an instance of new Integer(3). If it can't be converted to a more useful Java object, it returns a String representation. You can optionally send in a hint as to what type is preferred.


toCollection

Collection toCollection()
Returns the Lisp value as a Collection. Most useful for lists, which are turned into Collections. But also works for single values.


toString

String toString()
toString() returns a printed representation of the form (as printed by (prin1)) in a Java string.

Overrides:
toString in class Object
Returns:
String The value in a string.

toString

String toString(String columnSeparator)
Same as toString unless you are getting a String representation of an array. Then it uses the columnSeparator variable to separate columns in the output.

Parameters:
columnSeparator - optional column separator string, defaults to a single space.
Returns:
a String containing a printed representation of the value.

toStringSimple

String toStringSimple()
Strips double-quotes and leading colons from a LispString value.


toStringShort

String toStringShort()
Prints a short version of the item. Can optionally send in the number of elements to print. Most useful for arrays or long lists.


toStringShort

String toStringShort(int numberOfElements)
Prints out a short version of the Array. Defaults to 5 elements

Parameters:
numberOfElements - the maximum number of elements to print.

toStringAsCdr

String toStringAsCdr()

toStringAsCdr_internal

String toStringAsCdr_internal(long index)
Counts cdrs so as not to have runaway lists.


set_special

void set_special(boolean value)

specialP

boolean specialP()

adjustSpecialCount

void adjustSpecialCount(int amount)

get_specialCount

int get_specialCount()

setPackage

void setPackage(LispPackage newPackage)

abs

LispValue abs()
Absolute value of a number.


append

LispValue append(LispValue otherList)
Append two lists together. The first list is copied.

Parameters:
otherList -

apply

LispValue apply(LispValue args)
Apply a function to an argument list.

Parameters:
args -

assoc

LispValue assoc(LispValue index)
Look up a value in an association list.

Parameters:
index -

atom

LispValue atom()
Returns T if the object is an atom.


bignump

LispValue bignump()
Returns T if the object is a Bignum.


boundp

LispValue boundp()
Returns T if the symbol has been assigned a value.


butlast

LispValue butlast()
Returns all but the last of the elements of a list. Butlast is the mirror image of CDR.


car

LispValue car()
Returns the first element of a list. CAR of NIL is NIL.


cdr

LispValue cdr()
Returns all but the first element of a list. CDR of NIL is NIL.


characterp

LispValue characterp()
Returns T if the object is a Character.


clrhash

LispValue clrhash()
Clears a hash table.


concatenate

LispValue concatenate(LispValue value)
Concatenate a string to another string. Passing in any LispValue causes it to be converted to a string and concatenated to the end. This returns a new LispString.


consp

LispValue consp()
Returns T if the object is a CONS cell. This is equivalent to asking whether it has a CAR and a CDR and is not NIL.


constantp

LispValue constantp()
Returns T if the object is a constant.


copy_list

LispValue copy_list()
Returns a copy of the top level of a list. Does not copy the interior branches.


copy

LispValue copy()
Returns a full copy of any list, tree, array or table, copying all the leaf elements. Atoms like symbols, and numbers are not copied. In Java, a string is not mutable so strings are also not copied.


degreesToRadians

LispValue degreesToRadians()
Converts a numeric value from degrees to radians.

Returns:
The value in radians.

eighth

LispValue eighth()
Returns the 8th element of a list. If the list is shorter than 8 elements, returns NIL.


elt

LispValue elt(LispValue index)
Returns the nth element of a list. The zeroth element is the first element.

Parameters:
index -

eq

LispValue eq(LispValue val)
Returns T if the argument is exactly identical to the object. That is, it must be exactly the same memory reference.


eql

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.


equal

LispValue equal(LispValue val)
Returns T if the argument is EQL or if two strings are STRING= or if two trees have EQUAL subtrees.


factorial

LispValue factorial()
Compute the factorial of a non-negative integer. Reals are truncated to the nearest integer.


fboundp

LispValue fboundp()
Returns T if the symbol has an assigned function.


floatp

LispValue floatp()
Returns T if the object is a floating-point number.


fifth

LispValue fifth()
Returns the fifth element of a list, or NIL if the list is shorter than 5 elements.


first

LispValue first()
Returns the first element of a list. Identical to the CAR function.


fourth

LispValue fourth()
Returns the 4th element of a list, or NIL if the list is shorter than 4 elements.


funcall

LispValue funcall(LispValue args)
Calls a functio non a list of arguments.


gethash

LispValue gethash(LispValue key)
Retrieves values from a hash table.


gethash

LispValue gethash(LispValue key,
                  LispValue defawlt)
Retrieves values from a hash table, returning a default value if the key is not in the table.


setf_gethash

LispValue setf_gethash(LispValue key,
                       LispValue value)
Sets a value in a hash table.


hashtablep

LispValue hashtablep()
Returns T if the object is a floating-point number.


hash_table_count

LispValue hash_table_count()
Returns the number of items in the hash table.


hash_table_size

LispValue hash_table_size()
Returns the total size of the hash table, including empty slots.


hash_table_rehash_size

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.


hash_table_rehash_threshold

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.


hash_table_test

LispValue hash_table_test()
Returns the function used when comparing keys in the hash table. Default is EQL.


integerp

LispValue integerp()
Returns T if the object is an Integer.


keywordp

LispValue keywordp()
Returns T if the object is a keyword.


last

LispValue last()
Returns the last cons cell in a list. LAST of NIL is NIL.


length

LispValue length()
Returns the length of a list or string.


lisp_null

LispValue lisp_null()
Returns T if the object is NIL.


list

LispValue list()
Creates a list from the object. Creates a CONS cell and assigns the original object to the CAR and NIL to the CDR.


listp

LispValue listp()
Returns T if the object is a list. True if it is a CONS cell or NIL.


member

LispValue member(LispValue elt)
Returns the tail of the list starting at the given element. Uses EQL as the comparator.


nconc

LispValue nconc(LispValue arg)
Destructively appends a list to the end of the given list.


negate

LispValue negate()
Return the negative of a number.


neql

LispValue neql(LispValue val)
Not in the LISP standard, but useful so we don't have to compose (NOT (EQL ...)) when creating expressions.


ninth

LispValue ninth()
Returns the ninth element of a list, or NIL if the list is shorter than nine elements.


nreverse

LispValue nreverse()
Destructively reverses the given list. May or may not return the same pointer.


numberp

LispValue numberp()
Returns T if the object is any kind of number.


pop

LispValue pop()
Pops a list and returns the first element. NOTE: Because Java's variable values aren't accessible to Jatha, the following doesn't work as expected:
   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);
 

Returns:
the first element of the list
Throws:
LispValueNotASymbolException

position

LispValue position(LispValue element)
Returns the index of an element in a sequence. Currently works for lists and strings. Comparison is by EQL for lists and CHAR= for lists. Returns NIL if the element is not found in the sequence.


prin1

LispValue prin1()
Prints the value to standard output with *print-escape* bound to T. It will print escape characters in order to make the input readable by a computer.


princ

LispValue princ()
Prints the output so that it is readable to a person.


print

LispValue print()
Prints using prin1, except the output is preceded by a newline and terminated by a space.


push

LispValue push(LispValue value)
Pushes an element onto a list and returns the list. NOTE: Because Java's variable values aren't accessible to Jatha, the following doesn't work as expected:
   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);
 

Returns:
the new list.
Throws:
LispValueNotASymbolException

rassoc

LispValue rassoc(LispValue index)
Like ASSOC except it matches the CDR of the cell instead of the CAR.


readFromString

LispValue readFromString()
Reads a value from the given string.

Returns:
a LispValue as read by the LISP Reader

reciprocal

LispValue reciprocal()
Computes 1/x of the given number. Only valid for numbers.

Returns:
a LispReal

remhash

LispValue remhash(LispValue key)
Removes an element from a hash table.


remove

LispValue remove(LispValue elt)
Returns a copy of a list without all copies of the given element.


rest

LispValue rest()
Synonym for CDR.


reverse

LispValue reverse()
Returns the reversed value of a list.


rplaca

LispValue rplaca(LispValue newCar)
Replaces the CAR of a CONS cell.


rplacd

LispValue rplacd(LispValue newCdr)
Replaces the CDR of a CONS cell.


second

LispValue second()
Returns the second element of a list or NIL if the list is shorter than two elements.


setf_symbol_function

LispValue setf_symbol_function(LispValue newFunction)
Sets the function of a symbol.


setf_symbol_plist

LispValue setf_symbol_plist(LispValue newPlist)
Sets the property list of a symbol.


setf_symbol_value

LispValue setf_symbol_value(LispValue newValue)
Sets the value of a symbol.


setq

LispValue setq(LispValue newValue)
Assigns a value to a symbol.


seventh

LispValue seventh()
Returns the seventh element of a list or NIL if the list is shorter than seven elements.


sixth

LispValue sixth()
Returns the sixth element of a list or NIL if the list is shorter than six elements.


string

LispValue string()
Converts a String, Symbol or Character to a string.


stringp

LispValue stringp()
Returns T if the object is a string.


stringUpcase

LispValue stringUpcase()
Converts all the characters to upper case.


stringDowncase

LispValue stringDowncase()
Converts all of the characters to lower case.


stringCapitalize

LispValue stringCapitalize()
Capitalizes the first character of a string and converts the remaining characters to lower case.


nstringUpcase

LispValue nstringUpcase()
For Common LISP compatibility, but identical to stringUpcase.


nstringDowncase

LispValue nstringDowncase()
For Common LISP compatibility, but identical to stringDowncase.


nstringCapitalize

LispValue nstringCapitalize()
For Common LISP compatibility, but identical to stringCapitalize.


stringEqual

LispValue stringEqual(LispValue arg)
Returns T if the argument is an identical string to the object. Character comparison is case-insensitive. STRING-EQUAL.


stringEq

LispValue stringEq(LispValue arg)
Returns T if the argument is an identical string to the object. Character comparison is case-sensitive. This is the LISP string= function.


stringNeq

LispValue stringNeq(LispValue arg)
Returns T if the argument is not STRING= the given string.


stringLessThan

LispValue stringLessThan(LispValue arg)
This is the LISP string< function. Case-sensitive comparison for ordering.


stringLessP

LispValue stringLessP(LispValue arg)
This is the LISP string-lessp function. Case-insensitive comparison for ordering.


stringGreaterThan

LispValue stringGreaterThan(LispValue arg)
This is the LISP string> function. Case-sensitive comparison for ordering.


stringGreaterP

LispValue stringGreaterP(LispValue arg)
This is the LISP string-greaterp function. Case-insensitive comparison for ordering.


stringLessThanOrEqual

LispValue stringLessThanOrEqual(LispValue arg)
This is the LISP string<= function. Case-sensitive comparison for ordering.


stringGreaterThanOrEqual

LispValue stringGreaterThanOrEqual(LispValue arg)
This is the LISP string>= function. Case-sensitive comparison for ordering.


stringNotLessP

LispValue stringNotLessP(LispValue arg)
This is the LISP string-not-lessp function. Case-insensitive comparison for ordering.


stringNotGreaterP

LispValue stringNotGreaterP(LispValue arg)
This is the LISP string-not-greaterp function. Case-insensitive comparison for ordering.


stringEndsWith

LispValue stringEndsWith(LispValue arg)
Not in Common LISP, but useful. This is case-sensitive.


stringStartsWith

LispValue stringStartsWith(LispValue arg)
Not in Common LISP, but useful. This is case-sensitive.


stringTrim

LispValue stringTrim()
Trims the string by deleting whitespace on both ends.


stringTrim

LispValue stringTrim(LispValue deleteBag)
Trims the string by deleting characters in the input string on both ends.


stringLeftTrim

LispValue stringLeftTrim()
Trims the left end of the string by deleting whitespace on both ends.


stringLeftTrim

LispValue stringLeftTrim(LispValue deleteBag)
Trims the left end of the string by deleting characters in the input string on both ends.


stringRightTrim

LispValue stringRightTrim()
Trims the right end of the string by deleting whitespace on both ends.


stringRightTrim

LispValue stringRightTrim(LispValue deleteBag)
Trims the right end of the string by deleting characters in the input string on both ends.


subst

LispValue subst(LispValue newValue,
                LispValue oldValue)
Replaces all oldValues in a tree with newValue. The default test is EQL.


substring

LispValue substring(LispValue start)
Returns the substring of a string starting with the nth element. Substring(0) returns a copy of the string.


substring

LispValue substring(LispValue start,
                    LispValue end)
Returns the substring of a string starting with the start element and ending just before the end element. Substring(3,5) returns a two-character string.


symbolp

LispValue symbolp()
Returns T if the object is a symbol.


symbol_function

LispValue symbol_function()
                          throws LispException
Returns the function assigned to a symbol.

Throws:
LispException

symbol_name

LispValue symbol_name()
Returns a string containing the name of a symbol.


symbol_package

LispValue symbol_package()
Returns the package of a symbol.


symbol_plist

LispValue symbol_plist()
Returns the property list of a symbol.


symbol_value

LispValue symbol_value()
                       throws LispException
Returns the value of a symbol.

Throws:
LispException

tenth

LispValue tenth()
Returns the tenth element of a list or NIL if the list is less than ten elements long.


third

LispValue third()
Returns the third element of a list or NIL if the list is less than three elements long.


radiansToDegrees

LispValue radiansToDegrees()
Converts a numeric value from radians to degrees.

Returns:
The value in degrees.

type_of

LispValue type_of()

typep

LispValue typep(LispValue type)

zerop

LispValue zerop()

add

LispValue add(LispValue args)
Returns the sum of the object and the object(s) in the argument list. This is the + function in LISP.


divide

LispValue divide(LispValue args)
Returns the quotient of the object and the object(s) in the argument list. This is the / function in LISP.


multiply

LispValue multiply(LispValue args)
Returns the product of the object and the object(s) in the argument list. This is the * function in LISP.


subtract

LispValue subtract(LispValue args)
Returns the difference of the object and the object(s) in the argument list. This is the - function in LISP.


greaterThan

LispValue greaterThan(LispValue arg)
Returns T if the object prepended to the argument list is in strictly decreasing order.


greaterThanOrEqual

LispValue greaterThanOrEqual(LispValue arg)
Returns T if the object prepended to the argument list is in non-increasing order.


lessThan

LispValue lessThan(LispValue arg)
Returns T if the object prepended to the argument list is in strictly increasing order.


lessThanOrEqual

LispValue lessThanOrEqual(LispValue arg)
Returns T if the object prepended to the argument list is in strictly non-decreasing order.


equalNumeric

LispValue equalNumeric(LispValue arg)
Returns T if the object is EQUAL to its argument.


max

LispValue max(LispValue args)
Returns the maximum element of a list of numbers.


min

LispValue min(LispValue args)
Returns the minimum element of a list of numbers.


acos

LispValue acos()
Arccos function. Argument in radians. Also called Inverse Cosine, this is the angle whose cosine is the argument.


asin

LispValue asin()
Arcsin function. Argument in radians. Also called Inverse Sine, this is the angle whose sine is the argument.


atan

LispValue atan()
Arctan function. Argument in radians. Also called Inverse Tangent, this is the angle whose tangent is the argument.


atan2

LispValue atan2(LispValue x)
Arctan function. Argument in radians. Also called Inverse Tangent, this is the angle whose tangent is y/x, where y is the first argument and x is the second argument.


cos

LispValue cos()
Cosine function, argument in radians.


csc

LispValue csc()
Cosecant function, 1/sin(x), argument in radians.


cot

LispValue cot()
Cotangent function, 1/tan(x), argument in radians.


sec

LispValue sec()
Secant function, 1/cos(x), argument in radians.


sin

LispValue sin()
Sine trigonometric function, argument is in radians.


sqrt

LispValue sqrt()
Square root, accepts negative numbers.


tan

LispValue tan()
Tangent trigonometric function, argument is in radians.


ceiling

LispValue ceiling()
Returns the smallest integer greater than or equal to the input number.


floor

LispValue floor()
Returns the largest integer less than or equal to the input number.


elt

LispValue elt(int index)

functionp

LispValue functionp()

documentation

LispValue documentation(LispValue type)
Returns the documentation string for this symbol, of the type specified. The type may be any symbol, but the most common ones are:

Parameters:
type - a symbol
Returns:
a LispString or NIL

setf_documentation

LispValue setf_documentation(LispValue type,
                             LispValue value)
Sets the documentation string for this symbol of the type specified. The type may be any symbol, but the most common ones are:

Parameters:
type - a symbol
value - a lispstring
Returns:
value

uses

boolean uses(LispValue pkg)
Returns true if this package uses the given package


Jatha Software