[plt-scheme] Re: [plt-edu] world.ss ke=?

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Thu Oct 9 09:23:37 EDT 2008

2008/10/9 Marco Morazan <morazanm at gmail.com>:
> While on this, would it be a little simpler to treat all keystrokes as
> either all chars xor all symbols? As it is now, the arrows are symbols
> and the other keys are chars. Some of my (weaker) students seem
> stressed over this and anything to make their life easier helps.

Some applications need that distinction.  We had a student here write
a simple text editor, for which he needed to distinguish "typing"
keystrokes (characters) from "navigation" keystrokes (symbols).  It
would be hard to make that distinction if they were all symbols (or
characters, or strings); as it is, we give students both a predicate
and a template to help with it.

On the other hand, an "on-typing-event" hook that processed only the
character keystrokes, for applications that didn't need the symbols,
might allow some choice of the level of complexity.  Pro: the simplest
key-processing program becomes simpler.  Con: the World API becomes
more complex due to the either-or event handlers.

Carl Eastlund

Posted on the users mailing list.