|
|
|
@ -100,11 +100,9 @@ Pointer read_char_fn(Pointer args, Pointer env) {
@@ -100,11 +100,9 @@ Pointer read_char_fn(Pointer args, Pointer env) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static Pointer buffer; |
|
|
|
|
Pointer read_fn(Pointer args, Pointer env) { |
|
|
|
|
Pointer streamPtr = CAR(args); |
|
|
|
|
Stream stream = streamPtr == NIL |
|
|
|
|
? STREAM(environment_get(env, STANDARD_INPUT)) |
|
|
|
|
: STREAM(streamPtr); |
|
|
|
|
|
|
|
|
|
Pointer read1(Pointer streamPtr, Pointer env) { |
|
|
|
|
Stream stream = STREAM(streamPtr); |
|
|
|
|
double num = 0; |
|
|
|
|
Pointer macro; |
|
|
|
|
Char c = peek_char(T, stream); |
|
|
|
@ -138,6 +136,15 @@ Pointer read_fn(Pointer args, Pointer env) {
@@ -138,6 +136,15 @@ Pointer read_fn(Pointer args, Pointer env) {
|
|
|
|
|
return symbol(STRING(buffer).data, STRING(buffer).length - 1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Pointer read_fn(Pointer args, Pointer env) { |
|
|
|
|
Pointer streamPtr = CAR(args); |
|
|
|
|
streamPtr = streamPtr == NIL ? environment_get(env, STANDARD_INPUT) : streamPtr; |
|
|
|
|
Stream stream = STREAM(streamPtr); |
|
|
|
|
Pointer result = read1(streamPtr, env); |
|
|
|
|
peek_char(T, stream); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Pointer set_reader_macro(Pointer c, Pointer fn) { |
|
|
|
|
READTABLE = table_set(READTABLE, c, fn); |
|
|
|
|
return T; |
|
|
|
|