The VikiD Truth

Knowledge base / Computing / Lisp family

PicoLisp Examples Examined

Open Data Science

There are many PicoLisp example files and snippets around the internet. I believe one good way to learn a new language, and to see the patterns and idiomatic expressions the community uses, is to read and run real source code. That is what we do on the pages below.

What changed since I first wrote these studies

When I wrote these in 2017, the PicoLisp tarball had a misc/ folder full of demo programs: life.l, chat, crc.l, fibo.l and more. In today’s pil21 (I checked 26.9, October 2026), misc/ holds only the bigtest and stress.l test scripts. The demos are gone from the distribution. So each study page now contains a complete, working program that I re-tested on 26.9, along with my original walk-through.

The other big difference is namespaces. Some libraries (@lib/simul.l, @lib/ai.l) now define their own namespace, so old code that calls grid or disp straight after (load "@lib/simul.l") fails with grid -- Undefined. Add (symbols '(simul pico)) or write simul~grid.

The studies

Where to find more examples today

How I read an example

  1. Run it first, unchanged, and see what it does.
  2. (pp 'fn) each function and guess what it does before reading the docs.
  3. Look up anything unfamiliar with (doc 'fn) in pil +.
  4. Change one thing and run it again.

Last edited · 3 revisions

Tags: #Computing