Reformatted code; made paths in generated documentation relative.
This commit is contained in:
parent
222368bf64
commit
08a7c4153c
24 changed files with 496 additions and 716 deletions
|
|
@ -446,9 +446,10 @@ c_apply( struct stack_frame *frame, struct cons_pointer frame_pointer,
|
|||
result = next_pointer;
|
||||
} else {
|
||||
result =
|
||||
( *fn_cell.payload.special.
|
||||
executable ) ( get_stack_frame( next_pointer ),
|
||||
next_pointer, env );
|
||||
( *fn_cell.payload.
|
||||
special.executable ) ( get_stack_frame
|
||||
( next_pointer ),
|
||||
next_pointer, env );
|
||||
debug_print( L"Special form returning: ", DEBUG_EVAL );
|
||||
debug_print_object( result, DEBUG_EVAL );
|
||||
debug_println( DEBUG_EVAL );
|
||||
|
|
@ -1245,7 +1246,8 @@ lisp_exception( struct stack_frame *frame, struct cons_pointer frame_pointer,
|
|||
struct cons_pointer env ) {
|
||||
struct cons_pointer message = frame->arg[0];
|
||||
return exceptionp( message ) ? message : throw_exception( message,
|
||||
frame->previous );
|
||||
frame->
|
||||
previous );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1264,34 +1266,36 @@ struct cons_pointer lisp_repl( struct stack_frame *frame,
|
|||
struct cons_pointer frame_pointer,
|
||||
struct cons_pointer env ) {
|
||||
struct cons_pointer expr = NIL;
|
||||
|
||||
debug_printf(DEBUG_REPL, L"Entering new inner REPL\n");
|
||||
|
||||
debug_printf( DEBUG_REPL, L"Entering new inner REPL\n" );
|
||||
|
||||
struct cons_pointer input = get_default_stream( true, env );
|
||||
struct cons_pointer output = get_default_stream( false, env );
|
||||
// struct cons_pointer prompt_name = c_string_to_lisp_symbol( L"*prompt*" );
|
||||
struct cons_pointer old_oblist = oblist;
|
||||
struct cons_pointer new_env = env;
|
||||
|
||||
if (truep(frame->arg[0])) {
|
||||
new_env = set( prompt_name, frame->arg[0], new_env);
|
||||
|
||||
if ( truep( frame->arg[0] ) ) {
|
||||
new_env = set( prompt_name, frame->arg[0], new_env );
|
||||
}
|
||||
if (readp(frame->arg[1])) {
|
||||
new_env = set( c_string_to_lisp_symbol(L"*in*"), frame->arg[1], new_env);
|
||||
if ( readp( frame->arg[1] ) ) {
|
||||
new_env =
|
||||
set( c_string_to_lisp_symbol( L"*in*" ), frame->arg[1], new_env );
|
||||
input = frame->arg[1];
|
||||
}
|
||||
if (readp(frame->arg[2])) {
|
||||
new_env = set( c_string_to_lisp_symbol(L"*out*"), frame->arg[2], new_env);
|
||||
if ( readp( frame->arg[2] ) ) {
|
||||
new_env =
|
||||
set( c_string_to_lisp_symbol( L"*out*" ), frame->arg[2], new_env );
|
||||
output = frame->arg[2];
|
||||
}
|
||||
|
||||
|
||||
inc_ref( input );
|
||||
inc_ref( output );
|
||||
inc_ref( prompt_name );
|
||||
|
||||
URL_FILE *os = pointer2cell( output ).payload.stream.stream;
|
||||
|
||||
|
||||
|
||||
/* \todo this is subtly wrong. If we were evaluating
|
||||
* (print (eval (read)))
|
||||
* then the stack frame for read would have the stack frame for
|
||||
|
|
@ -1353,10 +1357,10 @@ struct cons_pointer lisp_repl( struct stack_frame *frame,
|
|||
dec_ref( input );
|
||||
dec_ref( output );
|
||||
dec_ref( prompt_name );
|
||||
dec_ref( new_env);
|
||||
dec_ref( new_env );
|
||||
|
||||
debug_printf( DEBUG_REPL, L"Leaving inner repl\n" );
|
||||
|
||||
debug_printf(DEBUG_REPL, L"Leaving inner repl\n");
|
||||
|
||||
return expr;
|
||||
}
|
||||
|
||||
|
|
@ -1426,13 +1430,14 @@ struct cons_pointer c_append( struct cons_pointer l1, struct cons_pointer l2 ) {
|
|||
if ( pointer2cell( l1 ).tag.value == pointer2cell( l2 ).tag.value ) {
|
||||
if ( nilp( c_cdr( l1 ) ) ) {
|
||||
return
|
||||
make_string_like_thing( ( pointer2cell( l1 ).payload.
|
||||
string.character ), l2,
|
||||
make_string_like_thing( ( pointer2cell( l1 ).
|
||||
payload.string.character ),
|
||||
l2,
|
||||
pointer2cell( l1 ).tag.value );
|
||||
} else {
|
||||
return
|
||||
make_string_like_thing( ( pointer2cell( l1 ).payload.
|
||||
string.character ),
|
||||
make_string_like_thing( ( pointer2cell( l1 ).
|
||||
payload.string.character ),
|
||||
c_append( c_cdr( l1 ), l2 ),
|
||||
pointer2cell( l1 ).tag.value );
|
||||
}
|
||||
|
|
@ -1588,8 +1593,8 @@ struct cons_pointer lisp_let( struct stack_frame *frame,
|
|||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
// return result;
|
||||
// }
|
||||
// }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue