7.1 Usage

The main entry point to Symex from ELisp is the symex-traversal form, which can also be used via the definition form, symex-deftraversal. These forms allow you to define traversals (e.g., movements or transformations of code) using the Symex language, and they are analogous to lambda and defun (for defining functions in ELisp), respectively. Traversals defined this way may be evaluated using symex-eval and would execute in relation to the selected expression. Symex considers point (i.e., the cursor) to indicate the start of the selected expression.

Here is what performing a very basic traversal looks like. We’ll soon learn more about what it means:

(symex-eval
  (symex-traversal
    (do (move up)
        (move forward))))