Changeset 40352 in project


Ignore:
Timestamp:
08/21/21 02:35:07 (5 weeks ago)
Author:
Kon Lovett
Message:

rm srfi-128 dep (only make-comp used)

Location:
release/5/semantic-version/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • release/5/semantic-version/trunk/README.svnwiki

    r40351 r40352  
    197197; RND : {{integer}} ; randomization (salt), see SRFI 69.
    198198
    199 ==== version-comparator
    200 
    201 <procedure>(version-comparator) --> comparator</procedure>
    202 
    203 Returns a SRFI 128 {{comparator}} for the {{semantic-version}} type.
    204 
    205 ; {{comparator-hash-function}} : {{version-hash}}
    206 ; {{comparator-type-test-predicate}} : {{version?}}
    207 ; {{comparator-equality-predicate comparator}} : {{version=?}}
    208 ; {{comparator-ordering-predicate comparator}} : {{version<?}}
    209 
    210199=== Operation
    211200
     
    329318== Example
    330319<enscript highlight="scheme">
    331 (import (chicken base) (chicken file) (chicken pathname) (chicken sort)
    332         (srfi 1)
    333         semantic-version)
    334 
    335 (define (egg-repo-versions repo egg)
    336   (map! (o string->version pathname-strip-directory)
    337         (glob (make-pathname `(,repo ,egg "tags") "*"))) )
    338 
    339 (for-each (o print version->string) (sort (egg-repo-versions REPO "apropos") version<?))
     320(import
     321  (chicken base)
     322  (chicken file)
     323  (chicken pathname)
     324  (chicken sort)
     325  (srfi 1)
     326  semantic-version)
     327
     328(define (pathname->version pn)  (string->version (pathname-strip-directory pn)))
     329(define (repo-tags repo egg)    (glob (make-pathname `(,repo ,egg "tags") "*")))
     330
     331(define (egg-repo-versions repo egg) (map! pathname->version (repo-tags repo egg)))
     332
     333(for-each print (sort (egg-repo-versions REPO "apropos") version<?))
    340334;=> prints release versions in ascending order
    341335
     
    361355[[srfi-1]]
    362356[[srfi-69]]
    363 [[srfi-128]]
    364357[[utf8]]
    365358
  • release/5/semantic-version/trunk/semantic-version.compare.scm

    r40351 r40352  
    2222  version-hash
    2323  ;version*<? version*=? version*>? version*<=? version*>=?
    24   ;version*-hash
    25   version-comparator)
     24  #;version*-hash)
    2625
    2726(import scheme
     
    3231  (only (srfi 1) drop-while reverse!)
    3332  (only (srfi 69) equal?-hash)
    34   (only (srfi 128) make-comparator)
    3533  (semantic-version core))
    3634
     
    4947(: version>=?           (ver ver #!optional boolean --> boolean))
    5048(: version-hash         (ver #!rest --> integer))
    51 (: version-comparator   (--> (struct comparator)))
    5249
    5350;;
     
    115112  (equal?-hash (check-version 'version-hash* ver) rest) )
    116113
    117 (define (version-comparator)
    118   (make-comparator version? version=? version<? version-hash) )
    119 
    120114) ;module semantic-version.compare
  • release/5/semantic-version/trunk/semantic-version.egg

    r40351 r40352  
    77 (author "Kon Lovett")
    88 (license "BSD")
    9  (dependencies utf8 srfi-1 srfi-69 srfi-128)
     9 (dependencies utf8 srfi-1 srfi-69)
    1010 (test-dependencies test)
    1111 (components
  • release/5/semantic-version/trunk/tests/semantic-version-test.scm

    r39884 r40352  
    5454;;
    5555
     56(define (version-comparator)
     57  (make-comparator version? version=? version<? version-hash) )
     58
    5659(let ((cmptr (version-comparator)))
    5760  (test-assert (comparator-test-type cmptr (version "a" 2 "c")))
Note: See TracChangeset for help on using the changeset viewer.