- Oct 24, 2021
-
-
Tim Bradshaw authored
Default the element type of the string being created from the element type of the stream being read. This has two advantages: it will make things work for implementations which have a mode where the default string element type is a subtype of character, and it will also mean that if the stream's element type is a subtype of character you may get thinner strings.
-
- Jul 22, 2021
-
-
Philipp Marek authored
(From Doug) For context, I'm trying to eradicate all such problems (using undefined behavior sanitizer <https://sourceforge.net/p/sbcl/sbcl/ci/d931c7eb>) so that, among other things, I can figure out whether the non-zero- initialized DX array patch can ever be released.
-
- Mar 15, 2021
-
-
Philipp Marek authored
Add functions relating to multidimensional array indexing conversions See merge request alexandria/alexandria!20
-
Philipp Marek authored
Use linear-time SHUFFLE if supplied with many list items to shuffle Closes #21 See merge request alexandria/alexandria!21
-
- Mar 13, 2021
-
-
- Aug 21, 2020
-
-
Philipp Marek authored
A purely cosmetic issue.
-
Philipp Marek authored
-
- Jul 06, 2020
-
-
Philipp Marek authored
-
- Jun 17, 2020
-
-
Philipp Marek authored
Should fix #16.
-
- May 12, 2020
-
-
Anish Moorthy authored
-
Anish Moorthy authored
Similar functions are provided in CL, but they operate on *arrays* when all they really need are the *dimensions*. This sometimes proves an annoyance, and I thought alexandria was a good place to implement these.
-
- Mar 31, 2020
-
-
Philipp Marek authored
-
Philipp Marek authored
-
Philipp Marek authored
-
- Mar 27, 2020
-
-
Philipp Marek authored
-
Philipp Marek authored
That way the function definition order doesn't matter.
-
Philipp Marek authored
-
Philipp Marek authored
-
- Mar 25, 2020
-
-
Samuel Freilich authored
proper-list-length and related functions claim to signal an error if the input is not a proper list, and are careful to safely check that the cdr is a cons (with safe-endp). However, they call cdr on the input without checking that it is a list in the first place, resulting in memory-error when compiled with safety 0 instead of type-error as the tests expect.
-
Philipp Marek authored
-
Philipp Marek authored
-
- Mar 16, 2020
-
-
Philipp Marek authored
Symbols in :alexandria proper should be using that package name, after all.
-
- Mar 05, 2020
-
-
Andrea Richiardi authored
This patch introduces the line-up-first and line-up-last macros in control-flow. The macros have been popularized by Clojure and afterwards adopted in Emacs Lisp (see thread-first and thread-last in subr-x.el). This implementation is a port of the latter, where we use a common line-up-iter(ative) tail recursive function for computing the results. The choice of the full name was made in the spirit of the library, conservatively avoiding new syntax like -> or ->>.
-
- Mar 04, 2020
-
-
Philipp Marek authored
-
Philipp Marek authored
-
Philipp Marek authored
-
Philipp Marek authored
-
Philipp Marek authored
-
Philipp Marek authored
-
Philipp Marek authored
-
- Jan 25, 2020
-
-
Philipp Marek authored
-
- Jan 10, 2020
-
-
Philipp Marek authored
-
- Dec 06, 2019
-
-
Philipp Marek authored
Re-implement median function using the quick-select algorithm I wanted to submit a re-implementation of alexandria:median. Currently the function works by fully sorting the sequence, which has a complexity of O(n log n). This commit implements it as a special case of the quick select algorithm, which brings its complexity down to O(n). The new implementation is more complicated, though I think it's still simpler than some other algorithms in alexandria. Anyways, the performance gains are dramatic enough that I thought I'd at least submit the patch. I did some testing via the timing code below, and observed speedups of 5-10x even on sequences with just 100 elements. I could also provide the quick select algorithm as its own function if there's any interest, though it seems like this would have to go into the alexandria-2 branch. ``` ;; Speed-testing function (defun test-median-speed (mag) (labels ((get-vec-median (vec) (if (oddp (length vec)) (aref vec (ash (length vec) -1)) (* 1/2 (+ (aref vec (ash (length vec) -1)) (aref vec (1- (ash (length vec) -1)))))))) (let ((arr (loop for i from 0 upto (expt 10 mag) collect (random 1000000)))) (assert (= (time (get-vec-median (sort (alexandria:copy-sequence 'vector arr) #'<))) (time (alexandria:median arr))))))) ``` See merge request alexandria/alexandria!17
-
- Nov 27, 2019
-
-
Anish Moorthy authored
The previous implementation of alexandria:median sorted the entire sequence and chose/averaged the relevant elements, yielding an O(n log n) runtime. This commit implements a linear-time algorithm as a special case of the quick-select algorithm (https://en.wikipedia.org/wiki/Quickselect).
-
- May 29, 2019
-
-
By using an explicit PROGN we can interpolate straight into the LET. The PROGN shouldn't matter, as the WHEN interferes with DECLAREs anyway.
-
-
-
- May 28, 2019
-
-
Philipp Marek authored
Remove the orphaned export ORDINARY-LAMBDA-LIST-KEYWORDS Closes #8 See merge request alexandria/alexandria!16
-
- May 25, 2019
-
-
lovrolu authored
-
Philipp Marek authored
Improve docstrings for WITH-GENSYMS and ONCE-ONLY See merge request alexandria/alexandria!15
-