diff --git a/src/c/assignment.d b/src/c/assignment.d index 368c8fbc1..e5cc0bf29 100644 --- a/src/c/assignment.d +++ b/src/c/assignment.d @@ -114,7 +114,7 @@ ecl_rem_setf_definition(cl_object sym) int type; @ if (Null(cl_functionp(def))) - FEinvalid_function(def); + FEinvalid_function(def); pack = ecl_symbol_package(sym); if (pack != ECL_NIL && pack->pack.locked diff --git a/src/c/compiler.d b/src/c/compiler.d index bbd0816dd..1a2a6e178 100644 --- a/src/c/compiler.d +++ b/src/c/compiler.d @@ -515,7 +515,9 @@ guess_compiler_environment(cl_env_ptr env, cl_object interpreter_env) else c_register_var(env, record0, FALSE, TRUE); } else if (record1 == ecl_make_fixnum(0)) { - c_register_tags(env, ECL_NIL); + /* We have lost the information, which tag corresponds to + the lex-env record. If we are compiling a closure over a + tag, we will get an error later on. */ } else { c_register_block(env, record1); } @@ -938,11 +940,11 @@ c_call(cl_env_ptr env, cl_object args, int flags) { flags = FLAG_VALUES; } else if (ECL_SYMBOLP(name) && ((flags & FLAG_GLOBAL) || Null(c_tag_ref(env, name, @':function')))) - { - asm_op2(env, OP_CALLG, nargs); - asm_c(env, name); - flags = FLAG_VALUES; - } else { + { + asm_op2(env, OP_CALLG, nargs); + asm_c(env, name); + flags = FLAG_VALUES; + } else { /* Fixme!! We can optimize the case of global functions! */ asm_function(env, name, (flags & FLAG_GLOBAL) | FLAG_REG0); asm_op2(env, OP_CALL, nargs); @@ -2464,7 +2466,8 @@ compile_with_load_time_forms(cl_env_ptr env, cl_object form, int flags) */ if (c_env->load_time_forms != ECL_NIL) { cl_index *bytecodes = save_bytecodes(env, handle, current_pc(env)); - /* Make sure the forms are compiled in the right order */ + /* reverse the load time forms list to make sure the forms are + * compiled in the right order */ cl_object p, forms_list = cl_nreverse(c_env->load_time_forms); c_env->load_time_forms = ECL_NIL; p = forms_list; diff --git a/src/c/disassembler.d b/src/c/disassembler.d index 489df7203..fff44b87f 100644 --- a/src/c/disassembler.d +++ b/src/c/disassembler.d @@ -429,7 +429,7 @@ disassemble(cl_object bytecodes, cl_opcode *vector) { Returns from the block whose record in the lexical environment occuppies the n-th position. */ - case OP_RETURN: string = "RETFROM"; + case OP_RETURN: string = "RETFROM\t"; GET_OPARG(n, vector); goto OPARG; diff --git a/src/clos/method.lsp b/src/clos/method.lsp index de3177528..335b0fd5f 100644 --- a/src/clos/method.lsp +++ b/src/clos/method.lsp @@ -251,6 +251,7 @@ ;; explicitely the bytecodes compiler with an environment, no ;; stepping, compiler-env-p = t and execute = nil, so that the ;; form does not get executed. + ;; FIXME: Why is execute t then? (si::eval-with-env method-lambda env nil t t))) (values call-next-method-p next-method-p-p diff --git a/src/cmp/cmpflet.lsp b/src/cmp/cmpflet.lsp index e842260e7..6d50babce 100644 --- a/src/cmp/cmpflet.lsp +++ b/src/cmp/cmpflet.lsp @@ -45,8 +45,8 @@ (cmp-env-register-function fun new-env) (push (cons fun (cdr def)) defs))) - ;; Now we compile the functions, either in an empty environment - ;; in which there are no new functions + ;; Now we compile the functions, either in the current environment + ;; or in an empty environment in which there are no new functions (let ((*cmp-env* (cmp-env-copy (if (eq origin 'FLET) *cmp-env* new-env)))) (dolist (def (nreverse defs)) (let ((fun (first def))) diff --git a/src/lsp/defmacro.lsp b/src/lsp/defmacro.lsp index c306e31c7..35cfe204c 100644 --- a/src/lsp/defmacro.lsp +++ b/src/lsp/defmacro.lsp @@ -348,37 +348,37 @@ environment can be used to bytecompile the functions in MACROLET or SYMBOL-MACRO forms, and also to evaluate other forms." (declare (si::c-local)) (flet ((local-var-error-function (name) - #'(lambda (whole env) - (declare (ignore whole env)) - (error -"In a MACROLET function you tried to access a local variable, ~A, + #'(lambda (whole env) + (declare (ignore whole env)) + (error + "In a MACROLET function you tried to access a local variable, ~A, from the function in which it appears." name))) (local-fun-error-function (name) - #'(lambda (whole env) - (declare (ignore whole env)) - (error -"In a MACROLET function you tried to access a local function, ~A, + #'(lambda (whole env) + (declare (ignore whole env)) + (error + "In a MACROLET function you tried to access a local function, ~A, from the function in which it appears." name)))) (cons (do ((env (car old-env) (cdr env)) (variables '())) ((endp env) (nreverse variables)) (let ((i (car env))) (if (consp i) - (let ((name (first i))) - (if (not (keywordp name)) - (push (if (second i) - i - (list name 'si::symbol-macro (local-var-error-function name))) - variables)))))) + (let ((name (first i))) + (if (not (keywordp name)) + (push (if (second i) + i + (list name 'si::symbol-macro (local-var-error-function name))) + variables)))))) (do ((env (cdr old-env) (cdr env)) (macros '())) ((endp env) (nreverse macros)) (let ((i (car env))) (if (consp i) - (push (if (eq (second i) 'SI::MACRO) - i - (list (first i) 'SI:MACRO (local-fun-error-function (first i)))) - macros))))))) + (push (if (eq (second i) 'SI::MACRO) + i + (list (first i) 'SI:MACRO (local-fun-error-function (first i)))) + macros))))))) (defun macrolet-functions (definitions old-env) (declare (si::c-local)) diff --git a/src/lsp/top.lsp b/src/lsp/top.lsp index f8c0b9202..23f397411 100644 --- a/src/lsp/top.lsp +++ b/src/lsp/top.lsp @@ -1334,20 +1334,20 @@ Use special code 0 to cancel this operation.") Use the following functions to directly access ECL stacks. Invocation History Stack: -(sys:IHS-TOP) Returns the index of the TOP of the IHS. +(SYS:IHS-TOP) Returns the index of the TOP of the IHS. (SYS:IHS-FUN i) Returns the function of the i-th entity in IHS. (SYS:IHS-ENV i) (SYS:IHS-PREV i) (SYS:IHS-NEXT i) Frame (catch, block) Stack: -(sys:FRS-TOP) Returns the index of the TOP of the FRS. +(SYS:FRS-TOP) Returns the index of the TOP of the FRS. (SYS:FRS-BDS i) Returns the BDS index of the i-th entity in FRS. (SYS:FRS-IHS i) Returns the IHS index of the i-th entity in FRS. (SYS:FRS-TAG i) Binding Stack: -(sys:BDS-TOP) Returns the index of the TOP of the BDS. +(SYS:BDS-TOP) Returns the index of the TOP of the BDS. (SYS:BDS-VAR i) Returns the symbol of the i-th entity in BDS. (SYS:BDS-VAL i) Returns the value of the i-th entity in BDS.