mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
add bounds check
This commit is contained in:
parent
0da288d053
commit
9a48a110b8
2 changed files with 2 additions and 0 deletions
|
@ -22,6 +22,7 @@
|
|||
(and (procedure? f)
|
||||
(let ((vars (procedure-vars f)))
|
||||
(and (vector? vars)
|
||||
(> (vector-length vars) 1)
|
||||
(eq? procedure-tag-object
|
||||
(vector-ref vars (- (vector-length vars) 1)))))))
|
||||
(define (procedure-tag f)
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
(x)
|
||||
(* x x)))
|
||||
(test-assert (procedure/tag? f))
|
||||
(test-not (procedure/tag? (lambda (x) (* x x))))
|
||||
(test 9 (f 3))
|
||||
(test 42 (procedure-tag f))
|
||||
(test-not (eqv? f f*))
|
||||
|
|
Loading…
Add table
Reference in a new issue