Ignore:
Timestamp:
07/12/11 14:28:01 (10 years ago)
Author:
Mark Evenson
Message:

JSS:JLIST-TO-LIST now works for types implementing java.util.List.

Unclear as to what sort of type JSS:LIST-TO-LIST should work on, so we
restore the previous implementation while marking it as deprecated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/contrib/jss/invoke.lisp

    r13397 r13398  
    552552
    553553(defun jlist-to-list (list)
     554  "Convert a LIST implementing java.util.List to a Lisp list."
     555  (declare (optimize (speed 3) (safety 0)))
     556  (loop :for i :from 0 :below (jcall "size" list)
     557     :collecting (jcall "get" list i)))
     558
     559(defun jarray-to-list (jarray)
     560  (declare (optimize (speed 3) (safety 0)))
     561  (jlist-to-list
     562   (jstatic "asList" "java.util.Arrays" jarray)))
     563
     564;;; Deprecated
     565;;;
     566;;; XXX unclear what sort of list this would actually work on, as it
     567;;; certainly doesn't seem to be any of the Java collection types
     568;;; (what implements getNext())?
     569(defun list-to-list (list)
    554570  (declare (optimize (speed 3) (safety 0)))
    555571  (with-constant-signature ((isEmpty "isEmpty") (getfirst "getFirst")
    556           (getNext "getNext"))
     572                            (getNext "getNext"))
    557573    (loop until (isEmpty list)
    558574       collect (getFirst list)
    559575       do (setq list (getNext list)))))
    560 
    561 ;;; Deprecated
    562 (setf (symbol-function 'list-to-list) #'jlist-to-list)
    563576
    564577;; Contribution of Luke Hope. (Thanks!)
Note: See TracChangeset for help on using the changeset viewer.