Changeset 35572 in project for release/4/amb/trunk/amb-extras.scm


Ignore:
Timestamp:
06/09/18 23:23:56 (5 months ago)
Author:
kon
Message:

don't use typed-define here

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/amb/trunk/amb-extras.scm

    r35142 r35572  
    2424  (only data-structures sort! constantly)
    2525  (only (srfi 1) count every)
    26   amb
    27   typed-define)
     26  amb)
    2827
    2928;;;
     
    8382;;
    8483
    85 (define: (count-member (x *) (xs (list-of *)) . (opts (list procedure))) --> fixnum
     84(: count-member (* (list-of *) #!rest (list procedure) --> fixnum))
     85;
     86(define (count-member x xs . opts)
    8687  (let ((eql? (optional opts equal?)))
    8788    (count (cut eql? x <>) xs) ) )
    8889
    89 (define: (only-member? (x *) (xs (list-of *)) . (opts (list procedure))) --> boolean
     90(: only-member? (* (list-of *) #!rest (list procedure) --> boolean))
     91;
     92(define (only-member? x xs . opts)
    9093  (let ((eql? (optional opts equal?)))
    9194    (= 1 (count-member x xs eql?)) ) )
     
    9396;;
    9497
    95 (define: (list-constantly (ls list)) --> (list-of procedure)
     98(: list-constantly (list --> (list-of procedure)))
     99;
     100(define (list-constantly ls)
    96101  (map constantly ls) )
    97102
    98103;;
    99104
    100 (define: (distinct? (xs (list-of *)) . (opts (list procedure))) --> boolean
     105(: distinct? ((list-of *) #!rest (list procedure) --> boolean))
     106;
     107(define (distinct? xs . opts)
    101108  (let ((eql? (optional opts equal?)))
    102109    (every (cut only-member? <> xs eql?) xs) ) )
Note: See TracChangeset for help on using the changeset viewer.