From b36d8adaa4250ce43aa331dce1d4a49e44973c53 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Sun, 13 Feb 2022 20:09:50 +0100 Subject: [PATCH] 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. --- functions.rkt | 4 ++-- utils.rkt | 19 +------------------ 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/functions.rkt b/functions.rkt index 067f4ee..da1bb8a 100644 --- a/functions.rkt +++ b/functions.rkt @@ -17,8 +17,8 @@ (contract-out [tabulate (-> procedure? (listof generic-set?) (listof list?))] [tabulate* (-> (listof procedure?) (listof generic-set?) (listof list?))] - [tabulate/boolean (-> procedure-fixed-arity? (listof (listof boolean?)))] - [tabulate*/boolean (-> (non-empty-listof procedure-fixed-arity?) (listof (listof boolean?)))] + [tabulate/boolean (-> procedure? (listof (listof boolean?)))] + [tabulate*/boolean (-> (non-empty-listof procedure?) (listof (listof boolean?)))] [tabulate/01 (-> 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?)] diff --git a/utils.rkt b/utils.rkt index 45ae6fa..351244b 100644 --- a/utils.rkt +++ b/utils.rkt @@ -470,8 +470,7 @@ (provide ;; Functions - (contract-out [procedure-fixed-arity? (-> procedure? boolean?)] - [in-random (case-> (-> (stream/c (and/c real? inexact? (>/c 0) ( (-> (stream/c (and/c real? inexact? (>/c 0) ( (integer-in 1 4294967087) (stream/c exact-nonnegative-integer?)) (-> exact-integer? (integer-in 1 4294967087) (stream/c exact-nonnegative-integer?)))] @@ -500,22 +499,6 @@ (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 ;;; ==========