networks,table->function: Store the function in a local binding.
This avoids reconstructing the function from the table every time the lambda is called.
This commit is contained in:
parent
9bcb5681ce
commit
80ef41eaa4
1 changed files with 2 additions and 1 deletions
|
@ -425,7 +425,8 @@
|
||||||
;;; meaning that it may be sometimes more expensive to compute than by
|
;;; meaning that it may be sometimes more expensive to compute than by
|
||||||
;;; using an direct symbolic implementation.
|
;;; using an direct symbolic implementation.
|
||||||
(define (table->function table)
|
(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
|
;;; Like table->function, but the produced function accepts a single
|
||||||
;;; list of arguments instead of individual arguments.
|
;;; list of arguments instead of individual arguments.
|
||||||
|
|
Loading…
Reference in a new issue