To run the Tom's Lisp interpreter, give the command tomslsp. You will get a prompt. You may type Tom's Lisp expressions at the prompt, and it will evaluate them and return the result. For instance:
If you want to actually compute something, you must call a function. The Lisp syntax for this is a list, surrounded by parens, but not separated by commas. The first item is the operation, and the rest are the arguments. When it is evaluated, the function is called and sent the arguments. For instance, a little arithmetic:
The +, -, *, / and % operators represent addition, subtraction, multiplication, division, and modulus, as you would expect. Addition and multiplication can be given any number of arguments, while the others must have exactly two.
Tom's lisp has integers, but no floating point numbers. Unlike most production Lisps, the integers are not of unbounded length, but are the ints of the C++ compiler that compiled Tom's Lisp. Usually 32 bits. Of course, division produces an integer without a fractional part.
Though string handling is not a strength of Tom's Lisp, it does have some basic operations:
Another basic data item is the identifier. Identifiers are a bit trickier since they do not express their own value. While 17 is always 17, identifiers must have values assigned. Evaluating an identifier which has not been assigned is an error.
Here's another:
Tom's Lisp, like most lisps, is fairly free about what characters may be part of an identifier. In Tom's Lisp, an identifier may contain any non-space character except (, ), ;, ., ' or ", and must contain at least one non-digit, though it can be anywhere.
If for some peculiar reason you want to end your Tom's Lisp section, you can give keyboard EOF (generally ^D on Unix or ^Z in a DOS shell), or issue the (quit) command. It's a zero-argument Lisp function call, and you must type the parentheses. You can also use (exit n), where n is an integer, and invokes the C exit function with the indicated value.