Changeset 14591


Ignore:
Timestamp:
12/27/13 15:58:16 (9 years ago)
Author:
Mark Evenson
Message:

Correctly initialize/restore *BACKQUOTE-COUNT* special when loading FASLs.

Throw intelligible errors from problems encountered by SHARPSIGN-DOT
macros passed through '--eval' arguments.

Fixes #334.

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Interpreter.java

    r14089 r14591  
    596596        StringInputStream stream = new StringInputStream(s);
    597597        final LispThread thread = LispThread.currentThread();
    598         LispObject obj = stream.read(false, EOF, false, thread,
    599                                      Stream.currentReadtable);
     598        LispObject obj = null;
     599
     600        final SpecialBindingsMark mark0 = thread.markSpecialBindings();
     601        thread.bindSpecial(Symbol.DEBUGGER_HOOK, _DEBUGGER_HOOK_FUNCTION);
     602        try {  // catch possible errors from use of SHARPSIGN_DOT macros in --eval stanzas
     603          obj = stream.read(false, EOF, false, thread,
     604                            Stream.currentReadtable);
     605        } finally {
     606          thread.resetSpecialBindings(mark0);
     607        }
    600608        if (obj == EOF)
    601609            return error(new EndOfFile(stream));
     610
    602611        final SpecialBindingsMark mark = thread.markSpecialBindings();
    603612        thread.bindSpecial(Symbol.DEBUGGER_HOOK, _DEBUGGER_HOOK_FUNCTION);
  • trunk/abcl/src/org/armedbear/lisp/Load.java

    r14541 r14591  
    485485            thread.bindSpecialToCurrentValue(special);
    486486
     487        thread.bindSpecial(_BACKQUOTE_COUNT_, Fixnum.getInstance(0));
    487488        int loadDepth = Fixnum.getValue(_LOAD_DEPTH_.symbolValue(thread));
    488489        thread.bindSpecial(_LOAD_DEPTH_, Fixnum.getInstance(++loadDepth));
  • trunk/abcl/src/org/armedbear/lisp/backquote.lisp

    r11391 r14591  
    7373;;; of ",@a)"
    7474
    75 ;; (%defvar '*backquote-count* 0)
     75;; (%defvar '*backquote-count* 0) ; defined in Java, q.v. Lisp.java:2754
    7676(%defvar '*bq-comma-flag* '(|,|))
    7777(%defvar '*bq-at-flag* '(|,@|))
    7878(%defvar '*bq-dot-flag* '(|,.|))
    79 ;; (%defvar '*bq-vector-flag* '(|bqv|))
     79;; (%defvar '*bq-vector-flag* '(|bqv|)) ; defined in Java, q.v. Lisp.java:2757
    8080
    8181;;; the actual character macro
Note: See TracChangeset for help on using the changeset viewer.