This commit should reduce the amount of iterations in concatenate to N
where N is the sum of the lengths of the input lists.
The previous implementation iterated from the beginning in each
concatenation because of `last-pair`.
This implementation is significantly faster in this extreme case:
(concatenate! `(,(iota 50000) ,@(map list (iota 500))))
>> Previous implementation:
real 0m0.671s
user 0m0.658s
sys 0m0.013s
>> This implementation:
real 0m0.175s
user 0m0.174s
sys 0m0.001s
The tests is done using `time`, which is not reliable at all, but using
`(trace last-pair)` shows accurately what happens with the iterations.
lib/srfi/231/base.scm:
1. Add argument checks for index-first, index-last, index-rotate, and index-swap.
lib/srfi/231/test.sld:
1. 1,$s/179/231/g (in vim notation)
2. Add tests for index-first, index-last, index-rotate, and index-swap.
3. Remove trailing spaces.
Makefile:
When installing chibi, make installation directory and install files for SRFI 231.
When uninstalling chibi, remove installation directory and files for SRFI 231.
lib/srfi/231/transforms.scm:
Move definition of vector-iota from here to ...
lib/srfi/231/base.scm:
Here.
lib/srfi/231/base.sld:
Export vector-iota to use in both base.scm and transforms.scm.
let-optionals can be provided by the (chibi optional) library or by
SRFI 227. Either dependency is non-trivial and makes it tricky to
incorporate (chibi sxml) into outside projects. Since (chibi sxml)
only makes trivial use of let-optionals, expand the macro by hand.
Two recent changes to Guile improved its R7RS support:
- 3.0.7 fixed a bug regarding cond-expand in a define-library form.
- 3.0.8 added support for R7RS' srfi library names, e.g. (srfi 69) instead of
(srfi srfi-69) used by Guile.
These changes open the possibility for using snow libraries in R7RS Guile
programs. This commit adds support for installing/removing snow libraries for
Guile.
If you set the macro-aux of a macro outside of (chibi syntax-case), it
would previously case `syntax` to think that it was a pattern variable
and try to substitute it, even if the macro-aux was being used for
something else.
This patch fixes that by wrapping pattern variable values in an extra
typed box and checking that it has the right type before deciding that
it’s actually a pattern variable.