Changeset 40354 in project


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

rm srfi-128 dep

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/semantic-version

    r40345 r40354  
    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
Note: See TracChangeset for help on using the changeset viewer.