From 0dac89a95af1bb099961cd62709fa4827fda5c70 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 12 Nov 2019 12:17:07 +0100 Subject: [PATCH] mes: Add hash-fold. * mes/module/mes/scm.mes (hash-fold): New function. --- mes/module/mes/scm.mes | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mes/module/mes/scm.mes b/mes/module/mes/scm.mes index 8a49fd26..9909c426 100644 --- a/mes/module/mes/scm.mes +++ b/mes/module/mes/scm.mes @@ -202,6 +202,9 @@ (define (hash-ref table key . rest) (core:hash-ref table key (and (pair? rest) (car rest)))) +(define (hash-fold proc init table) + (fold proc init (hash-map->list cons table))) + ;; Variable (define (make-undefined-variable)