Changeset 39935 in project


Ignore:
Timestamp:
04/09/21 21:54:44 (5 months ago)
Author:
Kon Lovett
Message:

add template module (version protocols - ohh), better err msg proc names

Location:
release/5/semantic-version/trunk
Files:
1 added
2 edited

Legend:

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

    r39884 r39935  
    1010 (test-dependencies test)
    1111 (components
     12  (extension semantic-version-protocol
     13    (types-file)
     14    (component-dependencies semantic-version)
     15    (csc-options "-O3" "-d1" "-strict-types" "-no-procedure-checks-for-toplevel-bindings" "-no-procedure-checks-for-usual-bindings") )
    1216  (extension semantic-version
    1317    (types-file)
  • release/5/semantic-version/trunk/semantic-version.scm

    r39884 r39935  
    1010;; - Better name for `version-depth+/-': `version-depth-extend/retract'?
    1111;;
    12 ;; - Version Protocols: major#.minor#[.point#][;fix#][-reason$]
     12;; - Version Protocols: major#.minor#[.point#][;fix#[-reason$]]
    1313;;   where <alpha>+ name, <separator> char, [] optional ([] & [...[ ]]), # number & $ string
    1414;;   w/ both otherwise
     15
     16#|
     17(define vp1 (string->version-protocol "major#.minor#[.point#][;fix[-reason$]]"))
     18(version-protocol->string vp1) ;=> "major#.minor#[.point#][;fix[-reason$]]"
     19
     20(version-protocol-template "major#" #\. minor# (#\. point#) (#\; "fix" (#\- reason$))) ;str|sym
     21
     22(version-protocol- vp1 )
     23|#
    1524
    1625(module semantic-version
     
    206215(define (ver-puncs? l) (every ver-punc? l))
    207216
    208 (define (vererrmsg msg nam)
     217(define (badargmsg msg #!optional nam)
    209218  (string-append (or (and nam (->string nam)) "bad argument") " - " msg) )
    210219
    211 (define (vererr loc obj msg nam)
    212   (error loc (vererrmsg msg nam) obj) )
     220(define (badargerr loc obj msg #!optional nam)
     221  (error loc (badargmsg msg nam) obj) )
    213222
    214223(define (check-parts loc x #!optional nam)
    215   (unless (ver-parts? x) (vererr loc x "invalid semantic-version parts" nam))
     224  (unless (ver-parts? x) (badargerr loc x "invalid semantic-version parts" nam))
    216225  x )
    217226
    218227(define (check-puncs loc x #!optional nam)
    219   (unless (ver-puncs? x) (vererr loc x "invalid semantic-version puncs" nam))
     228  (unless (ver-puncs? x) (badargerr loc x "invalid semantic-version puncs" nam))
    220229  x )
    221230
     
    262271
    263272(define (error-version loc x #!optional nam)
    264   (vererr loc x "invalid semantic-version" nam) )
     273  (badargerr loc x "invalid semantic-version" nam) )
    265274
    266275(define (check-version loc x #!optional nam)
Note: See TracChangeset for help on using the changeset viewer.