From 80ef41eaa425f2e25f3f2c339416b804bafd0cb8 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Thu, 19 Mar 2020 23:17:23 +0100 Subject: [PATCH] networks,table->function: Store the function in a local binding. This avoids reconstructing the function from the table every time the lambda is called. --- networks.rkt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/networks.rkt b/networks.rkt index 43fd531..458196e 100644 --- a/networks.rkt +++ b/networks.rkt @@ -425,7 +425,8 @@ ;;; meaning that it may be sometimes more expensive to compute than by ;;; using an direct symbolic implementation. (define (table->function table) - (λ args ((table->function/list table) args))) + (let ([func (table->function/list table)]) + (λ args (func args)))) ;;; Like table->function, but the produced function accepts a single ;;; list of arguments instead of individual arguments.