(Lispex)
Write refund and eligibility rules that return answers as data.
(+ 2 3) → 5
Run a program in your browser, a Node.js project, or the Native command-line program.
Check a refund request.
Each request gives the days since purchase, whether the item was opened, and the amount in cents. The three results below allow a refund, send a request for review, and deny a late request.
(define (review request)
(let ((days (cdr (assq 'days request)))
(opened (cdr (assq 'opened request)))
(cents (cdr (assq 'cents request))))
(cond ((>= days 15) '(deny outside-window))
(opened '(deny opened-item))
((> cents 50000) '(escalate manual-review))
(else '(allow within-policy)))))
(map review
'(((days . 14) (opened . #f) (cents . 12900))
((days . 14) (opened . #f) (cents . 82000))
((days . 15) (opened . #f) (cents . 12900))))
; => ((allow within-policy) (escalate manual-review) (deny outside-window))Read the operation, then its inputs.
Every if has an else branch. The core language provides 205 built-in procedures. Procedures such as map and filter apply another procedure to one list at a time. The language defines how each form is read and evaluated.
To compare runs, keep the source bytes, input bytes, executor, and resource profile the same. The profile sets work and memory limits. Compare the same result, output, and diagnostic channels.
Browse the syntaxChoose the browser, npm, or Native.
The Playground runs code locally in your browser. The npm package runs it in Node.js. Native runs on your computer and also provides formatting and bytecode commands. Bytecode stores instructions prepared from your source.
These products use the reference implementation written in Rust. The browser and npm use its WebAssembly build. Native runs it directly. The runtime guide lists their commands, memory limits, and recursion limits.
Sign a decision and check it later.
Native can sign a record linking the executed rule, input, and answer.
The recipient chooses the public key they trust and supplies their own rule and input. Vouch checks the signature and can run the rule again to compare the result with the signed record.
The calling application checks the record and uses its own policy to authorize a refund or other business action.
Recover this rule from its pixels.

(let ((input '((days . 14) (opened . #f))))
(let ((days (cdr (car input)))
(opened (cdr (car (cdr input)))))
(if (< days 15)
(if opened "deny" "allow")
"deny")))This rule returns "allow".
This image contains the exact source bytes shown here. Recover them on your computer or in the Playground. The decoder accepts PNG files or ordered sets of pages in the format produced by the Lispex image codec.
Keep the image file intact when sharing it. After decoding, you can inspect and run the recovered source.
Find the next example or a syntax rule.
Start with the introduction and learning path. Use the manual when you need syntax, runtime, image, or Vouch instructions.
Read the introduction