... | ... | @@ -49,4 +49,9 @@ Result of run: |
|
|
abc
|
|
|
cba
|
|
|
|
|
|
Here *123* and *abc* are user input, *321* and *cba* are output of the program. Keys combination Ctrl-D was used to terminate execution of this program. In future versions of Hopeless multiplatform function `gets` should be used instead of Linux specific `lines(read("/dev/stdin"))`. |
|
|
\ No newline at end of file |
|
|
Here *123* and *abc* are user input, *321* and *cba* are output of the program. Keys combination Ctrl-D was used to terminate execution of this program. In future versions of Hopeless multiplatform function `gets` should be used instead of Linux specific `lines(read("/dev/stdin"))`. Look at example *test/_input.hop* from Hopeless distribution:
|
|
|
|
|
|
#!/usr/local/bin/hopeless -f
|
|
|
uses system,list;
|
|
|
write "Press Ctrl-D to quit\n";
|
|
|
write map reverse gets; |