I wrote a small tool that parses variables and code in an Acme window, runs
code the code with the variables as input, and replaces the variable values
in the window with the values the code outputs.  The code can be any script,
but I made wrappers to make it very easy to write scripts in rc and Go.
 Here's my example from the blog post:

Bob's age=30, he is yearsleft=0 years away from retirement (calc).

#!/usr/bin/env calcgo

yearsleft = 55 - age


If you middle click calc, it runs the Go script (generated, compiled,
linked, and executed by calcgo), and replaces the value of yearsleft with
25.  You can also increment values, etc., so running calc more than once can
to interesting things.

I'm not really tuned into the Acme/Wily/Oberon community, so I don't know if
this is a common way to work, but this uses what I think might be a good
interaction model for scripts -- take input from a window and put the
results back into the window.  It's kind of like HTTP's request/response
idea.  This could be extended to handle more than just simple data, like
tables (which my old calc for Ober did, follow that link in the post if
you're interested).

Here's my blog post about it:
this-statement-is-false.blogspot.com/2010/10/calculatorspreadsheet-tool-for-acme.html

Here's a link to the source (3 rc scripts):
http://repo.or.cz/w/bills-tools.git/tree/HEAD:/calc


Bill

Reply via email to