May 7, 2021
The Mu computer now has Lisp macros

Here's the Bresenham algorithm for drawing circles using a few macros. My current style is to keep line width to 41 characters and lay out two columns of functions.

Bresenham's circle algorithm implemented using 2 macros:

  (when cond body) = (if cond body ())
  (let x val body) = ((fn (f) body) val)

Caveats:

  • No nested backquotes yet.
  • I can't draw circles too far down the screen due to a strange error.
  • In general, error messages have been a mess ever since I stopped relying on Linux. A heavy exercise in humility.

Main project page: https://github.com/akkartik/mu

This post is part of my Freewheeling Apps Devlog.

Comments gratefully appreciated. Please send them to me by any method of your choice and I'll include them here.

archive
projects
writings
videos
subscribe
Mastodon
RSS (?)
twtxt (?)
Station (?)