On Thu, Aug 15, 2019 at 12:38 PM <xxxxxx@ancell-ent.com> wrote:

This SRFI is not demanding much in the way of magic except in this one place, right?

Go ahead and flush the word "magic" anyway.
 
Ummm, unless I completely misunderstand how it's to be used, which I guess I am ... I now guess that the idea of the with-raw-mode etc. functions is that after you do basic application setup, you run your application with the thunk you hand with-raw-mode or with-rare-mode.

Just so.
 
For some reason, perhaps because they return strings, perhaps because of the description, how you can interpret the second and final sentence, I was envisioning you'd call them for each small set of characters you'd be getting from the user.

~~ blush ~~

Copy and paste disease, the common failure mode of a SRFI (re)writer.  They should of course return whatever the thunk returns (including multiple values).  That includes without-echo; if you want to input a password silently (without magic echo) just call read-line within the thunk.   If you want for whatever reason to read multiple lines with echo off, you can do that too.
 
That's what I was thinking ... except if that happens, you're stuck if you can't construct your own less capable version with the primitives I advocate exposing, unless the lack of capability is so great it's impossible. 

Raw mode is too basic to be broken, IMO (except on Windows, where it's another story altogether).  It's basically just telling the kernel to get out of the way completely.
 
So with-rare-mode should get the min and time arguments like with-raw-mode.

I looked it up this time instead of shooting from the hip.  Rare (cbreak) mode is precisely -ICANON -ECHO VMIN=1 VTIME=0, so read-char will hang until a character is available and then return it.  That's why no min/time arguments are needed.  You can of course call read-line or any other read-* in rare or raw mode, but it will chew up a lot of CPU going into and out of kernel mode for every character.


John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
Wer es in kleinen Dingen mit der Wahrheit nicht ernst nimmt, dem kann
man auch in grossen Dingen nicht vertrauen.  --Albert Einstein on honesty