[rescue] Sick Dreamcast hacker

Joshua D Boyd jdboyd at cs.millersville.edu
Tue Jun 18 13:53:27 CDT 2002


On Tue, Jun 18, 2002 at 01:07:32PM -0400, Dave McGuire wrote:
>   I'm very much interested...

OK, here is the first very crude draft.

OK, ignoring the pen based idea for the time being[1], we need to
figure out how best to combine the operating modes of a traditional
calculator, and a lisp[2] machine.  While we are at it, some people would
probably appreciate a postfix mode, ala HP calculators.

Now, were we to create a small lisp machine, then just knock off a TI
[3], we would have a pretty easy task for the most part, but what
would be the point?  The biggest advantage that we should work for is
making it so that holding only the calculator, you can extend it 
functionality in ways that can be used intuitively.  What I mean by
this is that while on a TI we can write little basic programs, these
programs must be explicitly run, they can't be used as functions when
making, say a graph (i.e. I can't write a function foo, then make a
graph of y1=foo(x1)).

Further, people might want to actually be able to write complex
expressions for one time evaluation.

Now, complex expressions or custom functions are things that should be
written as S-expressions (ie, in lisp, rather than as a normal
calculator allows).

Also, I think everything should be case insensitive.

Now, for data entry, I'd recommend arranging the device somewhat like
a TI calculator.  To switch from typing normally to entery
S-Expressions, one would hit the "sexp" key.  This would put us in the
S-Expressions mode.  Now, all the keys still be have as labeled, but
the editor is more intelligent and everything must be a valid
s-expression.  Alpha characters should be entered as if on a cell
phone (so, hold down the alpha key, and hit 1 twice for a b).

On a side note, the REPL should have a GNU readline like history to it.

I'm not sure if I'm making myself clear.  Perhaps I should have some
examples of how a task my be accomplished.

Lets say I am using a percentage error a lot on a stupid calculator
that for one thing lacks an absolute value function.

5 - 6 
Ans * -1 
Ans / ((5 + 6) / 2)
Ans->E

11 - 10
Ans / ((11 + 10) / 2)
Ans->E

Now, I find several percentage errors, manually like above, and am
getting sick of seeing myself whether a - b is negative.  
So, I hit the "sexp" key.
Now, once you enter "sexp" mode, the menu on the bottom lists a few
things, like perhaps "define" which will enter the word define into
the current position.
The user then enters:
(define (abs v)
	(if (< v 0) 
	    (* v -1)
	    v
	))

Now, after the user hits the first closing parenthesis, v will also be
on the menu, since as a paremeter, it is expected that you will use it
a good bit.  So, the only alpha characters the user had to enter here
were "abs" and the first "v".

Then, hit "eval", and now the user can evaluate her percentage error
by typing

(abs ( 5 - 6) )/((5+6)/2)
ANS->E

Now, if this is an enterprising user (probably like the typical pro,
but unlike the typical math student), they could notice that be
creating a new function  they could save more typing.  So, they hit
"sexp" again and enter:
(define (%er i f)
	(/ (abs (- i f)) (/ (+ 5 6) 2)))
and hit eval, then sexp again.

Now they could enter
%er (5 6)
ANS->E.

Or, they could have written the function so that the answer was
automatically placed in E.

Now, what I'm not clear on is how abs and %er would be accessed once
created.  The menu at the bottom of the screen is only likely to be
good for 5 or 6 items.  We could just make them retype every time.
Using the cell phone style alpha entry would make typing a lot faster
than it is on TIs currently for people who do a lot of cell phone text
entry. 

--
Joshua D. Boyd

[1]  While I like it, making it worth while would be quite difficult
     and probably would be the sort of thing someone would earn their
     PhD. for doing.

[2]  Well, I actually think it should be a scheme machine, and thus
      that's what the examples are in.

[3]  When I refer to TI calculators, I refering to machines in the
     TI-81 to TI-86 range, since I haven't used the TI-89 enough to
     comment on it.



More information about the rescue mailing list