[lisp-interface-library-devel] fold-left vs fold-left*

Faré fahree at gmail.com
Sat Nov 3 02:57:07 UTC 2012


I am refactoring the LIL API to accommodate for sets, multisets,
queues and arrays as well as maps.
I find that the current fold-left, fold-right, for-each interfaces don't match,
because they assume two values (key value) associated with each entry,
whereas in the case of sets or arrays, only one value is warranted.
Other functions similarly could be shared if only one value were meant.

Therefore, I propose that fold-left, fold-right, for-each be one-value
functions,
and that for maps, a value is a key-value pair.
The generic name for the one value is entry, as in first-entry, etc.

If you are using any of for-each, fold-left, fold-right on maps, it
will soon change to
for-each*, fold-left*, fold-right*.

—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
A man is usually more careful of his money than he is of his principles.
                — Edgar Watson Howe




More information about the lisp-interface-library-devel mailing list