Version 3 of REPL

Updated 2013-11-19 07:31:20 by suchenwi

REPL, or Read-Evaluate-Print Loop is the basic mode of operation of a shell.

Simple example in Tcl:

 set prompt "% "
 while 1 {
    puts -nonewline $prompt
    flush stdout
    gets stdin line        ;# read...
    if [eof stdin] break
    catch $line res        ;# eval...
    puts $res              ;# print
 }

See Also

commandloop
An interactive tclsh with an event loop (but no Tk)
tclsh