9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Simple calculator/spreadsheet for Acme
@ 2010-10-22 15:41 Bill Burdick
  0 siblings, 0 replies; only message in thread
From: Bill Burdick @ 2010-10-22 15:41 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 1413 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2553 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-10-22 15:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-22 15:41 [9fans] Simple calculator/spreadsheet for Acme Bill Burdick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).