All Classes Files Functions Typedefs Enumerations Friends Macros Pages
LISP
lexlist_logo.png



Lexically Defined Heterogenous Types



Types in Shrubbery Designer are also lexically defined. Objects are basically stored as strings to create a heterogenous type that can be stored and transformed to a POD type when needed. The format of the underlying string determines the type. A number (double) would be defined as starting with a numerical character and containing only numbers or a ., e.g. "12.5".

Lists start with "(","{", or "[" and ends with ")","}" or "]". By making all the paranthesis mean the same, when reading a c, c++ or Java type language, all the different parts will be lists and sublists. This creates a syntax tree that can be traversed and manipulated as a LISP tree structure.

Everything that is not a number or a list delimeter will be a symbol. For instance "HELLO","#","One_1" etc.

Additionally an object that starts with a '"' is defined as a string. Strings are required to capture anything with a white space in it. The string "Hello World !" is different from Hello World !, which would be three different tokens, while the first string would be only one string.



Special Types





XML Structured Types





Core LISP Functions



Here is a quick visual guide to the built in functions, i.e. commands, in the LISP intepreter. The diagrams are generated by Shrubbery Designer running inside the corresponding unit test that verifies the function of the command.

So we get test and visualisation of the command at the same time. Each unit test also contains one or more asserts that verify that the result of the command is as expected. Those are not shown here.


Eval to Self

lex_TestEvalToSelf.png


lex_TestEvalToSelfString.png

Numeric values and strings evaluate to themselves.


quote

lex_TestQuote1.png


lex_TestQuote2.png


atom

lex_TestAtom1.png


lex_TestAtom2.png


lex_TestAtom3.png


car

lex_TestCAR1.png


cdr


cons


Arithmetic Operations and Overloading