Changeset 12132
 Timestamp:
 May 26, 2009, 6:51:03 PM (10 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/source/lib/sequences.lisp
r11876 r12132 447 447 (setq totallength (+ totallength length))))) 448 448 449 (defun concattostring (&rest sequences) 450 (declare (dynamicextent sequences)) 451 (let* ((size 0)) 452 (declare (fixnum size)) 453 (dolist (seq sequences) 454 (setq size (+ size (the fixnum (length seq))))) 455 (let* ((result (makestring size)) 456 (out 0)) 457 (declare (simplestring result) (fixnum out)) 458 (dolist (seq sequences result) 459 (etypecase seq 460 (simplestring 461 (let* ((n (length seq))) 462 (declare (fixnum n)) 463 (%copyivectortoivector seq 464 0 465 result 466 (the fixnum (ash out 2)) 467 (the fixnum (ash n 2))) 468 (incf out n))) 469 (string 470 (let* ((n (length seq))) 471 (declare (fixnum n)) 472 (multiplevaluebind (data offset) (arraydataandoffset seq) 473 (declare (fixnum offset)) 474 (%copyivectortoivector data 475 (the fixnum (ash offset 2)) 476 result 477 (the fixnum (ash out 2)) 478 (the fixnum (ash n 2))) 479 (incf out n)))) 480 (vector 481 (dotimes (i (length seq)) 482 (setf (schar result out) (aref seq i)) 483 (incf out))) 484 (list 485 (dolist (elt seq) 486 (setf (schar result out) elt)))))))) 449 487 450 488 ;This one doesn't choke on circular lists, doesn't cons as much, and is
Note: See TracChangeset
for help on using the changeset viewer.