Changeset 36582 in project


Ignore:
Timestamp:
09/10/18 03:23:47 (2 months ago)
Author:
kon
Message:

restore lib-like error messages

Location:
release/5/check-errors/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/5/check-errors/trunk/check-errors.egg

    r36557 r36582  
    33
    44((synopsis "Argument checks & errors")
    5  (version "3.2.0")
     5 (version "3.1.2")
    66 (category misc)
    77 (license "BSD")
    88 (author "[[kon lovett]]")
    9  ;(dependencies)
    109 (test-dependencies test)
    1110 (components
  • release/5/check-errors/trunk/type-errors-basic.impl.scm

    r36569 r36582  
    55;;
    66;; - The type error message is built so as to look like those of the Chicken
    7 ;; "core". This constraint necessarily means some knowledge of the use of the
    8 ;; indefinite article. So any I18N effort will either have some logic needed or
    9 ;; a change to the Chicken "core" form.
     7;; "core".
    108;;
    119;; Maybe "... not an integer" -> "... integer required" &
    1210;; "... not a list" -> "... list required".
     11;;
     12;; Or "... not integer", ...
    1313
    1414(import scheme)
     
    2424;;
    2525
     26(define +english-vowels+ '(#\a #\e #\i #\o #\u))
     27(define +english-indefinite-articles+ '(an a))
     28
     29(define (vowel? ch)
     30  (->boolean (memq ch +english-vowels+)) )
     31
     32(define (appropriate-indefinite-article wrd)
     33  (let ((s (->string wrd)))
     34    (if (vowel? (string-ref s 0))
     35      (car +english-indefinite-articles+)
     36      (cadr +english-indefinite-articles+) ) ) )
     37
     38;;
     39
     40(define (localized-type-name-message typnam)
     41  ;FIXME en only
     42  (conc (appropriate-indefinite-article typnam) " " typnam) )
     43
     44;;
     45
    2646(define (make-bad-argument-message #!optional argnam)
    2747  (if (not argnam)
    2848    "bad argument"
    29     (conc "bad " #\` argnam #\' " argument") ) )
     49    (conc "bad `" argnam "' argument") ) )
    3050
    3151(define (make-type-name-message typnam)
    32   (->string typnam) )
     52  (localized-type-name-message (->string typnam)) )
    3353
    3454(define (make-error-type-message typnam #!optional argnam)
     
    6080    (warning wrn-msg) ) )
    6181
    62 (define (location-message loc)
    63   (conc #\( loc #\)) )
     82(define (location-message loc) (conc #\( loc #\)))
    6483
    6584;;
     
    111130    loc
    112131    maxargc argc #f) )
    113 
    114 ;;;
    115 
    116 #|
    117 ;;
    118 
    119 (define (localized-type-name-message typnam)
    120   ;FIXME en only
    121   (conc (appropriate-indefinite-article typnam) " " typnam) )
    122 
    123 ;;
    124 
    125 (define +english-vowels+ '(#\a #\e #\i #\o #\u))
    126 (define +english-indefinite-articles+ '(an a))
    127 
    128 (define (vowel? ch)
    129   (->boolean (memq ch +english-vowels+)) )
    130 
    131 (define (appropriate-indefinite-article wrd)
    132   (let ((s (->string wrd)))
    133     (if (vowel? (string-ref s 0))
    134       (car +english-indefinite-articles+)
    135       (cadr +english-indefinite-articles+) ) ) )
    136 |#
Note: See TracChangeset for help on using the changeset viewer.