diff options
author | Andy Wingo <wingo@pobox.com> | 2017-11-29 19:57:11 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2017-11-29 20:23:10 +0100 |
commit | 76d4608d7afb121ecb1e77a05ab14796ef10cd6a (patch) | |
tree | cfd0ae2a177e322d24273db285e262a66e1080f7 | |
parent | 5f59e2812db7108ef9302f7bd862325572751b17 (diff) | |
download | guile-76d4608d7afb121ecb1e77a05ab14796ef10cd6a.tar.gz |
Add nullary intmap and intset folders
* module/language/cps/intmap.scm (intmap-fold, intmap-fold-right):
* module/language/cps/intset.scm (intset-fold, intset-fold-right): Add
nullary folders.
-rw-r--r-- | module/language/cps/intmap.scm | 4 | ||||
-rw-r--r-- | module/language/cps/intset.scm | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/module/language/cps/intmap.scm b/module/language/cps/intmap.scm index 3a4f51776..a52e2ba32 100644 --- a/module/language/cps/intmap.scm +++ b/module/language/cps/intmap.scm @@ -511,6 +511,8 @@ already, and always calls the meet procedure." (define intmap-fold (case-lambda + ((f map) + ((make-intmap-folder #t) f map)) ((f map seed) ((make-intmap-folder #t seed) f map seed)) ((f map seed0 seed1) @@ -520,6 +522,8 @@ already, and always calls the meet procedure." (define intmap-fold-right (case-lambda + ((f map) + ((make-intmap-folder #f) f map)) ((f map seed) ((make-intmap-folder #f seed) f map seed)) ((f map seed0 seed1) diff --git a/module/language/cps/intset.scm b/module/language/cps/intset.scm index 09af0eaa3..7b2a66aaf 100644 --- a/module/language/cps/intset.scm +++ b/module/language/cps/intset.scm @@ -1,5 +1,5 @@ ;;; Functional name maps -;;; Copyright (C) 2014, 2015 Free Software Foundation, Inc. +;;; Copyright (C) 2014, 2015, 2017 Free Software Foundation, Inc. ;;; ;;; This library is free software: you can redistribute it and/or modify ;;; it under the terms of the GNU Lesser General Public License as @@ -464,6 +464,8 @@ (define intset-fold (case-lambda + ((f set) + ((make-intset-folder #t) f set)) ((f set seed) ((make-intset-folder #t seed) f set seed)) ((f set s0 s1) @@ -473,6 +475,8 @@ (define intset-fold-right (case-lambda + ((f set) + ((make-intset-folder #f) f set)) ((f set seed) ((make-intset-folder #f seed) f set seed)) ((f set s0 s1) |