Hello there, I see that there is good documentation on i/o utilities in arc, but it seems to me they are all suited for reading S-expressions. How might one read arbitrary text from stdin? I have the following: (def prompt (msg)
(pr msg)
(readline))
This function just returns nil without waiting for input if entered at the REPL, because readline sees the newline entered in order to execute the function. So I fixed it up as follows: (def prompt (msg)
(pr msg)
(readc) ; grabs the newline
(readline))
It looks like this one works until I do something like this:(defvar x (prompt "> ")) When I enter 'x' at the REPL immediately after, I get an error, application: not a procedure;
expected a procedure that can be applied to arguments
given: ""
arguments...: [none]
context...:
/Users/matt/code/arc/anarki/ac.scm:1252:4
Could someone point out to me how to read arbitrary text into a variable from a stream (like stdin)?Thanks,
mpr |