Commit 9df22830 authored by Pascal J. Bourguignon's avatar Pascal J. Bourguignon

Corrections to satisfy sbcl.

parent c6223715
......@@ -2,5 +2,4 @@
*\!*.asd
*.fasl
*.sse2f
*.o
......@@ -79,6 +79,9 @@ show-variables::
MM=$(MAKE) $(MFLAGS) PREFIX=$(PREFIX)
clean::
find . \( -name \*.fasl -o -name \*.o \) -exec rm {} \;
help::
@printf $(HELP_FMT) 'clean' 'Clean in each submodule directory.'
clean::
......
......@@ -215,7 +215,7 @@ RETURN: A new list of name and aliases, with the ALIASES added, if
#+sbcl
(etypecase sb-impl::*external-formats*
(hash-table (let ((result '()))
(maphash (lambda (name encoding) (pushnew encoding result))
(maphash (lambda (name encoding) (declare (ignore name)) (pushnew encoding result))
sb-impl::*external-formats*)
(mapcar (lambda (encoding)
(mapcar (function string-upcase)
......
......@@ -882,6 +882,7 @@ It has no effect when some key has already been garbage-collected.")
(weak :key)
(initial-contents nil)
&allow-other-keys)
(declare (ignorable test testp size rehash-size rehash-threshold))
(check-type weak (member :key :value :key-and-value :key-or-value))
(call-next-method)
(setf (wht-buckets self) (make-array size :initial-element nil))
......@@ -969,7 +970,7 @@ It has no effect when some key has already been garbage-collected.")
#-(and (or ccl clisp) (not debug-weak))
(defmethod %gethash (key (self weak-hash-table) &optional default)
(declare (ignore default))
(declare (ignorable default))
(let* ((h (mod (%sxhash key) (length (wht-buckets self))))
(bucket (aref (wht-buckets self) h)))
(cond
......@@ -996,6 +997,7 @@ It has no effect when some key has already been garbage-collected.")
(defmethod (setf %gethash) (value key (self weak-hash-table) &optional default)
;; Should check when the new count goes above a threshold and increase
;; hash size.
(declare (ignore default))
(let* ((h (mod (%sxhash key) (length (wht-buckets self))))
(bucket (aref (wht-buckets self) h)))
(cond
......
......@@ -46,7 +46,7 @@ specifications, like GRAY or other portability libraries.
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.3.4"
:version "1.3.5"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Autumn 2010")
((#:albert #:output-dir) . "/tmp/documentation/com.informatimago.clext/")
......@@ -60,7 +60,7 @@ specifications, like GRAY or other portability libraries.
:components ((:file "character-sets")
#+(or allegro ccl clisp sbcl cmu)
(:file "closer-weak"))
:in-order-to ((test-op (test-op "com.informatimago.clext.test")
#+adsf3 :in-order-to #+adsf3 ((test-op (test-op "com.informatimago.clext.test")
(test-op "com.informatimago.clext.association.test"))))
......
......@@ -45,7 +45,7 @@ This system would use CLOSER-MOP, which is not available on MOCL.
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.0.2"
:version "1.0.3"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Autumn 2010")
((#:albert #:output-dir) . "/tmp/documentation/com.informatimago.clext/")
......@@ -71,7 +71,7 @@ CLOS associations. It uses CLOSER-MOP.
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.0.2"
:version "1.0.3"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Autumn 2010")
((#:albert #:output-dir) . "/tmp/documentation/com.informatimago.clext/")
......@@ -82,7 +82,7 @@ CLOS associations. It uses CLOSER-MOP.
#+asdf-unicode :encoding #+asdf-unicode :utf-8
:depends-on ("closer-mop")
:components ((:file "association"))
:in-order-to ((test-op (test-op "com.informatimago.clext.association.test"))))
#+adsf3 :in-order-to #+adsf3 ((test-op (test-op "com.informatimago.clext.association.test"))))
;;;; THE END ;;;;
......
......@@ -45,7 +45,7 @@ to define CLOS associations. It uses CLOSER-MOP.
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.0.2"
:version "1.0.3"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Autumn 2010")
((#:albert #:output-dir) . "/tmp/documentation/com.informatimago.clext/")
......
......@@ -45,7 +45,7 @@
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.0.2"
:version "1.0.3"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Winter 2015")
((#:albert #:output-dir)
......@@ -62,7 +62,7 @@
(operation system)
(declare (ignore operation system))
(let ((*package* (find-package "COM.INFORMATIMAGO.CLEXT.CLOSER-WEAK.TEST")))
(uiop/package:symbol-call "COM.INFORMATIMAGO.CLEXT.CLOSER-WEAK.TEST"
(uiop:symbol-call "COM.INFORMATIMAGO.CLEXT.CLOSER-WEAK.TEST"
"TEST/ALL"))))
;;;; THE END ;;;;
......@@ -35,10 +35,11 @@
(asdf:defsystem "com.informatimago.clext.run-program"
:description "An portable run-program function."
:author "Pascal J. Bourguignon"
:version "1.0.2"
:version "1.0.4"
:license "AGPL3"
:depends-on ("com.informatimago.common-lisp.cesarum")
:components ((:file "run-program"))
:in-order-to ((asdf:test-op (asdf:test-op "com.informatimago.clext.run-program.test"))))
#+asdf-unicode :encoding #+asdf-unicode :utf-8
#+adsf3 :in-order-to #+adsf3 ((asdf:test-op (asdf:test-op "com.informatimago.clext.run-program.test"))))
;;;; THE END ;;;;
......@@ -45,7 +45,7 @@
:maintainer "Pascal J. Bourguignon"
:licence "AGPL3"
;; component attributes:
:version "1.0.2"
:version "1.0.3"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Winter 2015")
((#:albert #:output-dir)
......@@ -63,6 +63,6 @@
(declare (ignore operation system))
(dolist (p '( "COM.INFORMATIMAGO.CLEXT.RUN-PROGRAM.TEST"))
(let ((*package* (find-package p)))
(uiop/package:symbol-call p "TEST/ALL")))))
(uiop:symbol-call p "TEST/ALL")))))
;;;; THE END ;;;;
......@@ -150,7 +150,7 @@
#+(or abcl cmu clozure sbcl)
(defun process-pid (process)
#+abcl (declare (ignore process))
#+abcl -1 ; no process-pid in abcl
#+abcl -1 ; no process-pid in abcl
#+(or cmu sbcl) (process-pid (process-process process))
#+clozure (ccl::external-process-pid (process-process process)))
......
......@@ -42,7 +42,7 @@
:author "Pascal J. Bourguignon <pjb@informatimago.com>"
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:license "AGPL3"
:version "1.2.4"
:version "1.2.5"
#+asdf-unicode :encoding #+asdf-unicode :utf-8
:depends-on ()
:components ())
......@@ -61,7 +61,7 @@ should be made into implementation independant packages).
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.2.4"
:version "1.2.5"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Spring 2014")
((#:albert #:output-dir) . "/tmp/documentation/com.informatimago.clmisc/")
......@@ -78,7 +78,7 @@ should be made into implementation independant packages).
(:file "fifo-stream")
(:file "iotask")
(:file "rfc1413" :depends-on ("iotask"))
;; :shared-object is not known of asdf, but is defined by clg-tools
;; :shared-object is not known of asdf, but is defined by clg-tools...
;; (:shared-object "libraw-memory"
;; :components ((:c-source-file "raw-memory-lib"))
;; :depends-on ())
......@@ -90,7 +90,7 @@ should be made into implementation independant packages).
#+linux (:file "shell")
#+linux (:file "xterm" :depends-on ("susv3"))
#+linux (:file "make-volumes" :depends-on ("susv3")))
:in-order-to ((asdf:test-op (asdf:test-op "com.informatimago.clisp.test"))))
#+adsf3 :in-order-to #+adsf3 ((asdf:test-op (asdf:test-op "com.informatimago.clisp.test"))))
(eval-when (:compile-toplevel :load-toplevel :execute)
......
......@@ -47,7 +47,7 @@
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.0.2"
:version "1.0.3"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Winter 2015")
((#:albert #:output-dir)
......@@ -70,7 +70,7 @@
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.0.2"
:version "1.0.3"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Winter 2015")
((#:albert #:output-dir)
......@@ -87,6 +87,6 @@
(declare (ignore operation system))
(dolist (p '("COM.INFORMATIMAGO.CLISP.STRING.TEST"))
(let ((*package* (find-package p)))
(uiop/package:symbol-call p "TEST/ALL")))))
(uiop:symbol-call p "TEST/ALL")))))
;;;; THE END ;;;;
......@@ -47,7 +47,7 @@ a format similar to what is used by LISTSERV.
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.2.3"
:version "1.2.4"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Autumn 2010")
((#:albert #:output-dir) . "/tmp/documentation/com.informatimago.clmisc/")
......@@ -58,7 +58,7 @@ a format similar to what is used by LISTSERV.
#+asdf-unicode :encoding #+asdf-unicode :utf-8
:depends-on ()
:components ((:file "resource-utilization"))
:in-order-to ((asdf:test-op (asdf:test-op "com.informatimago.clmisc.test"))))
#+adsf3 :in-order-to #+adsf3 ((asdf:test-op (asdf:test-op "com.informatimago.clmisc.test"))))
;;;; THE END ;;;;
......
......@@ -45,7 +45,7 @@
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.0.2"
:version "1.0.3"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Winter 2015")
((#:albert #:output-dir)
......@@ -62,7 +62,7 @@
(operation system)
(declare (ignore operation system))
(let ((*package* (find-package "COM.INFORMATIMAGO.CLMISC.RESOURCE-UTILIZATION.TEST")))
(uiop/package:symbol-call "COM.INFORMATIMAGO.CLMISC.RESOURCE-UTILIZATION.TEST"
(uiop:symbol-call "COM.INFORMATIMAGO.CLMISC.RESOURCE-UTILIZATION.TEST"
"TEST/ALL"))))
;;;; THE END ;;;;
......@@ -41,7 +41,7 @@
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.0.2"
:version "1.0.3"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Summer 2015")
((#:albert #:output-dir) . "/tmp/documentation/com.informatimago/")
......@@ -67,7 +67,7 @@
"com.informatimago.clisp" ; empty shell on non-clisp linux
)
:components ()
:in-order-to ((asdf:test-op (asdf:test-op "com.informatimago.test"))))
#+adsf3 :in-order-to #+adsf3 ((asdf:test-op (asdf:test-op "com.informatimago.test"))))
(defun test-all-com.informatimago ()
......
......@@ -45,7 +45,7 @@
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.0.2"
:version "1.0.3"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Winter 2015")
((#:albert #:output-dir)
......@@ -72,7 +72,7 @@
"com.informatimago.clisp.test" ; empty shell on non-clisp linux
)
:components ()
:in-order-to ((asdf:test-op
#+adsf3 :in-order-to #+adsf3 ((asdf:test-op
(asdf:test-op "com.informatimago.common-lisp.test")
(asdf:test-op "com.informatimago.clext.test")
(asdf:test-op "com.informatimago.clmisc.test")
......
This diff is collapsed.
......@@ -36,6 +36,9 @@
(:use "COMMON-LISP"
"COM.INFORMATIMAGO.COMMON-LISP.CESARUM.SIMPLE-TEST"
"COM.INFORMATIMAGO.COMMON-LISP.APPLE-FILE.APPLE-FILE")
(:import-from "COM.INFORMATIMAGO.COMMON-LISP.APPLE-FILE.APPLE-FILE"
"APPLE-FILE-FORK-PATHNAME"
"TREE-STRUCTURE-AND-LEAF-DIFFERENCE")
(:export "TEST/ALL"))
(in-package "COM.INFORMATIMAGO.COMMON-LISP.APPLE-FILE.APPLE-FILE.TEST")
......
......@@ -44,7 +44,7 @@ Read Apple-Single and Apple-Double file formats.
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.0.2"
:version "1.0.3"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Spring 2013")
((#:albert #:output-dir) . "/tmp/documentation/com.informatimago.common-lisp.apple-file/")
......@@ -55,6 +55,6 @@ Read Apple-Single and Apple-Double file formats.
#+asdf-unicode :encoding #+asdf-unicode :utf-8
:depends-on ("com.informatimago.common-lisp.cesarum")
:components ((:file "apple-file" :depends-on ()))
:in-order-to ((asdf:test-op (asdf:test-op "com.informatimago.common-lisp.apple-file.test"))))
#+adsf3 :in-order-to #+adsf3 ((asdf:test-op (asdf:test-op "com.informatimago.common-lisp.apple-file.test"))))
;;;; THE END ;;;;
......@@ -45,7 +45,7 @@
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.0.2"
:version "1.0.3"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Winter 2015")
((#:albert #:output-dir)
......@@ -63,6 +63,6 @@
(declare (ignore operation system))
(dolist (p '("COM.INFORMATIMAGO.COMMON-LISP.APPLE-FILE.APPLE-FILE.TEST"))
(let ((*package* (find-package p)))
(uiop/package:symbol-call p "TEST/ALL")))))
(uiop:symbol-call p "TEST/ALL")))))
;;;; THE END ;;;;
......@@ -41,7 +41,7 @@
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.2.3"
:version "1.2.4"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Autumn 2010")
((#:albert #:output-dir) . "/tmp/documentation/com.informatimago.common-lisp.arithmetic/")
......@@ -53,6 +53,6 @@
:depends-on ("com.informatimago.common-lisp.cesarum")
:components ((:file "primes" :depends-on ())
(:file "p127n2" :depends-on ()))
:in-order-to ((asdf:test-op (asdf:test-op "com.informatimago.common-lisp.arithmetic.test"))))
#+adsf3 :in-order-to #+adsf3 ((asdf:test-op (asdf:test-op "com.informatimago.common-lisp.arithmetic.test"))))
;;;; THE END ;;;;
......@@ -45,7 +45,7 @@
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.0.2"
:version "1.0.3"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Winter 2015")
((#:albert #:output-dir)
......@@ -62,7 +62,7 @@
(operation system)
(declare (ignore operation system))
;; (let ((*package* (find-package "TESTED-PACKAGE")))
;; (uiop/package:symbol-call "TESTED-PACKAGE"
;; (uiop:symbol-call "TESTED-PACKAGE"
;; "TEST/ALL"))
))
......
......@@ -40,7 +40,7 @@
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.2.3"
:version "1.2.4"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Autumn 2010")
((#:albert #:output-dir) . "/tmp/documentation/com.informatimago.common-lisp.bank/")
......@@ -52,6 +52,6 @@
:depends-on ("com.informatimago.common-lisp.cesarum")
:components ((:file "iban" :depends-on ())
(:file "rib" :depends-on ("iban")))
:in-order-to ((asdf:test-op (asdf:test-op "com.informatimago.common-lisp.bank.test"))))
#+adsf3 :in-order-to #+adsf3 ((asdf:test-op (asdf:test-op "com.informatimago.common-lisp.bank.test"))))
;;;; THE END ;;;;
......@@ -45,7 +45,7 @@
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.0.2"
:version "1.0.3"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Winter 2015")
((#:albert #:output-dir)
......@@ -62,7 +62,7 @@
(operation system)
(declare (ignore operation system))
;; (let ((*package* (find-package "TESTED-PACKAGE")))
;; (uiop/package:symbol-call "TESTED-PACKAGE"
;; (uiop:symbol-call "TESTED-PACKAGE"
;; "TEST/ALL"))
))
......
......@@ -252,24 +252,25 @@ RETURN: ∃i∈[0,SIZE1-1], REL(i,i)
"
RETURN: Whether the relation REL is cyclic.
"
(let ((with-pred (com.informatimago.common-lisp.cesarum.bset:make-bset (brelation-size-1 rel)))
(let ((with-pred (com.informatimago.common-lisp.cesarum.bset:make-bset (brelation-size-1 rel)))
(without-pred (com.informatimago.common-lisp.cesarum.bset:make-bset (brelation-size-1 rel)))
(pred-count (make-array (list (1+ (brelation-size-1 rel)))
:element-type '(integer 0)
:initial-element 0)))
(pred-count (make-array (list (1+ (brelation-size-1 rel)))
:element-type '(integer 0)
:initial-element 0)))
(for (i 0 (brelation-size-1 rel))
(com.informatimago.common-lisp.cesarum.bset:for-all-do (adjref rel i)
(lambda (e) (incf (aref pred-count e)))))
(com.informatimago.common-lisp.cesarum.bset:for-all-do (adjref rel i)
(lambda (e) (incf (aref pred-count e)))))
(for (i 0 (brelation-size-1 rel))
(when (= 0 (aref pred-count i)) (com.informatimago.common-lisp.cesarum.bset:include without-pred i)))
(when (= 0 (aref pred-count i))
(com.informatimago.common-lisp.cesarum.bset:include without-pred i)))
(com.informatimago.common-lisp.cesarum.bset:complement with-pred)
(until (com.informatimago.common-lisp.cesarum.bset:is-empty without-pred)
(let ((i (com.informatimago.common-lisp.cesarum.bset:extract without-pred)))
(com.informatimago.common-lisp.cesarum.bset:exclude with-pred i)
(com.informatimago.common-lisp.cesarum.bset:for-all-do (adjref rel i)
(lambda (e) (decf (aref pred-count e))
(when (= 0 (aref pred-count e))
(com.informatimago.common-lisp.cesarum.bset:include without-pred e))))))
(lambda (e) (decf (aref pred-count e))
(when (= 0 (aref pred-count e))
(com.informatimago.common-lisp.cesarum.bset:include without-pred e))))))
(not (com.informatimago.common-lisp.cesarum.bset:is-empty with-pred))))
......
......@@ -178,7 +178,7 @@ DO: If the implementation has the semi standard character
*standard-characters*))))
(defun has-ascii-code-p ()
"Whether it looks ASCII is implemented by char-code and code-char."
"Whether it looks like ASCII is implemented by char-code and code-char."
(let ((codes (cons 127 (loop :for code :from 0 :to 31 :collect code))))
(and (standard-character-is-ascii-coded-p)
(ignore-errors
......@@ -186,15 +186,16 @@ DO: If the implementation has the semi standard character
codes))
(= 33 (length (delete-duplicates (mapcar (function code-char) codes)
:test (function char=))))
#+has-rubout (= 127 (char-code #\rubout))
#+has-page (= 12 (char-code #\page))
#+has-tab (= 9 (char-code #\tab))
#+has-bell (= 7 (char-code #\bell))
#+has-backspace (= 8 (char-code #\backspace))
#+has-return (= 13 (char-code #\return))
#+has-tab (= 9 (char-code #\tab))
#+has-linefeed (= 10 (char-code #\linefeed))
#+has-vt (= 11 (char-code #\vt))
#+has-page (= 12 (char-code #\page))
#+has-return (= 13 (char-code #\return))
#+has-escape (= 27 (char-code #\escape))
#+has-bell (= 7 (char-code #\bell))
#+has-vt (= 11 (char-code #\vt)))))
#+has-rubout (= 127 (char-code #\rubout)))))
#-mocl
(progn
(when (has-ascii-code-p)
......
......@@ -62,7 +62,7 @@ all written in 100% conforming Common Lisp.
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.3.5"
:version "1.3.6"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Autumn 2010")
((#:albert #:output-dir) . "/tmp/documentation/com.informatimago.common-lisp.cesarum/")
......@@ -72,7 +72,7 @@ all written in 100% conforming Common Lisp.
((#:albert #:docbook #:textcolor) . "black"))
#+asdf-unicode :encoding #+asdf-unicode :utf-8
:depends-on ("com.informatimago.common-lisp.lisp-sexp")
:in-order-to ((test-op (test-op "com.informatimago.common-lisp.cesarum.test")))
#+adsf3 :in-order-to #+adsf3 ((test-op (test-op "com.informatimago.common-lisp.cesarum.test")))
:components (
;; Simple Test Framework
(:file "simple-test" :depends-on ())
......@@ -132,7 +132,7 @@ all written in 100% conforming Common Lisp.
(:file "float-binio" :depends-on ())
)
:in-order-to ((asdf:test-op (asdf:test-op "com.informatimago.common-lisp.cesarum.test"))))
#+adsf3 :in-order-to #+adsf3 ((asdf:test-op (asdf:test-op "com.informatimago.common-lisp.cesarum.test"))))
;; Would require a separate asd file...
......
......@@ -46,7 +46,7 @@
:maintainer "Pascal J. Bourguignon <pjb@informatimago.com>"
:licence "AGPL3"
;; component attributes:
:version "1.3.5"
:version "1.3.6"
:properties ((#:author-email . "pjb@informatimago.com")
(#:date . "Winter 2015")
((#:albert #:output-dir) . "/tmp/documentation/com.informatimago.common-lisp.cesarum-test/")
......
......@@ -298,6 +298,7 @@ EXAMPLE: (map-cartesian-product (function list) '(1 2 3) '(a b c) '(11 22))
(cdr lists)))
(car lists)))))
(declaim (inline plist-put plist-get plist-remove memq))
(defun plist-keys (plist)
"Returns a list of the properties in PLIST."
......@@ -361,7 +362,6 @@ RETURN: (MEMBER ITEM LIST :TEST (FUNCTION EQ))
"
(member item list :test (function eq)))
(declaim (inline plist-put plist-get plist-remove memq))
(defun transpose (tree)
......
......@@ -105,11 +105,11 @@ License:
(tail nil :type list))
(declaim (inline queue-elements))
(defun queue-elements (queue)
"RETURN: The list of elements in the queue."
(queue-head queue))
(declaim (inline queue-elements))
(defun queue-invariant (queue)
"
......
......@@ -80,8 +80,8 @@ License:
(eval-when (:compile-toplevel :load-toplevel :execute) (defconstant +n+ 32))
(defun op (x a b sum) (logxor (+ (ash x 4) a) (+ x sum) (+ (ash x -5) b)))
(declaim (inline op))
(defun op (x a b sum) (logxor (+ (ash x 4) a) (+ x sum) (+ (ash x -5) b)))
(defmacro ciploop ((v w k y z a b c d (sum init-sum) delta) &body body)
`(let ((,y (aref ,v 0)) (,z (aref ,v 1))
(,sum ,init-sum) (,delta #x9e3779b9)
......
......@@ -476,7 +476,7 @@ NOTE: No prefix argument are allowed for REDUCE!
(defmacro for ((var first last . rest) &body body)
(defmacro for ((var first last &optional (step nil stepp)) &body body)
"For loop.
DO: Repeat BODY with VAR bound to successive integer values from
FIRST to LAST inclusive.
......@@ -485,23 +485,51 @@ DO: Repeat BODY with VAR bound to successive integer values from
VAR is incremented by STEP and it stops when VAR goes above
or below LAST depending on the sign of STEP.
"
(let ((firstvar (gensym "FIRST"))
(lastvar (gensym "LAST"))
(stepvar (gensym "STEP"))
(step (and rest (car rest))))
(when (cdr rest) (error "Too many forms in FOR parameters."))
`(let ((,firstvar ,first)
(,lastvar ,last)
(,stepvar ,step))
(if (if ,stepvar (< 0 ,stepvar) (<= ,firstvar ,lastvar))
(progn (setf ,stepvar (or ,stepvar 1))
(do ((,var ,firstvar (incf ,var ,stepvar)))
((> ,var ,lastvar))
,@body))
(progn (setf ,stepvar (or ,stepvar -1))
(do ((,var ,firstvar (incf ,var ,stepvar)))
((< ,var ,lastvar))
,@body))))))
(when (and (not stepp) (numberp first) (numberp last))
(setf step (if (<= first last) 1 -1)
stepp t))
(cond
((and stepp (numberp step))
;; Hardwired step and comparison:
(check-type step real)
(let ((firstvar (gensym "FIRST"))
(lastvar (gensym "LAST"))
(cmp (if (minusp step) '< '>)))
`(let ((,firstvar ,first)
(,lastvar ,last))
(do ((,var ,firstvar (incf ,var ,step)))
((,cmp ,var ,lastvar))
,@body))))
(stepp
;; Runtime evaluation of step and comparison:
(let ((firstvar (gensym "FIRST"))
(lastvar (gensym "LAST"))
(stepvar (gensym "STEP"))
(cmp (gensym "CMP")))
`(let* ((,firstvar ,first)