projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/scheme: Add ports. Split scheme code up.
[fw/altos]
/
src
/
scheme
/
ao_scheme_rep.c
diff --git
a/src/scheme/ao_scheme_rep.c
b/src/scheme/ao_scheme_rep.c
index b35ba5b8da796a21b7f4b2722b52ca468d2f3708..49ab05599ff68464e1ec0b0e07d3239ecbaa2ee4 100644
(file)
--- a/
src/scheme/ao_scheme_rep.c
+++ b/
src/scheme/ao_scheme_rep.c
@@
-15,13
+15,15
@@
#include "ao_scheme.h"
ao_poly
#include "ao_scheme.h"
ao_poly
-ao_scheme_read_eval_print(
void
)
+ao_scheme_read_eval_print(
FILE *read_file, FILE *write_file, bool interactive
)
{
ao_poly in, out = AO_SCHEME_NIL;
ao_scheme_exception = 0;
for(;;) {
{
ao_poly in, out = AO_SCHEME_NIL;
ao_scheme_exception = 0;
for(;;) {
- in = ao_scheme_read();
+ if (interactive)
+ fputs("> ", write_file);
+ in = ao_scheme_read(read_file);
if (in == _ao_scheme_atom_eof)
break;
out = ao_scheme_eval(in);
if (in == _ao_scheme_atom_eof)
break;
out = ao_scheme_eval(in);
@@
-30,8
+32,10
@@
ao_scheme_read_eval_print(void)
break;
ao_scheme_exception = 0;
} else {
break;
ao_scheme_exception = 0;
} else {
- ao_scheme_poly_write(out, true);
- putchar ('\n');
+ if (write_file) {
+ ao_scheme_poly_write(write_file, out, true);
+ putc('\n', write_file);
+ }
}
}
return out;
}
}
return out;