[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
As an extension of my idea to change collection-fold-left to
collection-fold, how about removing all of the -lefts? Rationale:
1. It's the naming convention in SRFI-1.
2. The -left suffix doesn't make sense for "disordered" collections.
3. It's less to type.
Related to this, all of the "-right" methods should only be defined for
reversible collections. For example, get-right has the same problems as
collection-fold-right for an infinite sequence (e.g., circular lists,
fibonacci, etc.) Also, the -right methods don't seem to have any useful
semantics for non-reversible collections. For example, consider the
"grab-bag," which returns random values from the bag. For a container
like that, I would rather have "get-value" instead of "get-left." (A
reversible container would also have "get-value-right.")
Summary: There are too many collections for which "-left" and "-right"
don't make sense. I'd like to drop the "-left" from all method names and
to define the "-right" methods only for reversible collections.
I would also like to replace "*-foo-right" with something like
"*-reverse-foo" or "reverse-*-foo," but it wouldn't bother me too
terribly if you stuck with the -RIGHT convention! I mainly care about
dropping the -LEFTs.
Bradd W. Szonye