Changeset 40345 in project


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

rel 0.0.3

File:
1 edited

Legend:

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

    r39962 r40345  
    1010A rather busy Semantic Versioning library.
    1111
    12 == Usage
     12=== Usage
    1313
    1414<enscript highlight="scheme">
     
    1616</enscript>
    1717
    18 === version-punctuation
     18=== Core
     19
     20==== Usage
     21
     22<enscript highlight="scheme">
     23(import (semantic-version core))
     24</enscript>
     25
     26==== version-punctuation
    1927
    2028<parameter>(version-punctuation [STR]) -> string</parameter>
     
    2533; STR : {{string}} ; punctuation set, default is {{"._- +;:,"}}.
    2634
    27 === version-tail-zero
    28 
    29 <parameter>(version-tail-zero [IGN?]) -> boolean</parameter>
    30 
    31 Returns whether trailing 0's are ignored during comparision.
    32 
    33 ; IGN? : {{boolean}} ; ignore flag, default is {{#f}}.
    34 
    35 === make-version
    36 
    37 <procedure>(make-version CNT ELM [CHR]) --> semantic-version</procedure>
     35==== make-version
     36
     37<procedure>(make-version CNT [ELM CHR]) --> semantic-version</procedure>
    3838
    3939Returns new version with CNT elements, ELM, and punctuation CHR.
    4040
    4141; CNT : {{integer}} ; element count.
    42 ; ELM : {{(or number string symbol)}} ; version element.
     42; ELM : {{(or number string symbol)}} ; version element, default {{0}}.
    4343; CHR : {{char}} ; version punctuation, default is {{(string-ref (version-punctuation) 0)}}.
    4444
    45 === version
     45==== check-version
     46==== error-version
     47
     48<procedure>(check-version LOC OBJ [NAM]) -> semantic-version</procedure>
     49<procedure>(error-version LOC OBJ [NAM])</procedure>
     50
     51Similar to ''check-errors'' procedures.
     52
     53==== version?
     54
     55<procedure>(version? OBJ) --> boolean</procedure>
     56
     57; OBJ : {{*}} ; object to test.
     58
     59==== version->list
     60
     61<procedure>(version->list VER) --> (list-of (or number string char))</procedure>
     62
     63Returns an "exploded" form, with version elements interleaved with punctuation
     64characeters.
     65
     66; VER : {{semantic-version}} ; version to list.
     67
     68==== list->version
     69
     70<procedure>(list->version LIS) --> semantic-version</procedure>
     71
     72Returns a version from an "exploded" form, see {{version->list}}.
     73
     74; LIS : {{(list-of (or number string symbol char))}} ; list of version components.
     75
     76==== string->version
     77
     78<procedure>(string->version STR) --> semantic-version</procedure>
     79
     80Return the parsed form of the STR. The source separator (punctuation) is
     81preserved, and restored by {{version->string}}.
     82
     83; STR : {{string}} ; string to convert.
     84
     85==== version->string
     86
     87<procedure>(version->string VER) --> string</procedure>
     88
     89Return the string form of the VER.
     90
     91; VER : {{semantic-version}} ; version to convert.
     92
     93=== Element
     94
     95==== Usage
     96
     97<enscript highlight="scheme">
     98(import (semantic-version element))
     99</enscript>
     100
     101==== version
    46102
    47103<procedure>(version ELM...) --> semantic-version</procedure>
     
    54110'''Note''' that the {{symbol}} printname is used internally.
    55111
    56 === check-version
    57 === error-version
    58 
    59 <procedure>(check-version LOC OBJ [NAM]) -> semantic-version</procedure>
    60 <procedure>(error-version LOC OBJ [NAM])</procedure>
    61 
    62 Similar to ''check-errors'' procedures.
    63 
    64 === version-copy
     112==== version-copy
    65113
    66114<procedure>(version-copy VER) --> semantic-version</procedure>
     
    70118; VER : {{semantic-version}} ; version to copy.
    71119
    72 === version?
    73 
    74 <procedure>(version? OBJ) --> boolean</procedure>
    75 
    76 ; OBJ : {{*}} ; object to test.
    77 
    78 === version-depth
     120==== version-depth
    79121
    80122<procedure>(version-depth VER) --> integer</procedure>
     
    84126; VER : {{semantic-version}} ; version to query.
    85127
    86 === version-elements
     128==== version-elements
    87129
    88130<procedure>(version-elements VER) --> (list-of (or number string))</procedure>
     
    92134; VER : {{semantic-version}} ; version to query.
    93135
    94 === version-separators
     136==== version-separators
    95137
    96138<procedure>(version-separators VER) --> (list-of char)</procedure>
     
    100142; VER : {{semantic-version}} ; version to query.
    101143
    102 === version->list
    103 
    104 <procedure>(version->list VER) --> (list-of (or number string char))</procedure>
    105 
    106 Returns an "exploded" form, with version elements interleaved with punctuation
    107 characeters.
    108 
    109 ; VER : {{semantic-version}} ; version to list.
    110 
    111 === list->version
    112 
    113 <procedure>(list->version LIS) --> semantic-version</procedure>
    114 
    115 Returns a version from an "exploded" form, see {{version->list}}.
    116 
    117 ; LIS : {{(list-of (or number string symbol char))}} ; list of version components.
    118 
    119 === version-compare
     144=== Compare
     145
     146==== Usage
     147
     148<enscript highlight="scheme">
     149(import (semantic-version compare))
     150</enscript>
     151
     152==== version-tail-zero
     153
     154<parameter>(version-tail-zero [IGN?]) -> boolean</parameter>
     155
     156Returns whether trailing 0's are ignored during comparision.
     157
     158; IGN? : {{boolean}} ; ignore flag, default is {{#f}}.
     159
     160==== version-compare
    120161
    121162<procedure>(version-compare VER1 VER2 [TAIL-ZERO?]) --> integer</procedure>
     
    132173Orders versions in the same manner as the ''chicken-install'' tool.
    133174
    134 === version<?
    135 === version=?
    136 === version>?
    137 === version<=?
    138 === version>=?
     175==== version<?
     176==== version=?
     177==== version>?
     178==== version<=?
     179==== version>=?
    139180
    140181<procedure>(version<? VER1 VER2 [TAIL-ZERO?]) --> boolean</procedure>
     
    146187See {{version-compare}}.
    147188
    148 === version-hash
     189==== version-hash
    149190
    150191<procedure>(version-hash VER [BND RND]) --> integer</procedure>
     
    156197; RND : {{integer}} ; randomization (salt), see SRFI 69.
    157198
    158 === version-comparator
     199==== version-comparator
    159200
    160201<procedure>(version-comparator) --> comparator</procedure>
     
    167208; {{comparator-ordering-predicate comparator}} : {{version<?}}
    168209
    169 === string->version
    170 
    171 <procedure>(string->version STR) --> semantic-version</procedure>
    172 
    173 Return the parsed form of the STR. The source separator (punctuation) is
    174 preserved, and restored by {{version->string}}.
    175 
    176 ; STR : {{string}} ; string to convert.
    177 
    178 === version->string
    179 
    180 <procedure>(version->string VER) --> string</procedure>
    181 
    182 Return the string form of the VER.
    183 
    184 ; VER : {{semantic-version}} ; version to convert.
    185 
    186 === version-depth+!
    187 
    188 <procedure>(version-depth+! VER CNT ELM [CHR]) -> semantic-version</procedure>
     210=== Operation
     211
     212==== Usage
     213
     214<enscript highlight="scheme">
     215(import (semantic-version operation))
     216</enscript>
     217
     218==== version-depth+!
     219
     220<procedure>(version-depth+! VER CNT [ELM CHR]) -> semantic-version</procedure>
    189221
    190222Returns VER with more "depth", as ELM, interspersed with CHR.
     
    192224; VER : {{semantic-version}} ; version to extend.
    193225; CNT : {{integer}} ; element count.
    194 ; ELM : {{(or number string symbol)}} ; version element.
     226; ELM : {{(or number string symbol)}} ; version element, default {{0}}.
    195227; CHR : {{char}} ; version punctuation, default is {{(string-ref (version-punctuation) 0)}}.
    196228
    197 === version-depth-!
     229==== version-depth-!
    198230
    199231<procedure>(version-depth-! VER CNT) -> semantic-version</procedure>
     
    205237; CNT : {{integer}} ; element count.
    206238
    207 === version-depth+
    208 
    209 <procedure>(version-depth+ VER CNT ELM [CHR]) --> semantic-version</procedure>
     239==== version-depth+
     240
     241<procedure>(version-depth+ VER CNT [ELM CHR]) --> semantic-version</procedure>
    210242
    211243Returns a copy of VER with more "depth", as ELM, interspersed with CHR.
     
    213245; VER : {{semantic-version}} ; version to extend.
    214246; CNT : {{integer}} ; element count.
    215 ; ELM : {{(or number string symbol)}} ; version element.
     247; ELM : {{(or number string symbol)}} ; version element, default {{0}}.
    216248; CHR : {{char}} ; version punctuation, default is {{(string-ref (version-punctuation) 0)}}.
    217249
    218 === version-depth-
     250==== version-depth-
    219251
    220252<procedure>(version-depth- VER CNT) --> semantic-version</procedure>
     
    226258; CNT : {{integer}} ; element count.
    227259
    228 === version-extend!
     260==== version-extend!
    229261
    230262<procedure>(version-extend! VER COMP...) -> semantic-version</procedure>
     
    236268; COMP : {{(list-of (or number string symbol char))}} ; version components.
    237269
    238 === version-extend
     270==== version-extend
    239271
    240272<procedure>(version-extend VER COMP...) --> semantic-version</procedure>
     
    246278; COMP : {{(list-of (or number string symbol char))}} ; version components.
    247279
    248 === version-inc!
     280==== version-inc!
    249281
    250282<procedure>(version-inc! VER [IDX AMT]) -> semantic-version</procedure>
     
    258290Currently only {{number}} elements may be targets.
    259291
    260 === version-dec!
     292==== version-dec!
    261293
    262294<procedure>(version-dec! VER [IDX AMT]) -> semantic-version</procedure>
     
    270302Currently only {{number}} elements may be targets.
    271303
    272 === version-inc
     304==== version-inc
    273305
    274306<procedure>(version-inc VER [IDX AMT]) --> semantic-version</procedure>
     
    282314Currently only {{number}} elements may be targets.
    283315
    284 === version-dec
     316==== version-dec
    285317
    286318<procedure>(version-dec VER [IDX AMT]) --> semantic-version</procedure>
     
    339371[[/users/kon-lovett|Kon Lovett]]
    340372
    341 == Repository
    342 
    343 This egg is hosted on the CHICKEN Subversion repository:
    344 
    345 [[https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/semantic-version|https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/semantic-version]]
    346 
    347 If you want to check out the source code repository of this egg and
    348 you are not familiar with Subversion, see [[/egg-svn-checkout|this page]].
    349373
    350374== Version history
    351375
     376; 0.0.3 : Separate modules.
    352377; 0.0.2 : Use record, {{make-version}} & {{semantic-version}} follow convention, rename accessors.
    353378; 0.0.1 : Release.
Note: See TracChangeset for help on using the changeset viewer.