mit-scheme-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MIT-Scheme-devel] Forcing (read) to read a given character from the ter


From: Derek Peschel
Subject: [MIT-Scheme-devel] Forcing (read) to read a given character from the terminal once?
Date: Sun, 18 Oct 2009 13:40:59 -0700
User-agent: Mutt/1.2.5.1i

My goal is to replace the non-Edwin debugger's "v" command with something
a little more like an ordinary REPL:

  - The user presses "(" at a debugger prompt.
  - The debugger runs a variant of command/eval-in-current-environment
    which has the effect of passing the "(" to the reader.  If the user
    kills the line, then the "(" is erased.  That's why the subject says
    "once".

command/eval-in-current-environment calls prompt-for-expression which calls
read.  They all communicate via an I/O port which, in this scenario, I am
assuming is the terminal.  Hopefully I can operate on the port.  The UNIX
ould be a call to ungetc, but the Scheme documentation doesn't seem to say
anything about ungetting characters.  Did I miss something?

This may turn out to be a useless optimization, but I can only find out
after I try.  With the debugger commands changed to control characters,
letters can also be passed to the reader and the idea may have more
possibilities.

My real goal is to make a series of simple common operations easier and more
consistent to type (or do without typing).  Perhaps we should talk about what
changes would be useful to people who use MIT Scheme in real life.  And yes,
any LISP Machine users will recognize that I'm starting on paths the LM has
already gone down.  Except the LM has more modifier keys!

-- Derek




reply via email to

[Prev in Thread] Current Thread [Next in Thread]