Changeset 32337 in project for release/5


Ignore:
Timestamp:
04/21/15 22:54:59 (4 years ago)
Author:
evhan
Message:

srfi-1: Convert to module

Location:
release/5/srfi-1/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/5/srfi-1/trunk/srfi-1.scm

    r32318 r32337  
    66
    77(declare
    8   (unit srfi-1)
    98  (disable-interrupts)
    10   (hide ##srfi1#cars+cdrs/no-test ##srfi1#cdrs ##srfi1#cars+ ##srfi1#really-append-map ##srfi1#cars+cdrs+
    11         ##srfi1#cars+cdrs ##srfi1#lset2<=)
    129  (not standard-bindings member assoc))
    1310
    14 (include "common-declarations.scm")
     11(module srfi-1
     12  (xcons make-list list-tabulate cons* list-copy
     13   proper-list? circular-list? dotted-list? not-pair? null-list? list=
     14   circular-list length+
     15   iota
     16   first second third fourth fifth sixth seventh eighth ninth tenth
     17   car+cdr
     18   take drop
     19   take-right drop-right
     20   take! drop-right!
     21   split-at split-at!
     22   last last-pair
     23   zip unzip1 unzip2 unzip3 unzip4 unzip5
     24   count
     25   append! append-reverse append-reverse! concatenate concatenate!
     26   unfold fold pair-fold reduce
     27   unfold-right fold-right pair-fold-right reduce-right
     28   append-map append-map! map! pair-for-each filter-map map-in-order
     29   filter partition remove
     30   filter! partition! remove!
     31   find find-tail any every list-index
     32   take-while drop-while take-while!
     33   span break span! break!)
     34
     35(import (except scheme member assoc) chicken)
    1536
    1637(register-feature! 'srfi-1)
     
    10211042
    10221043;;; We extend MAP to handle arguments of unequal length.
    1023 (define map map-in-order)       
     1044;(define map map-in-order)     
    10241045
    10251046
     
    16301651                                      lists)))
    16311652                          lis1))))
     1653
     1654) ; module
  • release/5/srfi-1/trunk/srfi-1.types

    r32318 r32337  
    11;; srfi-1 -*- Scheme -*-
    22
    3 (alist-cons (forall (a b c) (#(procedure #:clean) alist-cons (a b (list-of c)) (pair a (pair b (list-of c))))))
    4 (alist-copy (forall (a) (#(procedure #:clean #:enforce) alist-copy ((list-of a)) (list-of a))))
    5 (alist-delete (forall (a b) (#(procedure #:enforce) alist-delete (a (list-of b) #!optional (procedure (a b) *)) list)))
    6 (alist-delete! (forall (a b) (#(procedure #:enforce) alist-delete! (a (list-of b) #!optional (procedure (a b) *)) undefined)))
    7 (any (forall (a) (#(procedure #:enforce) any ((procedure (a #!rest) *) (list-of a) #!rest list) *)))
    8 (append! (#(procedure #:enforce) append! (#!rest list) list))
    9 
    10 (append-map
    11  (forall (a b) (#(procedure #:enforce) append-map ((procedure (a #!rest) (list-of b)) (list-of a) #!rest list)
     3(srfi-1#alist-cons (forall (a b c) (#(procedure #:clean) srfi-1#alist-cons (a b (list-of c)) (pair a (pair b (list-of c))))))
     4(srfi-1#alist-copy (forall (a) (#(procedure #:clean #:enforce) srfi-1#alist-copy ((list-of a)) (list-of a))))
     5(srfi-1#alist-delete (forall (a b) (#(procedure #:enforce) srfi-1#alist-delete (a (list-of b) #!optional (procedure (a b) *)) list)))
     6(srfi-1#alist-delete! (forall (a b) (#(procedure #:enforce) srfi-1#alist-delete! (a (list-of b) #!optional (procedure (a b) *)) undefined)))
     7(srfi-1#any (forall (a) (#(procedure #:enforce) srfi-1#any ((procedure (a #!rest) *) (list-of a) #!rest list) *)))
     8(srfi-1#append! (#(procedure #:enforce) srfi-1#append! (#!rest list) list))
     9
     10(srfi-1#append-map
     11 (forall (a b) (#(procedure #:enforce) srfi-1#append-map ((procedure (a #!rest) (list-of b)) (list-of a) #!rest list)
    1212                           (list-of b))))
    1313
    14 (append-map!
    15  (forall (a b) (#(procedure #:enforce) append-map! ((procedure (a #!rest) (list-of b)) (list-of a) #!rest list)
     14(srfi-1#append-map!
     15 (forall (a b) (#(procedure #:enforce) srfi-1#append-map! ((procedure (a #!rest) (list-of b)) (list-of a) #!rest list)
    1616                           (list-of b))))
    1717
    18 (append-reverse (#(procedure #:clean #:enforce) append-reverse (list list) list))
    19 (append-reverse! (#(procedure #:enforce) append-reverse! (list list) list))
    20 (break (forall (a) (#(procedure #:enforce) break ((procedure (a) *) (list-of a)) (list-of a) (list-of a))))
    21 (break! (forall (a) (#(procedure #:enforce) break! ((procedure (a) *) (list-of a)) (list-of a) (list-of a))))
    22 (car+cdr (forall (a b) (#(procedure #:clean #:enforce) car+cdr ((pair a b)) a b)))
    23 (circular-list (#(procedure #:clean) circular-list (#!rest) list))
    24 
    25 (circular-list? (#(procedure #:clean #:foldable) circular-list? (*) boolean)
     18(srfi-1#append-reverse (#(procedure #:clean #:enforce) srfi-1#append-reverse (list list) list))
     19(srfi-1#append-reverse! (#(procedure #:enforce) srfi-1#append-reverse! (list list) list))
     20(srfi-1#break (forall (a) (#(procedure #:enforce) srfi-1#break ((procedure (a) *) (list-of a)) (list-of a) (list-of a))))
     21(srfi-1#break! (forall (a) (#(procedure #:enforce) srfi-1#break! ((procedure (a) *) (list-of a)) (list-of a) (list-of a))))
     22(srfi-1#car+cdr (forall (a b) (#(procedure #:clean #:enforce) srfi-1#car+cdr ((pair a b)) a b)))
     23(srfi-1#circular-list (#(procedure #:clean) srfi-1#circular-list (#!rest) list))
     24
     25(srfi-1#circular-list? (#(procedure #:clean #:foldable) srfi-1#circular-list? (*) boolean)
    2626                ((null) (let ((#(tmp) #(1))) '#f)))
    2727
    28 (concatenate (#(procedure #:clean #:enforce) concatenate ((list-of list)) list))
    29 (concatenate! (#(procedure #:enforce) concatenate! ((list-of list)) list))
    30 (cons* (forall (a) (#(procedure #:clean) cons* (a #!rest) (pair a *))))
    31 (count (forall (a) (#(procedure #:enforce) count ((procedure (a #!rest) *) (list-of a) #!rest list) fixnum)))
    32 (delete (forall (a b) (#(procedure #:enforce) delete (a (list-of b) #!optional (procedure (a *) *)) (list-of b))))
    33 (delete! (forall (a b) (#(procedure #:enforce) delete! (a (list-of b) #!optional (procedure (a *) *)) (list-of b))))
    34 
    35 (delete-duplicates
    36  (forall (a) (#(procedure #:enforce) delete-duplicates ((list-of a) #!optional (procedure (a *) *)) (list-of a))))
    37 
    38 (delete-duplicates!
    39  (forall (a) (#(procedure #:enforce) delete-duplicates! ((list-of a) #!optional (procedure (a *) *)) (list-of a))))
    40 
    41 (dotted-list? (#(procedure #:clean #:foldable) dotted-list? (*) boolean))
    42 (drop (forall (a) (#(procedure #:enforce) drop ((list-of a) fixnum) (list-of a))))
    43 (drop-right (forall (a) (#(procedure #:enforce) drop-right ((list-of a) fixnum) (list-of a))))
    44 (drop-right! (forall (a) (#(procedure #:enforce) drop-right! ((list-of a) fixnum) (list-of a))))
    45 (drop-while (forall (a) (#(procedure #:enforce) drop-while ((procedure (a) *) (list-of a)) (list-of a))))
    46 (eighth (#(procedure #:clean #:enforce #:foldable) eighth (pair) *))
    47 
    48 (every
    49  (forall (a) (#(procedure #:enforce) every ((procedure (a #!rest) *) (list-of a) #!rest list) *)))
    50 
    51 (fifth (#(procedure #:clean #:enforce #:foldable) fifth (pair) *))
    52 (filter (forall (a) (#(procedure #:enforce) filter ((procedure (a) *) (list-of a)) (list-of a))))
    53 (filter! (forall (a) (#(procedure #:enforce) filter! ((procedure (a) *) (list-of a)) (list-of a))))
    54 
    55 (filter-map
    56  (forall (a b) (#(procedure #:enforce) filter-map ((procedure (a #!rest) b) (list-of a) #!rest list) (list-of b))))
    57 
    58 (find (forall (a) (#(procedure #:enforce) find ((procedure (a) *) (list-of a)) *)))
    59 (find-tail (forall (a) (#(procedure #:enforce) find-tail ((procedure (a) *) (list-of a)) *)))
    60 
    61 (first (forall (a) (#(procedure #:clean #:enforce #:foldable) first ((pair a *)) a))
     28(srfi-1#concatenate (#(procedure #:clean #:enforce) srfi-1#concatenate ((list-of list)) list))
     29(srfi-1#concatenate! (#(procedure #:enforce) srfi-1#concatenate! ((list-of list)) list))
     30(srfi-1#cons* (forall (a) (#(procedure #:clean) srfi-1#cons* (a #!rest) (pair a *))))
     31(srfi-1#count (forall (a) (#(procedure #:enforce) srfi-1#count ((procedure (a #!rest) *) (list-of a) #!rest list) fixnum)))
     32(srfi-1#delete (forall (a b) (#(procedure #:enforce) srfi-1#delete (a (list-of b) #!optional (procedure (a *) *)) (list-of b))))
     33(srfi-1#delete! (forall (a b) (#(procedure #:enforce) srfi-1#delete! (a (list-of b) #!optional (procedure (a *) *)) (list-of b))))
     34
     35(srfi-1#delete-duplicates
     36 (forall (a) (#(procedure #:enforce) srfi-1#delete-duplicates ((list-of a) #!optional (procedure (a *) *)) (list-of a))))
     37
     38(srfi-1#delete-duplicates!
     39 (forall (a) (#(procedure #:enforce) srfi-1#delete-duplicates! ((list-of a) #!optional (procedure (a *) *)) (list-of a))))
     40
     41(srfi-1#dotted-list? (#(procedure #:clean #:foldable) srfi-1#dotted-list? (*) boolean))
     42(srfi-1#drop (forall (a) (#(procedure #:enforce) srfi-1#drop ((list-of a) fixnum) (list-of a))))
     43(srfi-1#drop-right (forall (a) (#(procedure #:enforce) srfi-1#drop-right ((list-of a) fixnum) (list-of a))))
     44(srfi-1#drop-right! (forall (a) (#(procedure #:enforce) srfi-1#drop-right! ((list-of a) fixnum) (list-of a))))
     45(srfi-1#drop-while (forall (a) (#(procedure #:enforce) srfi-1#drop-while ((procedure (a) *) (list-of a)) (list-of a))))
     46(srfi-1#eighth (#(procedure #:clean #:enforce #:foldable) srfi-1#eighth (pair) *))
     47
     48(srfi-1#every
     49 (forall (a) (#(procedure #:enforce) srfi-1#every ((procedure (a #!rest) *) (list-of a) #!rest list) *)))
     50
     51(srfi-1#fifth (#(procedure #:clean #:enforce #:foldable) srfi-1#fifth (pair) *))
     52(srfi-1#filter (forall (a) (#(procedure #:enforce) srfi-1#filter ((procedure (a) *) (list-of a)) (list-of a))))
     53(srfi-1#filter! (forall (a) (#(procedure #:enforce) srfi-1#filter! ((procedure (a) *) (list-of a)) (list-of a))))
     54
     55(srfi-1#filter-map
     56 (forall (a b) (#(procedure #:enforce) srfi-1#filter-map ((procedure (a #!rest) b) (list-of a) #!rest list) (list-of b))))
     57
     58(srfi-1#find (forall (a) (#(procedure #:enforce) srfi-1#find ((procedure (a) *) (list-of a)) *)))
     59(srfi-1#find-tail (forall (a) (#(procedure #:enforce) srfi-1#find-tail ((procedure (a) *) (list-of a)) *)))
     60
     61(srfi-1#first (forall (a) (#(procedure #:clean #:enforce #:foldable) srfi-1#first ((pair a *)) a))
    6262       ((pair) (##core#inline "C_u_i_car" #(1))))
    6363
    64 (fold (#(procedure #:enforce) fold ((procedure (* #!rest) *) * #!rest list) *)) ;XXX
    65 (fold-right (#(procedure #:enforce) fold-right ((procedure (* #!rest) *) * #!rest list) *)) ;XXX
    66 
    67 (fourth (forall (a) (#(procedure #:clean #:enforce #:foldable) fourth ((pair * (pair * (pair * (pair a *))))) a))
     64(srfi-1#fold (#(procedure #:enforce) srfi-1#fold ((procedure (* #!rest) *) * #!rest list) *)) ;XXX
     65(srfi-1#fold-right (#(procedure #:enforce) srfi-1#fold-right ((procedure (* #!rest) *) * #!rest list) *)) ;XXX
     66
     67(srfi-1#fourth (forall (a) (#(procedure #:clean #:enforce #:foldable) srfi-1#fourth ((pair * (pair * (pair * (pair a *))))) a))
    6868        (((pair * (pair * (pair * (pair * *)))))
    6969         (##core#inline "C_u_i_car"
     
    7272                                                      (##core#inline "C_u_i_cdr" #(1)))))))
    7373
    74 (iota (#(procedure #:clean #:enforce) iota (fixnum #!optional fixnum fixnum) (list-of number)))
    75 (last (#(procedure #:clean #:enforce #:foldable) last (pair) *))
    76 (last-pair (#(procedure #:clean #:enforce #:foldable) last-pair (pair) *))
    77 (length+ (#(procedure #:clean #:enforce #:foldable) length+ (list) *))
    78 (list-copy (forall (a) (#(procedure #:pure) list-copy (a) a)))
    79 (list-index (forall (a) (#(procedure #:enforce) list-index ((procedure (a #!rest) *) (list-of a) #!rest list) *)))
    80 (list-tabulate (forall (a) (#(procedure #:enforce) list-tabulate (fixnum (procedure (fixnum) a)) (list-of a))))
    81 (list= (#(procedure #:clean #:enforce) list= (#!optional (procedure (list list) *) #!rest list) boolean)
     74(srfi-1#iota (#(procedure #:clean #:enforce) srfi-1#iota (fixnum #!optional fixnum fixnum) (list-of number)))
     75(srfi-1#last (#(procedure #:clean #:enforce #:foldable) srfi-1#last (pair) *))
     76(srfi-1#last-pair (#(procedure #:clean #:enforce #:foldable) srfi-1#last-pair (pair) *))
     77(srfi-1#length+ (#(procedure #:clean #:enforce #:foldable) srfi-1#length+ (list) *))
     78(srfi-1#list-copy (forall (a) (#(procedure #:pure) srfi-1#list-copy (a) a)))
     79(srfi-1#list-index (forall (a) (#(procedure #:enforce) srfi-1#list-index ((procedure (a #!rest) *) (list-of a) #!rest list) *)))
     80(srfi-1#list-tabulate (forall (a) (#(procedure #:enforce) srfi-1#list-tabulate (fixnum (procedure (fixnum) a)) (list-of a))))
     81(srfi-1#list= (#(procedure #:clean #:enforce) srfi-1#list= (#!optional (procedure (list list) *) #!rest list) boolean)
    8282       (() '#t)
    8383       ((procedure) (let ((#(tmp) #(1))) '#t)))
    8484
    85 (lset-adjoin
    86  (forall (a) (#(procedure #:enforce) lset-adjoin ((procedure (a a) *) (list-of a) #!rest a) (list-of a)))
    87  ((procedure list) (let ((#(tmp) #(1))) #(2))))
    88 
    89 (lset-diff+intersection
     85(srfi-1#lset-adjoin
     86 (forall (a) (#(procedure #:enforce) srfi-1#lset-adjoin ((procedure (a a) *) (list-of a) #!rest a) (list-of a)))
     87 ((procedure list) (let ((#(tmp) #(1))) #(2))))
     88
     89(srfi-1#lset-diff+intersection
    9090 (forall (a)
    91          (#(procedure #:enforce) lset-diff+intersection ((procedure (a a) *) (list-of a) #!rest (list-of a))
     91         (#(procedure #:enforce) srfi-1#lset-diff+intersection ((procedure (a a) *) (list-of a) #!rest (list-of a))
    9292                     (list-of a) (list-of a)))
    9393 ((procedure list) (let ((#(tmp) #(1))) (##sys#values #(2) '()))))
    9494
    95 (lset-diff+intersection!
     95(srfi-1#lset-diff+intersection!
    9696 (forall (a)
    97          (#(procedure #:enforce) lset-diff+intersection! ((procedure (a a) *) (list-of a) #!rest (list-of a))
     97         (#(procedure #:enforce) srfi-1#lset-diff+intersection! ((procedure (a a) *) (list-of a) #!rest (list-of a))
    9898                     (list-of a) (list-of a)))
    9999 ((procedure list) (let ((#(tmp) #(1))) (##sys#values #(2) '()))))
    100100
    101 (lset-difference
    102  (forall (a) (#(procedure #:enforce) lset-difference ((procedure (a a) *) (list-of a) #!rest (list-of a)) (list-of a)))
    103  ((procedure list) (let ((#(tmp) #(1))) #(2))))
    104 
    105 (lset-difference!
    106  (forall (a) (#(procedure #:enforce) lset-difference! ((procedure (a a) *) (list-of a) #!rest (list-of a)) (list-of a)))
    107  ((procedure list) (let ((#(tmp) #(1))) #(2))))
    108 
    109 (lset-intersection
    110  (forall (a) (#(procedure #:enforce) lset-intersection ((procedure (a a) *) (list-of a) #!rest (list-of a)) (list-of a)))
    111  ((procedure list) (let ((#(tmp) #(1))) #(2))))
    112 
    113 (lset-intersection!
    114  (forall (a) (#(procedure #:enforce) lset-intersection! ((procedure (a a) *) (list-of a) #!rest (list-of a)) (list-of a)))
    115  ((procedure list) (let ((#(tmp) #(1))) #(2))))
    116 
    117 (lset-union
    118  (forall (a) (#(procedure #:enforce) lset-union ((procedure (a a) *) #!rest (list-of a)) (list-of a)))
    119  ((procedure) (let ((#(tmp) #(1))) '()))
    120  ((procedure list) (let ((#(tmp) #(1))) #(2))))
    121 
    122 (lset-union!
    123  (forall (a) (#(procedure #:enforce) lset-union! ((procedure (a a) *) #!rest (list-of a)) (list-of a)))
    124  ((procedure) (let ((#(tmp) #(1))) '()))
    125  ((procedure list) (let ((#(tmp) #(1))) #(2))))
    126 
    127 (lset-xor
    128  (forall (a) (#(procedure #:enforce) lset-xor ((procedure (a a) *) #!rest (list-of a)) (list-of a)))
    129  ((procedure) (let ((#(tmp) #(1))) '()))
    130  ((procedure list) (let ((#(tmp) #(1))) #(2))))
    131 
    132 (lset-xor!
    133  (forall (a) (#(procedure #:enforce) lset-xor! ((procedure (a a) *) #!rest (list-of a)) (list-of a)))
    134  ((procedure) (let ((#(tmp) #(1))) '()))
    135  ((procedure list) (let ((#(tmp) #(1))) #(2))))
    136 
    137 (lset<=
    138  (forall (a) (#(procedure #:enforce) lset<= ((procedure (a a) *) #!rest (list-of a)) boolean))
     101(srfi-1#lset-difference
     102 (forall (a) (#(procedure #:enforce) srfi-1#lset-difference ((procedure (a a) *) (list-of a) #!rest (list-of a)) (list-of a)))
     103 ((procedure list) (let ((#(tmp) #(1))) #(2))))
     104
     105(srfi-1#lset-difference!
     106 (forall (a) (#(procedure #:enforce) srfi-1#lset-difference! ((procedure (a a) *) (list-of a) #!rest (list-of a)) (list-of a)))
     107 ((procedure list) (let ((#(tmp) #(1))) #(2))))
     108
     109(srfi-1#lset-intersection
     110 (forall (a) (#(procedure #:enforce) srfi-1#lset-intersection ((procedure (a a) *) (list-of a) #!rest (list-of a)) (list-of a)))
     111 ((procedure list) (let ((#(tmp) #(1))) #(2))))
     112
     113(srfi-1#lset-intersection!
     114 (forall (a) (#(procedure #:enforce) srfi-1#lset-intersection! ((procedure (a a) *) (list-of a) #!rest (list-of a)) (list-of a)))
     115 ((procedure list) (let ((#(tmp) #(1))) #(2))))
     116
     117(srfi-1#lset-union
     118 (forall (a) (#(procedure #:enforce) srfi-1#lset-union ((procedure (a a) *) #!rest (list-of a)) (list-of a)))
     119 ((procedure) (let ((#(tmp) #(1))) '()))
     120 ((procedure list) (let ((#(tmp) #(1))) #(2))))
     121
     122(srfi-1#lset-union!
     123 (forall (a) (#(procedure #:enforce) srfi-1#lset-union! ((procedure (a a) *) #!rest (list-of a)) (list-of a)))
     124 ((procedure) (let ((#(tmp) #(1))) '()))
     125 ((procedure list) (let ((#(tmp) #(1))) #(2))))
     126
     127(srfi-1#lset-xor
     128 (forall (a) (#(procedure #:enforce) srfi-1#lset-xor ((procedure (a a) *) #!rest (list-of a)) (list-of a)))
     129 ((procedure) (let ((#(tmp) #(1))) '()))
     130 ((procedure list) (let ((#(tmp) #(1))) #(2))))
     131
     132(srfi-1#lset-xor!
     133 (forall (a) (#(procedure #:enforce) srfi-1#lset-xor! ((procedure (a a) *) #!rest (list-of a)) (list-of a)))
     134 ((procedure) (let ((#(tmp) #(1))) '()))
     135 ((procedure list) (let ((#(tmp) #(1))) #(2))))
     136
     137(srfi-1#lset<=
     138 (forall (a) (#(procedure #:enforce) srfi-1#lset<= ((procedure (a a) *) #!rest (list-of a)) boolean))
    139139 ((procedure) (let ((#(tmp) #(1))) '#t))
    140140 ((procedure list) (let ((#(tmp1) #(1)) (#(tmp2) #(2))) '#t)))
    141141
    142 (lset=
    143  (forall (a) (#(procedure #:enforce) lset= ((procedure (a a) *) #!rest (list-of a)) boolean))
     142(srfi-1#lset=
     143 (forall (a) (#(procedure #:enforce) srfi-1#lset= ((procedure (a a) *) #!rest (list-of a)) boolean))
    144144 ((procedure) (let ((#(tmp) #(1))) '#t))
    145145 ((procedure list) (let ((#(tmp1) #(1)) (#(tmp2) #(2))) '#t)))
    146146
    147 (make-list (forall (a) (#(procedure #:clean #:enforce) make-list (fixnum #!optional a) (list-of a))))
    148 
    149 (map!
    150  (forall (a b) (#(procedure #:enforce) map! ((procedure (a #!rest) b) (list-of a) #!rest list) (list-of b))))
    151 
    152 (map-in-order
     147(srfi-1#make-list (forall (a) (#(procedure #:clean #:enforce) srfi-1#make-list (fixnum #!optional a) (list-of a))))
     148
     149(srfi-1#map!
     150 (forall (a b) (#(procedure #:enforce) srfi-1#map! ((procedure (a #!rest) b) (list-of a) #!rest list) (list-of b))))
     151
     152(srfi-1#map-in-order
    153153 (forall
    154154  (a b)
    155   (#(procedure #:enforce) map-in-order ((procedure (a #!rest) b) (list-of a) #!rest list) (list-of b))))
    156 
    157 (ninth (#(procedure #:clean #:enforce #:foldable) ninth (pair) *))
    158 
    159 (not-pair? (#(procedure #:clean #:foldable) not-pair? (*) boolean)
     155  (#(procedure #:enforce) srfi-1#map-in-order ((procedure (a #!rest) b) (list-of a) #!rest list) (list-of b))))
     156
     157(srfi-1#ninth (#(procedure #:clean #:enforce #:foldable) srfi-1#ninth (pair) *))
     158
     159(srfi-1#not-pair? (#(procedure #:clean #:foldable) srfi-1#not-pair? (*) boolean)
    160160           ((pair) (let ((#(tmp) #(1))) '#f))
    161161           (((not (or pair list))) (let ((#(tmp) #(1))) '#t)))
    162162
    163 (null-list? (#(procedure #:clean #:enforce #:foldable) null-list? (list) boolean)
     163(srfi-1#null-list? (#(procedure #:clean #:enforce #:foldable) srfi-1#null-list? (list) boolean)
    164164            ((pair) (let ((#(tmp) #(1))) '#f))
    165165            ((list) (let ((#(tmp) #(1))) '#f))
    166166            ((null) (let ((#(tmp) #(1))) '#t)))
    167167
    168 (pair-fold (#(procedure #:enforce) pair-fold (procedure * list #!rest list) *)) ;XXX do this
    169 (pair-fold-right (#(procedure #:enforce) pair-fold-right (procedure * list #!rest list) *)) ;XXX
    170 (pair-for-each (#(procedure #:enforce) pair-for-each ((procedure (#!rest) . *) list #!rest list) undefined)) ;XXX
    171 (partition (forall (a) (#(procedure #:enforce) partition ((procedure (a) *) (list-of a)) (list-of a) (list-of a))))
    172 (partition! (forall (a) (#(procedure #:enforce) partition! ((procedure (a) *) (list-of a)) (list-of a) (list-of a))))
    173 
    174 (proper-list? (#(procedure #:clean #:foldable) proper-list? (*) boolean)
     168(srfi-1#pair-fold (#(procedure #:enforce) srfi-1#pair-fold (procedure * list #!rest list) *)) ;XXX do this
     169(srfi-1#pair-fold-right (#(procedure #:enforce) srfi-1#pair-fold-right (procedure * list #!rest list) *)) ;XXX
     170(srfi-1#pair-for-each (#(procedure #:enforce) srfi-1#pair-for-each ((procedure (#!rest) . *) list #!rest list) undefined)) ;XXX
     171(srfi-1#partition (forall (a) (#(procedure #:enforce) srfi-1#partition ((procedure (a) *) (list-of a)) (list-of a) (list-of a))))
     172(srfi-1#partition! (forall (a) (#(procedure #:enforce) srfi-1#partition! ((procedure (a) *) (list-of a)) (list-of a) (list-of a))))
     173
     174(srfi-1#proper-list? (#(procedure #:clean #:foldable) proper-list? (*) boolean)
    175175              ((null) (let ((#(tmp) #(1))) '#t)))
    176176
    177 (reduce (#(procedure #:enforce) reduce ((procedure (* *) *) * list) *)) ;XXX
    178 (reduce-right (#(procedure #:enforce) reduce-right ((procedure (* *) *) * list) *)) ;XXX
    179 (remove (forall (a) (#(procedure #:enforce) remove ((procedure (a) *) (list-of a)) (list-of a))))
    180 (remove! (forall (a) (#(procedure #:enforce) remove! ((procedure (a) *) (list-of a)) (list-of a))))
    181 (reverse! (forall (a) (#(procedure #:enforce) reverse! ((list-of a)) (list-of a))))
    182 
    183 (second (forall (a) (#(procedure #:clean #:enforce #:foldable) second ((pair * (pair a *))) a))
     177(srfi-1#reduce (#(procedure #:enforce) srfi-1#reduce ((procedure (* *) *) * list) *)) ;XXX
     178(srfi-1#reduce-right (#(procedure #:enforce) srfi-1#reduce-right ((procedure (* *) *) * list) *)) ;XXX
     179(srfi-1#remove (forall (a) (#(procedure #:enforce) srfi-1#remove ((procedure (a) *) (list-of a)) (list-of a))))
     180(srfi-1#remove! (forall (a) (#(procedure #:enforce) srfi-1#remove! ((procedure (a) *) (list-of a)) (list-of a))))
     181(srfi-1#reverse! (forall (a) (#(procedure #:enforce) srfi-1#reverse! ((list-of a)) (list-of a))))
     182
     183(srfi-1#second (forall (a) (#(procedure #:clean #:enforce #:foldable) srfi-1#second ((pair * (pair a *))) a))
    184184        (((pair * (pair * *))) (##core#inline "C_u_i_car" (##core#inline "C_u_i_cdr" #(1)))))
    185185
    186 (seventh (#(procedure #:clean #:enforce #:foldable) seventh (pair) *))
    187 (sixth (#(procedure #:clean #:enforce #:foldable) sixth (pair) *))
    188 (span (forall (a) (#(procedure #:enforce) span ((procedure (a) *) (list-of a)) (list-of a) (list-of a))))
    189 (span! (forall (a) (#(procedure #:enforce) span! ((procedure (a) *) (list-of a)) (list-of a) (list-of a))))
    190 (split-at (forall (a) (#(procedure #:enforce) split-at ((list-of a) fixnum) (list-of a) (list-of a))))
    191 (split-at! (forall (a) (#(procedure #:enforce) split-at! ((list-of a) fixnum) (list-of a) (list-of a))))
    192 (take (forall (a) (#(procedure #:enforce) take ((list-of a) fixnum) (list-of a))))
    193 (take! (forall (a) (#(procedure #:enforce) take! ((list-of a) fixnum) (list-of a))))
    194 (take-right (forall (a) (#(procedure #:enforce) take-right ((list-of a) fixnum) (list-of a))))
    195 (take-while (forall (a) (#(procedure #:enforce) take-while ((procedure (a) *) (list-of a)) (list-of a))))
    196 (take-while! (forall (a) (#(procedure #:enforce) take-while! ((procedure (a) *) (list-of a)) (list-of a))))
    197 (tenth (#(procedure #:clean #:enforce #:foldable) tenth (pair) *))
    198 
    199 (third (forall (a) (#(procedure #:clean #:enforce #:foldable) third ((pair * (pair * (pair a *)))) a))
     186(srfi-1#seventh (#(procedure #:clean #:enforce #:foldable) srfi-1#seventh (pair) *))
     187(srfi-1#sixth (#(procedure #:clean #:enforce #:foldable) srfi-1#sixth (pair) *))
     188(srfi-1#span (forall (a) (#(procedure #:enforce) srfi-1#span ((procedure (a) *) (list-of a)) (list-of a) (list-of a))))
     189(srfi-1#span! (forall (a) (#(procedure #:enforce) srfi-1#span! ((procedure (a) *) (list-of a)) (list-of a) (list-of a))))
     190(srfi-1#split-at (forall (a) (#(procedure #:enforce) srfi-1#split-at ((list-of a) fixnum) (list-of a) (list-of a))))
     191(srfi-1#split-at! (forall (a) (#(procedure #:enforce) srfi-1#split-at! ((list-of a) fixnum) (list-of a) (list-of a))))
     192(srfi-1#take (forall (a) (#(procedure #:enforce) srfi-1#take ((list-of a) fixnum) (list-of a))))
     193(srfi-1#take! (forall (a) (#(procedure #:enforce) srfi-1#take! ((list-of a) fixnum) (list-of a))))
     194(srfi-1#take-right (forall (a) (#(procedure #:enforce) srfi-1#take-right ((list-of a) fixnum) (list-of a))))
     195(srfi-1#take-while (forall (a) (#(procedure #:enforce) srfi-1#take-while ((procedure (a) *) (list-of a)) (list-of a))))
     196(srfi-1#take-while! (forall (a) (#(procedure #:enforce) srfi-1#take-while! ((procedure (a) *) (list-of a)) (list-of a))))
     197(srfi-1#tenth (#(procedure #:clean #:enforce #:foldable) srfi-1#tenth (pair) *))
     198
     199(srfi-1#third (forall (a) (#(procedure #:clean #:enforce #:foldable) srfi-1#third ((pair * (pair * (pair a *)))) a))
    200200       (((pair * (pair * (pair * *))))
    201201        (##core#inline "C_u_i_car"
    202202                       (##core#inline "C_u_i_cdr" (##core#inline "C_u_i_cdr" #(1))))))
    203203
    204 (unfold (#(procedure #:enforce) unfold ((procedure (*) *) (procedure (*) *) (procedure (*) *) * #!optional (procedure (*) *)) *)) ;XXX
    205 (unfold-right (#(procedure #:enforce) unfold-right ((procedure (*) *) (procedure (*) *) (procedure (*) *) * #!optional (procedure (*) *)) *)) ;XXX
    206 (unzip1 (forall (a) (#(procedure #:clean #:enforce) unzip1 ((list-of (pair a *))) (list-of a))))
    207 (unzip2 (forall (a b) (#(procedure #:clean #:enforce) unzip2 ((list-of (pair a (pair b *)))) (list-of a) (list-of b))))
    208 
    209 (unzip3
    210  (forall (a b c) (#(procedure #:clean #:enforce) unzip3 ((list-of (pair a (pair b (pair c *))))) (list-of a) (list-of b) (list-of c))))
    211 
    212 (unzip4 (#(procedure #:clean #:enforce) unzip4 (list) list list list list)) ; yeah
    213 (unzip5 (#(procedure #:clean #:enforce) unzip5 (list) list list list list list)) ; yeah, too
    214 (xcons (forall (a b) (#(procedure #:pure) xcons (a b) (pair b a))))
    215 (zip (forall (a) (#(procedure #:clean #:enforce) zip ((list-of a) #!rest list) (list-of (pair a *)))))
     204(srfi-1#unfold (#(procedure #:enforce) srfi-1#unfold ((procedure (*) *) (procedure (*) *) (procedure (*) *) * #!optional (procedure (*) *)) *)) ;XXX
     205(srfi-1#unfold-right (#(procedure #:enforce) srfi-1#unfold-right ((procedure (*) *) (procedure (*) *) (procedure (*) *) * #!optional (procedure (*) *)) *)) ;XXX
     206(srfi-1#unzip1 (forall (a) (#(procedure #:clean #:enforce) srfi-1#unzip1 ((list-of (pair a *))) (list-of a))))
     207(srfi-1#unzip2 (forall (a b) (#(procedure #:clean #:enforce) srfi-1#unzip2 ((list-of (pair a (pair b *)))) (list-of a) (list-of b))))
     208
     209(srfi-1#unzip3
     210 (forall (a b c) (#(procedure #:clean #:enforce) srfi-1#unzip3 ((list-of (pair a (pair b (pair c *))))) (list-of a) (list-of b) (list-of c))))
     211
     212(srfi-1#unzip4 (#(procedure #:clean #:enforce) srfi-1#unzip4 (list) list list list list)) ; yeah
     213(srfi-1#unzip5 (#(procedure #:clean #:enforce) srfi-1#unzip5 (list) list list list list list)) ; yeah, too
     214(srfi-1#xcons (forall (a b) (#(procedure #:pure) srfi-1#xcons (a b) (pair b a))))
     215(srfi-1#zip (forall (a) (#(procedure #:clean #:enforce) srfi-1#zip ((list-of a) #!rest list) (list-of (pair a *)))))
Note: See TracChangeset for help on using the changeset viewer.