1. 25 Oct, 2021 2 commits
  2. 24 Oct, 2021 2 commits
    • Tim Bradshaw's avatar
      read-stream-content-into string: buffer elt type · 6ff6820c
      Tim Bradshaw authored
      The element type of the buffer should also be the element type of the
      stream, rather than character.
      This is a fix to the previous commit.
    • Tim Bradshaw's avatar
      read-stream-content-into-string element-type fix · 9c97e6f6
      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.
  3. 22 Jul, 2021 1 commit
  4. 15 Mar, 2021 2 commits
  5. 13 Mar, 2021 1 commit
  6. 21 Aug, 2020 2 commits
  7. 06 Jul, 2020 1 commit
  8. 17 Jun, 2020 1 commit
  9. 12 May, 2020 2 commits
  10. 31 Mar, 2020 3 commits
  11. 27 Mar, 2020 4 commits
  12. 25 Mar, 2020 3 commits
  13. 16 Mar, 2020 1 commit
  14. 05 Mar, 2020 1 commit
    • Andrea Richiardi's avatar
      Introduce line-up-first and line-up-last macros · 2e399427
      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 ->>.
  15. 04 Mar, 2020 7 commits
  16. 25 Jan, 2020 1 commit
  17. 10 Jan, 2020 1 commit
  18. 06 Dec, 2019 1 commit
    • Philipp Marek's avatar
      Merge branch 'master' into 'master' · 1224346a
      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 !17
  19. 27 Nov, 2019 1 commit
  20. 29 May, 2019 3 commits