Remove procedure-fixed-arity?.
I don't really need this function. I think I wrote it just to see how I can count the arity of a procedure.
This commit is contained in:
parent
ec50395cb0
commit
b36d8adaa4
2 changed files with 3 additions and 20 deletions
|
@ -17,8 +17,8 @@
|
||||||
(contract-out
|
(contract-out
|
||||||
[tabulate (-> procedure? (listof generic-set?) (listof list?))]
|
[tabulate (-> procedure? (listof generic-set?) (listof list?))]
|
||||||
[tabulate* (-> (listof procedure?) (listof generic-set?) (listof list?))]
|
[tabulate* (-> (listof procedure?) (listof generic-set?) (listof list?))]
|
||||||
[tabulate/boolean (-> procedure-fixed-arity? (listof (listof boolean?)))]
|
[tabulate/boolean (-> procedure? (listof (listof boolean?)))]
|
||||||
[tabulate*/boolean (-> (non-empty-listof procedure-fixed-arity?) (listof (listof boolean?)))]
|
[tabulate*/boolean (-> (non-empty-listof procedure?) (listof (listof boolean?)))]
|
||||||
[tabulate/01 (-> procedure? (listof (listof (or/c 0 1))))]
|
[tabulate/01 (-> procedure? (listof (listof (or/c 0 1))))]
|
||||||
[tabulate*/01 (-> (non-empty-listof procedure?) (listof (listof (or/c 0 1))))]
|
[tabulate*/01 (-> (non-empty-listof procedure?) (listof (listof (or/c 0 1))))]
|
||||||
[table->function (-> (listof (*list/c any/c any/c)) procedure?)]
|
[table->function (-> (listof (*list/c any/c any/c)) procedure?)]
|
||||||
|
|
19
utils.rkt
19
utils.rkt
|
@ -470,8 +470,7 @@
|
||||||
|
|
||||||
(provide
|
(provide
|
||||||
;; Functions
|
;; Functions
|
||||||
(contract-out [procedure-fixed-arity? (-> procedure? boolean?)]
|
(contract-out [in-random (case-> (-> (stream/c (and/c real? inexact? (>/c 0) (</c 1))))
|
||||||
[in-random (case-> (-> (stream/c (and/c real? inexact? (>/c 0) (</c 1))))
|
|
||||||
(-> (integer-in 1 4294967087) (stream/c exact-nonnegative-integer?))
|
(-> (integer-in 1 4294967087) (stream/c exact-nonnegative-integer?))
|
||||||
(-> exact-integer? (integer-in 1 4294967087)
|
(-> exact-integer? (integer-in 1 4294967087)
|
||||||
(stream/c exact-nonnegative-integer?)))]
|
(stream/c exact-nonnegative-integer?)))]
|
||||||
|
@ -500,22 +499,6 @@
|
||||||
(cons/c key-contract val-contract)))
|
(cons/c key-contract val-contract)))
|
||||||
|
|
||||||
|
|
||||||
;;; =========
|
|
||||||
;;; Functions
|
|
||||||
;;; =========
|
|
||||||
|
|
||||||
;;; Returns #t if the function has fixed arity (i.e. if it does not
|
|
||||||
;;; take a variable number of arguments).
|
|
||||||
(define (procedure-fixed-arity? func)
|
|
||||||
(match (procedure-arity func)
|
|
||||||
[(arity-at-least _) #f] [arity #t]))
|
|
||||||
|
|
||||||
(module+ test
|
|
||||||
(test-case "procedure-fixed-arity?"
|
|
||||||
(check-true (procedure-fixed-arity? not))
|
|
||||||
(check-false (procedure-fixed-arity? +))))
|
|
||||||
|
|
||||||
|
|
||||||
;;; ==========
|
;;; ==========
|
||||||
;;; Randomness
|
;;; Randomness
|
||||||
;;; ==========
|
;;; ==========
|
||||||
|
|
Loading…
Reference in a new issue