Changeset 9478 for trunk/source/objc-bridge/name-translation.lisp
- Timestamp:
- May 14, 2008, 9:51:58 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/objc-bridge/name-translation.lisp
r9130 r9478 16 16 17 17 (in-package "CCL") 18 19 (require :split-if) 18 20 19 21 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; … … 89 91 (defun string-cat (&rest strs) 90 92 (apply #'concatenate 'simple-string strs)) 91 92 93 ;;; Split a sequence SEQ at each point where TEST is true94 ;;; DIR should be one of :BEFORE, :AFTER or :ELIDE95 96 (defun split-if (test seq &optional (dir :before))97 (remove-if98 #'(lambda (x) (equal x (subseq seq 0 0)))99 (loop for start fixnum = 0100 then (if (eq dir :before) stop (the fixnum (1+ (the fixnum stop))))101 while (< start (length seq))102 for stop = (position-if103 test seq104 :start (if (eq dir :elide) start (the fixnum (1+ start))))105 collect (subseq106 seq start107 (if (and stop (eq dir :after))108 (the fixnum (1+ (the fixnum stop)))109 stop))110 while stop)))111 112 (defun split-if-char (char seq &optional dir)113 (split-if #'(lambda (ch) (eq ch char)) seq dir))114 115 93 116 94 ;;; Collapse all prefixes of L that correspond to known special ObjC words
Note: See TracChangeset
for help on using the changeset viewer.