reduced
as a better wrapper than calling the constructormake-reduced
manually.
- lib: The
median
reducer. - lib: The
reversed
source to iterate from the end of a vector.
concatenate
andflatten
now support vectors/strings.- Dropped dependency on
fset
within the main lib. - Licenses further relaxed to MPL.
- lib: The
find
reducer now accepts an optional:default
value for when nothing could be found in the transduction that matched the predicate. - fset:
transduce
implementations forset
,map
,seq
, andbag
. - fset: Reducers for
set
,map
,seq
, andbag
.
- lib: Conditions signalled somewhere in the transduction chain can now be caught per-item, with various restarts available to rehandle or skip the problematic item.
- jzon: plists now
write
as JS objects.
allp
andanyp
now yieldt
in the case of success, and not just "non-nil".
- New condition:
no-transduce-implementation
- If
transduce
is called on a type which has nodefmethod
for it, a custom condition is thrown with a more helpful error message. - The JSON support system/package is now named
transducers/jzon
to avoid compiler warnings.
Merry Christmas! I am jetlagged and writing this at 3:30 in the morning.
for-each
now yieldst
instead ofnil
, sincenil
can interact poorly with various control structures.
- An
uncons
transducer for splitting up a stream of cons cells. - A
from-csv
transducer to interpret a string stream as CSV data, splitting the values into a hash table. - An
into-csv
transducer that, given someheaders
, reverses the stream of hash tables back into strings of CSV. - A
snoc
reducer for reducing into a list without performing a final reverse. - A
hash-table
reducer for reducing into a Hash Table. Requires the transduction items to be cons cells, withcar
being the key andcdr
being the value. - A
plist
source for transducing over key-value pairs in a Property List. - New conditions:
empty-argument
empty-transduction
(see below)imbalanced-plist
non-positive-integer
- The library is now distributed under the terms of the LGPL to promote wider use.
- Transducing over a
hash-table
now yields the key-value pair as a cons cell, instead of just the value. The former behaviour is considered a bug. - The
seed
argument of thefold
reducer is now&optional
. When missing, the first value that makes it through the transduction will be used as the seed. If the transduction turns out to be empty, then the conditionempty-transduction
will be raised. - The
cons
reducer now usesnreverse
internally. You better not have been saving the intermediate results anywhere! segment
,window
, andstep
now offer restarts when a bad initial value is passed.- BREAKING:
average
,first
, andlast
no longer accept a fallback value. Instead, a condition is raised when the transduction was empty. This means that calls that used to look like:
(t:transduce #'t:pass (t:average 'whatever) '(1 2 3 4 5))
should now look like:
(t:transduce #'t:pass #'t:average '(1 2 3 4 5))
Likewise for first
and last
.
- List transduction fixed on Clasp. Clasp doesn't (seem to) support tail-call
optimization, but it does support
labels
-based TCO. This is also critical for thejzon
support.
max
andmin
have been deprecated in favour of callingfold
. The seed value forfold
is optional now, so:
(t:transduce #'t:pass (t:fold #'max) '(1 2 3)) ;; => 3
(t:transduce #'t:pass (t:fold #'max 10) '(1 2 3)) ;; => 10
(t:transduce #'t:pass (t:fold #'max 10) '()) ;; => 10
(t:transduce #'t:pass (t:fold #'max) '()) ;; => Condition!
- A
once
transducer to inject a single value into any point in the transduction chain. - A
for-each
reducer to ignore all results and just consume the stream for its side effects.
all
andany
should now be called asallp
andanyp
. The old names have been marked deprecated and you will be warned at compile time.
Initial version.