jeffshrager/elizagen.org

Emulate (CONTROL T)

pdewacht opened this issue · 8 comments

This depends on how much historical accuracy we really want... The original code uses (CONTROL T), which turns off line buffering. (See BBN Lisp documentation at: http://bitsavers.trailing-edge.com/pdf/bbn/The_BBN-LISP_System_Apr69.pdf)

This probably means that the doctor is intended to answer the patient immediately when they finish a sentence, without them needing to press the Return key. The start-up instructions also hint at this:

PLEASE TERMINATE INPUT WITH A PERIOD OR A QUESTION MARK.

Not implementing this behavior means that patients get confusing output when they type two sentences on a single line. And we probably also print a spurious empty line before the doctor's responses.

There seems no portable way to implement this. On Unix you'd need to fiddle with termios, and on Windows there's the Console API. There doesn't seem to be any Lisp library that provides a portable interface to this functionality.

Yeah, down at the char-by-char reading level we'd have to monkey with god knows what. I think it's so close to perfect as is, that our job is done here! :-)

----- Original Message -----

This depends on how much historical accuracy we really want... The original
code uses (CONTROL T), which turns off line buffering. (See BBN Lisp
documentation at:
http://bitsavers.trailing-edge.com/pdf/bbn/The_BBN-LISP_System_Apr69.pdf)

This probably means that the doctor is intended to answer the patient
immediately when they finish a sentence, without them needing to press the
Return key. The start-up instructions also hint at this:

PLEASE TERMINATE INPUT WITH A PERIOD OR A QUESTION MARK.

Not implementing this behavior means that patients get confusing output when
they type two sentences on a single line. And we probably also print a
spurious empty line before the doctor's responses.

There seems no portable way to implement this. On Unix you'd need to fiddle
with termios, and on Windows there's the Console API. There doesn't seem to
be any Lisp library that provides a portable interface to this
functionality.


Reply to this email directly or view it on GitHub:
#9

@pdewacht

Thanks for pointing out that an SDS 940 has a status key!
I've been collecting status keys for quite a while and I've never seen any old big iron other than from DEC with a status key.
https://en.wikipedia.org/wiki/Status_key

I added the SDS 940 to the Talk page of the Status Key article for now. Once I understand it enough I will add it to the article. I hope you actually read the Status Key page because you have misconceptions about CONTROL-T and its long history. You wrote:

turns off line buffering

That is entirely incorrect. The output comes directly out of the system's monitor (kernel, etc.) and bypasses all buffers.

@ambiamber, agreed, very interesting! TENEX was influenced by the Berkeley system, so TOPS-20 must have got it from there.

I didn't see the information in this issue, but I found it on page 23.10 in the linked pdf. Added here for completeness:
control-t

@ambiamber You misunderstood me, I wasn't talking about a Ctrl-T keystroke.

The Eliza code has the function call (control t) near the top:

The control function is documented on page 14.10 of the BBN Lisp manual:
afbeelding

So the effect of the (control t) call is to turn off line buffering.

@larsbrinkhoff

TOPS-20 must have got it from there

DEC RSTS/E has a status key and it came before TOPS-20 too. (post hoc ergo propter hoc).

It's not a question about which came before the other.

Intent is the most difficult thing to prove.