Re: Forth input line buffered, why?



celephicus wrote:
Greetings,

Forth, whether interpreting or compiling waits for the user to type
return before starting doing it's magic. Is there a reason for this,
apart from avoiding the output getting mixed up with the input?

The main reason is that it's often desirable to manage the input stream while you're in it. The most obvious way is simply by using the backspace or arrow keys to move around in the line at will before pulling the trigger. I would hate to be unable to backspace on the command line! There are other, more subtle, games that can be played with the input stream, but they are less common and less obvious.

I have in mind a strange implementation that tokenises while it is
accumulating input. Every time the tokeniser sees whitespace it spits
another word out. The rationale for doing this is to cut down the size
of the input buffer from 80 to 10 or so.

I have seen implementations that compile a command line before executing it, in order to be able to use things like IF and DO in the command line, but I think executing before the user is finished typing would be very hard to get used to.

If you're really that size-constrained, try shortening the buffer somewhat (e.g. 40 chars) but leave the logic the same.

Cheers,
Elizabeth

--
==================================================
Elizabeth D. Rather (US & Canada) 800-55-FORTH
FORTH Inc. +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================
.



Relevant Pages

  • Re: How to compare Environment settings for when I log in vs Task scheduler logs me in.
    ... compiling them using devenv.exe, ... scheduler to run this App as that user. ... getting confused about the first part - the set command. ... executing a .bat script containing the "set> ...
    (microsoft.public.windows.server.general)
  • Re: nmake test giving error....help
    ... i tried compiling fft4g.cit gave no errors ... Error executing link.exe. ... i tried installing inline once again by issuing following command ... Writing Makefile for Inline::C ...
    (comp.lang.perl.misc)
  • Re: ioctl DIOCSMBR: Inappropriate ioctl for device
    ... I found the reason for this error: ... kern.geom.debugflags=16 before executing this command. ...
    (freebsd-stable)
  • Re: error while building a project in netbeans
    ... Compiling 3 source files to C:\Documents and Settings\Zoomi\My ... Building jar: .....\NetBeansProjects\JpxxMailServer\dist ... To run this application from the command line without Ant, ... and makes a jar in the /dist folder which on executing that jar file ...
    (comp.lang.java.programmer)
  • Accesing structures data (getting lengthy!)
    ... > assignment statement just won't stand out amongst all the other ... > meaningless dummy variables that you have to keep track of. ... > comparitively easy to pick out of a long, boring, command line history, ... > original, for some reason, wraps me up in knots. ...
    (comp.soft-sys.matlab)