Ignore:
Timestamp:
11/28/22 10:28:17 (6 months ago)
Author:
Mark Evenson
Message:

Added the possibility to specify array types in jnew-runtime-class

Types can be specified as the list (:array TYPE), where TYPE is either a keyword
describing a primitive JVM type or a JVM-CLASS-NAME structure object.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/jvm-class-file.lisp

    r15597 r15605  
    244244      (class-name-internal field-type)))
    245245
     246(defun map-array-type (field-type)
     247  (assert (eql :array (first field-type)))
     248  (concatenate 'string "["
     249   (internal-field-ref (second field-type))))
     250
    246251(defun internal-field-ref (field-type)
    247252  "Returns a string containing the JVM-internal representation of a reference
    248253to `field-type', which should either be a symbol identifying a primitive
    249254type, or a `class-name' structure identifying a class or interface."
    250   (if (symbolp field-type)
    251       (map-primitive-type field-type)
    252       (class-ref field-type)))
     255  (etypecase field-type
     256    (symbol (map-primitive-type field-type))
     257    (cons (map-array-type field-type))
     258    (jvm-class-name (class-ref field-type))))
    253259
    254260(defun descriptor (return-type &rest argument-types)
Note: See TracChangeset for help on using the changeset viewer.