Changeset 13274


Ignore:
Timestamp:
05/04/11 19:13:32 (13 years ago)
Author:
ehuelsmann
Message:

Fix 147: *PRINT-CASE* setting affects COMPILE-FILE.

Found by Dan Corkill.

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

Legend:

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

    r13149 r13274  
    12421242  public static final LispObject readObjectFromString(String s)
    12431243  {
    1244     return new StringInputStream(s).read(true, NIL, false,
    1245                                          LispThread.currentThread(),
    1246                                          Stream.faslReadtable);
     1244    LispThread thread = LispThread.currentThread();
     1245    SpecialBindingsMark mark = thread.markSpecialBindings();
     1246    try {
     1247        thread.bindSpecial(Symbol.READ_BASE, LispInteger.getInstance(10));
     1248        thread.bindSpecial(Symbol.READ_EVAL, Symbol.T);
     1249        thread.bindSpecial(Symbol.READ_SUPPRESS, Nil.NIL);
     1250        // No need to bind read default float format: all floats are written
     1251        // with their correct exponent markers due to the fact that DUMP-FORM
     1252        // binds read-default-float-format to NIL
     1253
     1254        // No need to bind the default read table, because the default fasl
     1255        // read table is used below
     1256        return new StringInputStream(s).read(true, NIL, false,
     1257                                             LispThread.currentThread(),
     1258                                             Stream.faslReadtable);
     1259    }
     1260    finally {
     1261        thread.resetSpecialBindings(mark);
     1262    }
    12471263  }
    12481264
  • trunk/abcl/src/org/armedbear/lisp/Load.java

    r13149 r13274  
    601601            thread.bindSpecial(AUTOLOADING_CACHE,
    602602                               AutoloadedFunctionProxy.makePreloadingContext());
     603
     604            // Same bindings are established in Lisp.readObjectFromString()
     605            thread.bindSpecial(Symbol.READ_BASE, LispInteger.getInstance(10));
     606            thread.bindSpecial(Symbol.READ_EVAL, Symbol.T);
     607            thread.bindSpecial(Symbol.READ_SUPPRESS, Nil.NIL);
     608
    603609            in.setExternalFormat(_FASL_EXTERNAL_FORMAT_.symbolValue(thread));
    604610            while (true) {
  • trunk/abcl/src/org/armedbear/lisp/dump-form.lisp

    r12711 r13274  
    124124(defun dump-form (form stream)
    125125  (let ((*print-fasl* t)
     126        (*print-array* t)
     127        (*print-base* 10)
     128        (*print-case* :upcase)
     129        (*print-circle* nil)
     130        (*print-escape* t)
     131        (*print-gensym* t)
     132        (*print-length* nil)
    126133        (*print-level* nil)
    127         (*print-length* nil)
    128         (*print-circle* nil)
     134        (*print-lines* nil)
     135        (*print-pretty* nil)
     136        (*print-radix* nil)
     137        (*print-readably* t)
     138        (*print-right-margin* nil)
    129139        (*print-structure* t)
     140
    130141        ;; make sure to write all floats with their exponent marker:
    131142        ;; the dump-time default may not be the same at load-time
    132         (*read-default-float-format* nil))
     143        (*read-default-float-format* nil)
     144
     145        ;; these values are also bound by WITH-STANDARD-IO-SYNTAX,
     146        ;; but not used by our reader/printer, so don't bind them,
     147        ;; for efficiency reasons.
     148        ;;        (*read-eval* t)
     149        ;;        (*read-suppress* nil)
     150        ;;        (*print-miser-width* nil)
     151        ;;        (*print-pprint-dispatch* (copy-pprint-dispatch nil))
     152        ;;        (*read-base* 10)
     153        ;;        (*read-default-float-format* 'single-float)
     154        ;;        (*readtable* (copy-readtable nil))
     155        )
    133156    (dump-object form stream)))
    134157
Note: See TracChangeset for help on using the changeset viewer.