[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Adding more to boot-9
From: |
Ian Price |
Subject: |
Adding more to boot-9 |
Date: |
Tue, 04 Sep 2012 16:40:52 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
Alternative title: list lurker suggests bloat
I want to propose the addition of four procedures to guile's (ice-9
boot-9) aka "core guile": fold, fold-right, shuffle, and perhaps
shuffle!. I can provide patches myself, or one of you handsome people
can do it for me :)
First, fold and fold-right are probably the two most useful list
procedures that are _not_ included in guile's base[0]. Many times, I will
import srfi 1 just for these. I imagine many people are in a similar
boat. I don't imagine transplanting these will be too
difficult. Alternatively, we could settle for simpler variants that only
allowed one list, and require the inclusion of srfi 1 for the more
general versions.
shuffle and shuffle! are two procedures that are conspicuously absent
from anywhere guile, and that I have probably reinvented every two
months or so. I'd suggest a traditional knuth shuffle, and copying for
the nondestructive version, though Riastradh has a selection of
shuffles[1] we could use. Oleg Kiselyov also suggests a purely
functional implementation[2].
Feedback and flames welcome
0. Incidentally, char-set-unfold!, char-set-unfold, char-set-fold,
string-unfold-right, string-unfold, string-fold-right, string-fold and
hash-fold _are_ in the base, and this is supposed to be list processing
language.</flamebait>
1. http://mumble.net/~campbell/scheme/shuffle.scm
2. http://okmij.org/ftp/Haskell/perfect-shuffle.txt
--
Ian Price -- shift-reset.com
"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"
- Adding more to boot-9,
Ian Price <=