The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

207527 (1) [Avatar] Offline
#1
Compiling and running the program is listing 2.1 (from a Terminal on OS X 10.11.6, FWIW) and then hitting ^D to end an end-of-file will cause the program to loop endlessly with the following output:

Enter a string: The average word length is: nan


Interrupting with ^C will stop things and return you to the shell, but this still seems like a less-than-ideal way for the repl function from the Prelude to work. If I'm following the code from Idris-dev/libs/prelude/Prelude/Interactive.idr correctly, it appears that the interaction of replWith and getLine works out in such a way that replWith has no way of distinguishing between getting an empty string and trying to read from an ended file.
Edwin Brady (66) [Avatar] Offline
#2
I can reproduce this. I'll try to fix the repl function, thanks!