diff -Nru cl-alexandria-0.0.20130703/debian/changelog cl-alexandria-20140826/debian/changelog --- cl-alexandria-0.0.20130703/debian/changelog 2013-07-03 11:41:34.000000000 +0000 +++ cl-alexandria-20140826/debian/changelog 2014-09-14 21:01:34.000000000 +0000 @@ -1,3 +1,21 @@ +cl-alexandria (20140826-1) unstable; urgency=medium + + * Quicklisp release update. + + -- Dimitri Fontaine Mon, 15 Sep 2014 01:01:34 +0400 + +cl-alexandria (20140713-2) unstable; urgency=medium + + * Fix package name in debian/rules, Closes: #758836 + + -- Dimitri Fontaine Fri, 22 Aug 2014 11:44:16 +0400 + +cl-alexandria (20140713-1) unstable; urgency=medium + + * Quicklisp release update. + + -- Dimitri Fontaine Tue, 19 Aug 2014 16:20:57 +0400 + cl-alexandria (0.0.20130703-1) unstable; urgency=low * New upstream diff -Nru cl-alexandria-0.0.20130703/debian/control cl-alexandria-20140826/debian/control --- cl-alexandria-0.0.20130703/debian/control 2012-12-14 23:25:00.000000000 +0000 +++ cl-alexandria-20140826/debian/control 2014-08-22 09:22:38.000000000 +0000 @@ -3,10 +3,11 @@ Priority: optional Maintainer: Debian Common Lisp Team Uploaders: Peter Van Eynde , - Christoph Egger + Christoph Egger , + Dimitri Fontaine Build-Depends: debhelper (>= 7) Build-Depends-Indep: dh-lisp -Standards-Version: 3.8.3 +Standards-Version: 3.9.5 Homepage: http://common-lisp.net/project/alexandria/ Vcs-Git: http://git.debian.org/git/pkg-common-lisp/cl-alexandria.git Vcs-Browser: http://git.debian.org/?p=pkg-common-lisp/cl-alexandria.git;a=summary @@ -14,7 +15,7 @@ Package: cl-alexandria Architecture: all Depends: ${misc:Depends}, ${shlibs:Depends} -Description: A collection of portable Common Lisp utilities +Description: Collection of portable Common Lisp utilities alexandria is a collection of utilities in the public domain for Common Lisp . It is a library but also a project that aims to reduce duplication of effort diff -Nru cl-alexandria-0.0.20130703/debian/rules cl-alexandria-20140826/debian/rules --- cl-alexandria-0.0.20130703/debian/rules 2012-12-14 23:13:31.000000000 +0000 +++ cl-alexandria-20140826/debian/rules 2014-08-22 07:41:37.000000000 +0000 @@ -1,50 +1,12 @@ #!/usr/bin/make -f -configure: configure-stamp -configure-stamp: - dh_testdir - # Add here commands to configure the package. - touch configure-stamp +pkg := alexandria +clc-source := usr/share/common-lisp/source +clc-systems := usr/share/common-lisp/systems +clc-files := $(clc-source)/$(pkg) -build: build-stamp -build-stamp: configure-stamp - dh_testdir - # Add here commands to compile the package. - touch build-stamp - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - # Add here commands to clean up after the build process. - dh_clean - -install: build - dh_testdir - dh_testroot - dh_prep - # Add here commands to install the package into debian/xmls. - dh_installdirs - dh_install - -# Build architecture-dependent files here. -binary-arch: - -# Build architecture-independent files here. -binary-indep: build install - dh_testdir - dh_testroot - dh_installdocs - dh_installchangelogs - dh_lisp - dh_compress - dh_fixperms - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure +%: + dh $@ --with lisp +override_dh_link: + dh_link $(clc-files)/$(pkg).asd $(clc-systems)/$(pkg).asd diff -Nru cl-alexandria-0.0.20130703/doc/.gitignore cl-alexandria-20140826/doc/.gitignore --- cl-alexandria-0.0.20130703/doc/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ cl-alexandria-20140826/doc/.gitignore 2014-07-30 12:47:56.000000000 +0000 @@ -0,0 +1,3 @@ +alexandria +include + diff -Nru cl-alexandria-0.0.20130703/.gitignore cl-alexandria-20140826/.gitignore --- cl-alexandria-0.0.20130703/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ cl-alexandria-20140826/.gitignore 2014-07-30 12:47:56.000000000 +0000 @@ -0,0 +1,4 @@ +*.fasl +*~ +\#* +*.patch diff -Nru cl-alexandria-0.0.20130703/lists.lisp cl-alexandria-20140826/lists.lisp --- cl-alexandria-0.0.20130703/lists.lisp 2012-12-14 23:18:52.000000000 +0000 +++ cl-alexandria-20140826/lists.lisp 2014-07-30 12:47:56.000000000 +0000 @@ -278,8 +278,20 @@ (defun delete-from-plist (plist &rest keys) "Just like REMOVE-FROM-PLIST, but this version may destructively modify the provided plist." - ;; FIXME: should not cons - (apply 'remove-from-plist plist keys)) + (declare (optimize speed)) + (loop with head = plist + with tail = nil ; a nil tail means an empty result so far + for (key . rest) on plist by #'cddr + do (assert rest () "Expected a proper plist, got ~S" plist) + (if (member key keys :test #'eq) + ;; skip over this pair + (let ((next (cdr rest))) + (if tail + (setf (cdr tail) next) + (setf head next))) + ;; keep this pair + (setf tail rest)) + finally (return head))) (define-modify-macro remove-from-plistf (&rest keys) remove-from-plist "Modify macro for REMOVE-FROM-PLIST.") diff -Nru cl-alexandria-0.0.20130703/numbers.lisp cl-alexandria-20140826/numbers.lisp --- cl-alexandria-0.0.20130703/numbers.lisp 2013-07-03 11:35:15.000000000 +0000 +++ cl-alexandria-20140826/numbers.lisp 2014-07-30 12:47:56.000000000 +0000 @@ -18,31 +18,35 @@ Sufficiently positive MIN or negative MAX will cause the algorithm used to take a very long time. If MIN is positive it should be close to zero, and similarly if MAX is negative it should be close to zero." - (labels ((gauss () - (loop - for x1 = (- (random 2.0d0) 1.0d0) - for x2 = (- (random 2.0d0) 1.0d0) - for w = (+ (expt x1 2) (expt x2 2)) - when (< w 1.0d0) - do (let ((v (sqrt (/ (* -2.0d0 (log w)) w)))) - (return (values (* x1 v) (* x2 v)))))) - (guard (x min max) - (unless (<= min x max) - (tagbody - :retry - (multiple-value-bind (x1 x2) (gauss) - (when (<= min x1 max) - (setf x x1) - (go :done)) - (when (<= min x2 max) - (setf x x2) - (go :done)) - (go :retry)) - :done)) - x)) - (multiple-value-bind (g1 g2) (gauss) - (values (guard g1 (or min g1) (or max g1)) - (guard g2 (or min g2) (or max g2)))))) + (macrolet + ((valid (x) + `(<= (or min ,x) ,x (or max ,x)) )) + (labels + ((gauss () + (loop + for x1 = (- (random 2.0d0) 1.0d0) + for x2 = (- (random 2.0d0) 1.0d0) + for w = (+ (expt x1 2) (expt x2 2)) + when (< w 1.0d0) + do (let ((v (sqrt (/ (* -2.0d0 (log w)) w)))) + (return (values (* x1 v) (* x2 v)))))) + (guard (x) + (unless (valid x) + (tagbody + :retry + (multiple-value-bind (x1 x2) (gauss) + (when (valid x1) + (setf x x1) + (go :done)) + (when (valid x2) + (setf x x2) + (go :done)) + (go :retry)) + :done)) + x)) + (multiple-value-bind + (g1 g2) (gauss) + (values (guard g1) (guard g2)))))) (declaim (inline iota)) (defun iota (n &key (start 0) (step 1)) @@ -189,7 +193,9 @@ ((< m j) f) (declare (type (integer 0 (#.most-positive-fixnum)) m) (type unsigned-byte f))))) - (bisect i j))) + (if (and (typep i 'fixnum) (typep j 'fixnum)) + (bisect i j) + (bisect-big i j)))) (declaim (inline factorial)) (defun %factorial (n) diff -Nru cl-alexandria-0.0.20130703/tests.lisp cl-alexandria-20140826/tests.lisp --- cl-alexandria-0.0.20130703/tests.lisp 2013-07-03 11:35:15.000000000 +0000 +++ cl-alexandria-20140826/tests.lisp 2014-07-30 12:47:56.000000000 +0000 @@ -869,6 +869,27 @@ nil t)) +(deftest delete-from-plist.1 + (let ((orig '(a 1 b 2 c 3 d 4 d 5))) + (list (delete-from-plist (copy-list orig) 'a 'c) + (delete-from-plist (copy-list orig) 'b 'd) + (delete-from-plist (copy-list orig) 'b) + (delete-from-plist (copy-list orig) 'a) + (delete-from-plist (copy-list orig) 'd 42 "zot") + (delete-from-plist (copy-list orig) 'a 'b 'c 'd) + (delete-from-plist (copy-list orig) 'a 'b 'c 'd 'x) + (equal orig (delete-from-plist orig)) + (eq orig (delete-from-plist orig)))) + ((b 2 d 4 d 5) + (a 1 c 3) + (a 1 c 3 d 4 d 5) + (b 2 c 3 d 4 d 5) + (a 1 b 2 c 3) + nil + nil + t + t)) + (deftest mappend.1 (mappend (compose 'list '*) '(1 2 3) '(1 2 3)) (1 4 9)) @@ -913,6 +934,19 @@ t t) +#+sbcl +(deftest gaussian-random.2 + (handler-case + (sb-ext:with-timeout 2 + (progn + (loop + :repeat 10000 + :do (gaussian-random 0 nil)) + 'done)) + (sb-ext:timeout () + 'timed-out)) + done) + (deftest iota.1 (iota 3) (0 1 2)) @@ -1429,7 +1463,7 @@ (deftest sequences.passing-improper-lists (macrolet ((signals-error-p (form) - `(handler-case + `(handler-case (progn ,form nil) (type-error (e) t))) @@ -1806,6 +1840,11 @@ (alexandria:binomial-coefficient 1239 139) 28794902202288970200771694600561826718847179309929858835480006683522184441358211423695124921058123706380656375919763349913245306834194782172712255592710204598527867804110129489943080460154) +;; Exercise bignum case (at least on x86). +(deftest binomial-coefficient.2 + (alexandria:binomial-coefficient 2000000000000 20) + 430998041177272843950422879590338454856322722740402365741730748431530623813012487773080486408378680853987520854296499536311275320016878730999689934464711239072435565454954447356845336730100919970769793030177499999999900000000000) + (deftest copy-stream.1 (let ((data "sdkfjhsakfh weior763495ewofhsdfk sdfadlkfjhsadf woif sdlkjfhslkdfh sdklfjh")) (values (equal data @@ -1887,11 +1926,12 @@ t) (deftest parse-ordinary-lambda-list.1 - (multiple-value-bind (req opt rest keys allowp aux keyp) - (parse-ordinary-lambda-list '(a b c &optional d &key)) - (and (equal '(a b c) req) - (equal '((d nil nil)) opt) - (equal '() keys) - (not allowp) - (not aux) - (eq t keyp)))) + (multiple-value-bind (req opt rest keys allowp aux keyp) + (parse-ordinary-lambda-list '(a b c &optional d &key)) + (and (equal '(a b c) req) + (equal '((d nil nil)) opt) + (equal '() keys) + (not allowp) + (not aux) + (eq t keyp))) + t) diff -Nru cl-alexandria-0.0.20130703/types.lisp cl-alexandria-20140826/types.lisp --- cl-alexandria-0.0.20130703/types.lisp 2012-12-14 23:18:52.000000000 +0000 +++ cl-alexandria-20140826/types.lisp 2014-07-30 12:47:56.000000000 +0000 @@ -1,14 +1,14 @@ (in-package :alexandria) -(deftype array-index (&optional (length array-dimension-limit)) +(deftype array-index (&optional (length (1- array-dimension-limit))) "Type designator for an index into array of LENGTH: an integer between -0 (inclusive) and LENGTH (exclusive). LENGTH defaults to +0 (inclusive) and LENGTH (exclusive). LENGTH defaults to one less than ARRAY-DIMENSION-LIMIT." `(integer 0 (,length))) -(deftype array-length (&optional (length array-dimension-limit)) +(deftype array-length (&optional (length (1- array-dimension-limit))) "Type designator for a dimension of an array of LENGTH: an integer between -0 (inclusive) and LENGTH (inclusive). LENGTH defaults to +0 (inclusive) and LENGTH (inclusive). LENGTH defaults to one less than ARRAY-DIMENSION-LIMIT." `(integer 0 ,length))