Introduction

A safe language for business rules. Read two examples, then run your first program.

Lispex is a language for writing business rules, such as a publisher's house style. It cannot touch files or the network, so it is safe to run inside any program. Start with two examples, then run your first program.

You can try both examples in the Playground with no installation. You only need to recognize a function call and a true-or-false question.

Add two numbers

LISPEX
(+ 2 3)

Result

OUTPUT
5

The parentheses group an expression. + names the operation, and 2 and 3 are its inputs. Lispex calls operations like this procedures.

Decide where a chapter starts

This publisher starts every chapter on an odd page.

LISPEX
(define last-page 37)

(if (odd? last-page)
    '(decision insert-blank-page)
    '(decision start-now))

Result

OUTPUT
(decision insert-blank-page)

define gives 37, the last page of the previous chapter, the name last-page. The test (odd? last-page) is true, so if chooses the first answer. The next page would be 38, so a blank page comes first. If the previous chapter ended on an even page, it would choose (decision start-now).

The leading quote keeps (decision insert-blank-page) as a list of data. Without the quote, Lispex would try to call a procedure named decision. Your application can read the list and add the blank page.

Run your own program

The First Program walks through running code, changing a number, and fixing a missing parenthesis. The Learning Path continues through five lessons to a house style rule with tests for 2 lines left, 1 line left, and a chapter heading.

Your next taskPage
Install Lispex and check its versionDownloads
Run code in the browser or on your computerFirst Program
Look up common syntaxSyntax at a Glance
Look up a form or procedureBasic Syntax Forms or Procedure Index
Read SICP and edit and run its examplesLispex · SICP course

Your application supplies a rule's input and decides what to do with the answer. Run Lispex in Your Application explains what the application handles. To save or share a rule, read Create and Restore Lispex Images or Lispex Vouch.

For the next lesson, open First Program.