fixed PR 9155
svn: r8368
This commit is contained in:
parent
7f09b3cf39
commit
ccceb3368a
|
@ -1286,7 +1286,7 @@ v4 todo:
|
||||||
(if (zero? dom-length) "no" dom-length)
|
(if (zero? dom-length) "no" dom-length)
|
||||||
(if (null? mandatory-kwds) "" " ordinary")
|
(if (null? mandatory-kwds) "" " ordinary")
|
||||||
(if (= 1 dom-length) "" "s")
|
(if (= 1 dom-length) "" "s")
|
||||||
(keyword-error-text mandatory-kwds)
|
(keyword-error-text mandatory-kwds optional-keywords)
|
||||||
val)))
|
val)))
|
||||||
|
|
||||||
(define (procedure-arity-includes?/optionals f base optionals)
|
(define (procedure-arity-includes?/optionals f base optionals)
|
||||||
|
@ -1302,16 +1302,29 @@ v4 todo:
|
||||||
(not (member kwd proc-mandatory))))
|
(not (member kwd proc-mandatory))))
|
||||||
optional-kwds))))
|
optional-kwds))))
|
||||||
|
|
||||||
(define (keyword-error-text mandatory-keywords)
|
(define (keyword-error-text mandatory-keywords optional-keywords)
|
||||||
|
(define (format-keywords-error type kwds)
|
||||||
(cond
|
(cond
|
||||||
[(null? mandatory-keywords) " without any keywords"]
|
[(null? kwds) ""]
|
||||||
[(null? (cdr mandatory-keywords))
|
[(null? (cdr kwds))
|
||||||
(format " and the mandatory keyword ~a" (car mandatory-keywords))]
|
(format "the ~a keyword ~a" type (car kwds))]
|
||||||
[else
|
[else
|
||||||
(format
|
(format
|
||||||
" and the mandatory keywords ~a~a"
|
"the ~a keywords ~a~a"
|
||||||
(car mandatory-keywords)
|
type
|
||||||
(apply string-append (map (λ (x) (format " ~a" x)) (cdr mandatory-keywords))))]))
|
(car kwds)
|
||||||
|
(apply string-append (map (λ (x) (format " ~a" x)) (cdr kwds))))]))
|
||||||
|
(cond
|
||||||
|
[(and (null? optional-keywords) (null? mandatory-keywords)) " without any keywords"]
|
||||||
|
[(null? optional-keywords)
|
||||||
|
(string-append " and " (format-keywords-error 'mandatory mandatory-keywords))]
|
||||||
|
[(null? mandatory-keywords)
|
||||||
|
(string-append " and " (format-keywords-error 'optional optional-keywords))]
|
||||||
|
[else
|
||||||
|
(string-append ", "
|
||||||
|
(format-keywords-error 'mandatory mandatory-keywords)
|
||||||
|
", and "
|
||||||
|
(format-keywords-error 'optional optional-keywords))]))
|
||||||
|
|
||||||
(define (check-procedure/more val mtd? dom-length mandatory-kwds optional-kwds src-info blame orig-str)
|
(define (check-procedure/more val mtd? dom-length mandatory-kwds optional-kwds src-info blame orig-str)
|
||||||
(unless (and (procedure? val)
|
(unless (and (procedure? val)
|
||||||
|
@ -1328,7 +1341,7 @@ v4 todo:
|
||||||
[(zero? dom-length) "no"]
|
[(zero? dom-length) "no"]
|
||||||
[else dom-length])
|
[else dom-length])
|
||||||
(if (= 1 dom-length) "" "s")
|
(if (= 1 dom-length) "" "s")
|
||||||
(keyword-error-text mandatory-kwds)
|
(keyword-error-text mandatory-kwds optional-kwds)
|
||||||
val)))
|
val)))
|
||||||
|
|
||||||
;; timing & size tests
|
;; timing & size tests
|
||||||
|
|
Loading…
Reference in New Issue
Block a user