Changeset 39566 in project
- Timestamp:
- 01/31/21 21:11:10 (5 weeks ago)
- Location:
- release/5/list-utils/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
release/5/list-utils/trunk/comma-list-utils.scm
r39553 r39566 38 38 (define not-string-null? (o not string-null?)) 39 39 40 ; "a, b", not "a,b" 41 ;string-nulls & nulls are removed 40 ;the input list is flattened, so nulls are removed 41 ;comma : ", " so "a, b" 42 ;allow-empty? : do not remove string-nulls 42 43 ; 43 44 (define (list->comma-string ls #!optional allow-empty? (comma ", ")) … … 46 47 (ls (map ->string (list-flatten ls))) 47 48 (ls (if allow-empty? ls (filter not-string-null? ls))) ) 48 (if (null? ls) 49 "" 49 (if (null? ls) "" 50 50 (string-concatenate (intersperse ls comma)) ) ) ) 51 51 52 (define (comma-string->list str )53 (map! string-trim-whitespace-both(string-split str ",")) )52 (define (comma-string->list str #!optional (proc string-trim-whitespace-both)) 53 (map! proc (string-split str ",")) ) 54 54 55 55 (define (list-comma-join . rest) -
release/5/list-utils/trunk/list-utils.egg
r39553 r39566 3 3 4 4 ((synopsis "list-utils") 5 (version "2.3. 1")5 (version "2.3.2") 6 6 (category data) 7 7 (author "Kon Lovett") -
release/5/list-utils/trunk/list-utils.scm
r39550 r39566 56 56 (define-type alist (or null (list-of pair))) 57 57 58 (: list-unique/duplicates ( list #!optional procedure -> list list))59 (: list-unique ( list #!optional procedure -> list))58 (: list-unique/duplicates (forall (e (s (list-of e))) (s #!optional (e e -> *) -> s s))) 59 (: list-unique (forall (e (s (list-of e))) (s #!optional (e e -> *) -> s))) 60 60 (: sort-alist (alist #!optional procedure -> alist)) 61 61 (: sort-alist! (alist #!optional procedure -> void))
Note: See TracChangeset
for help on using the changeset viewer.