Anyway, I wrote a simplified version of the Calc tool I wrote for Ober and I put it, here. The calc tool searches an Acme window for variables and their values and some code at the bottom. Then, it executes the code, sending the variables and values to its stdin. The code is expected to output new values for some of the variables. Calc parses the output and replaces the new values into the window. I'm also including two wrappers that make it easy to write calc scripts in rc or Go, so you can say something like this:
Bob's age=30, he is yearsleft=0 years away from retirement (calc).#!/usr/bin/env calcgoyearsleft = 55 - age
If you middle-click "calc" in the text, it will update the window to show yearsleft=25.