Changeset 13380


Ignore:
Timestamp:
07/08/11 08:40:37 (10 years ago)
Author:
Mark Evenson
Message:

Fasls are no no longer created with *PRINT-READABLY*.

This fixes #156 in which the compiler could no longer dump forms into
the fasls containing arrays of (UNSIGNED-BYTE 32) because in r13274 we
required that all forms be created with a non-nil *PRINT-READABLY*.
Presumably, SimpleArray_UnsignedByte32.writeToString() signals an
error when invoked with a non-NIL *PRINT-READABLY* because the
resulting read of the form will not necessarily be of the specified
base type.

With this change, we restore ABCL's behavior before r13274 to fix
#147, which is to read a create a less precise type from the fasl.

The more correct solution would be to dump some aspects of the fasls
directly into JVM code that would perform the stricter intialization.

Tests added for both cases to ensure this remains fixed.

Location:
trunk/abcl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/dump-form.lisp

    r13274 r13380  
    135135        (*print-pretty* nil)
    136136        (*print-radix* nil)
     137#+nil ;; XXX Some types (q.v. (UNSIGNED-BYTE 32)) don't have a
     138      ;; readable syntax because they don't roundtrip to the same
     139      ;; type, but still return a Lisp object that "works", albeit
     140      ;; perhaps inefficiently when READ from their DUMP-FORM
     141      ;; representation.
    137142        (*print-readably* t)
    138143        (*print-right-margin* nil)
  • trunk/abcl/test/lisp/abcl/compiler-tests.lisp

    r13262 r13380  
    444444  :results #.most-positive-java-long)
    445445
     446;;; ticket #147
     447(deftest compiler.1
     448    (let ((tmpfile (ext::make-temp-file))
     449          (forms `((in-package :cl-user)
     450                     (eval-when (:compile-toplevel :load-toplevel :execute)
     451                       (setf *print-case* ':downcase))
     452                     (defstruct rec a b))))
     453      (with-open-file (s tmpfile :direction :output)
     454        (dolist (form forms)
     455          (write form :stream s)))
     456      (let ((result (compile-file tmpfile)))
     457        (delete-file tmpfile)
     458        (not (null result))))
     459  t)
     460
     461;;; ticket #156
     462(deftest compiler.2
     463    (let ((tmpfile (ext::make-temp-file))
     464          (line "(defconstant a #.(make-array '(8 256)
     465                    :element-type '(unsigned-byte 32) :initial-element 0))"))
     466      (with-open-file (s tmpfile :direction :output)
     467        (format s "~A" line))
     468      (let ((result (compile-file tmpfile)))
     469    #+nil    (delete-file tmpfile)
     470        (not (null result))))
     471  t)
     472
     473
     474
     475
     476
     477       
     478
     479       
     480       
Note: See TracChangeset for help on using the changeset viewer.