Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
961c96ad by Raymond Toy at 2023-08-30T11:12:42-07:00
Update release notes with fixed issues
- - - - -
1 changed file:
- src/general-info/release-21f.md
Changes:
=====================================
src/general-info/release-21f.md
=====================================
@@ -1,3 +1,5 @@
+# CMUCL 21f
+
# Work in progress
The CMUCL project is pleased to announce the release of CMUCL 21f.
@@ -24,9 +26,16 @@ public domain.
* Gitlab tickets:
* ~~#154~~ piglatin translation does not work anymore
* ~~#171~~ Readably print `(make-pathname :name :unspecfic)`
- * ~~#242~~ Fix bug in `alien-funcall` with `c-call:char` as result type
+ * ~~#196~~ Fix issues with mapping and nconc accumulation (mapcan)
+ * ~~#216~~ `enough-namestring` with relative pathname fails
+ * ~~#234~~ Make :ASCII external format builtin
+ * ~~#240~~ Speed up set operations
+ * ~~#242~~ Fix bug in `alien-funcall` with `c-call:char` as result type
* ~~#244~~ Add `c-call:signed-char`
* ~~#248~~ Print MOVS instruction with correct case
+ * ~~#249~~ Replace LEA instruction with simpler shorter instructions in arithmetic vops for x86
+ * ~~#253~~ Block-compile list-to-hashtable and callers
+ * ~~#258~~ Remove `get-page-size` from linux-os.lisp
* Other changes:
* Improvements to the PCL implementation of CLOS:
* Changes to building procedure:
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/961c96adaded1bf545d8b04…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/961c96adaded1bf545d8b04…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
db531fef by Raymond Toy at 2023-08-30T17:59:50+00:00
Address #240: Add hashtable for set-exclusive-or
- - - - -
766c6aa5 by Raymond Toy at 2023-08-30T18:00:08+00:00
Merge branch 'issue-240-add-hashtable-set-exclusive-or' into 'master'
Address #240: Add hashtable for set-exclusive-or
See merge request cmucl/cmucl!169
- - - - -
3 changed files:
- src/code/list.lisp
- src/i18n/locale/cmucl.pot
- tests/sets.lisp
Changes:
=====================================
src/code/list.lisp
=====================================
@@ -928,7 +928,7 @@
(defun set-exclusive-or (list1 list2 &key key
(test #'eql testp) (test-not nil notp))
- "Return new list of elements appearing exactly once in LIST1 and LIST2."
+ "Return new list of elements appearing exactly one of LIST1 and LIST2."
(declare (inline member))
(let ((result nil)
(key (when key (coerce key 'function)))
@@ -936,19 +936,38 @@
(test-not (if test-not (coerce test-not 'function) #'eql)))
(declare (type (or function null) key)
(type function test test-not))
- (dolist (elt list1)
- (unless (with-set-keys (member (apply-key key elt) list2))
- (setq result (cons elt result))))
- (let ((test (if testp
- (lambda (x y) (funcall test y x))
- test))
- (test-not (if notp
- (lambda (x y) (funcall test-not y x))
- test-not)))
- (dolist (elt list2)
- (unless (with-set-keys (member (apply-key key elt) list1))
- (setq result (cons elt result)))))
- result))
+ ;; Find the elements in list1 that do not appear in list2 and add
+ ;; them to the result.
+ (macrolet
+ ((compute-membership (item-list test-form)
+ `(dolist (elt ,item-list)
+ (unless ,test-form
+ (setq result (cons elt result))))))
+ (let ((hashtable (list-to-hashtable list2 key test test-not)))
+ (cond
+ (hashtable
+ (compute-membership list1
+ (nth-value 1 (gethash (apply-key key elt) hashtable))))
+ (t
+ (compute-membership list1
+ (with-set-keys (member (apply-key key elt) list2))))))
+ ;; Now find the elements in list2 that do not appear in list1 and
+ ;; them to the result.
+ (let ((hashtable (list-to-hashtable list1 key test test-not)))
+ (cond
+ (hashtable
+ (compute-membership list2
+ (nth-value 1 (gethash (apply-key key elt) hashtable))))
+ (t
+ (let ((test (if testp
+ (lambda (x y) (funcall test y x))
+ test))
+ (test-not (if notp
+ (lambda (x y) (funcall test-not y x))
+ test-not)))
+ (compute-membership list2
+ (with-set-keys (member (apply-key key elt) list1)))))))
+ result)))
;;; The outer loop examines list1 while the inner loop examines list2. If an
=====================================
src/i18n/locale/cmucl.pot
=====================================
@@ -3236,7 +3236,7 @@ msgid "Destructively returns the elements of list1 which are not in list2."
msgstr ""
#: src/code/list.lisp
-msgid "Return new list of elements appearing exactly once in LIST1 and LIST2."
+msgid "Return new list of elements appearing exactly one of LIST1 and LIST2."
msgstr ""
#: src/code/list.lisp
=====================================
tests/sets.lisp
=====================================
@@ -279,3 +279,26 @@
'(3 4)
:test 'eql
:test-not 'equal)))
+
+(define-test set-exclusive-or.1
+ (:tag :issues)
+ (flet
+ ((test (min-length)
+ ;; From CLHS
+ (let ((lisp::*min-list-length-for-hashtable* min-length))
+ (assert-equal '("b" "A" "b" "a")
+ (set-exclusive-or '(1 "a" "b")
+ '(1 "A" "b")))
+ (assert-equal '("A" "a")
+ (set-exclusive-or '(1 "a" "b")
+ '(1 "A" "b")
+ :test #'equal))
+ (assert-equal nil
+ (set-exclusive-or '(1 "a" "b")
+ '(1 "A" "b")
+ :test #'equalp)))))
+ ;; Test the list impl by making the min length large. Then test
+ ;; the hashtable impl with a very short min length
+ (test 100)
+ (test 2)))
+
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/77dee6275790bafea5b008…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/77dee6275790bafea5b008…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
d08a26c4 by Raymond Toy at 2023-08-29T14:53:04-07:00
Remove extra closing paren after %print-pathname
Gets rid of a simple compiler warning.
- - - - -
1 changed file:
- src/code/pathname.lisp
Changes:
=====================================
src/code/pathname.lisp
=====================================
@@ -195,7 +195,7 @@
(%pathname-directory pathname)
(%pathname-name pathname)
(%pathname-type pathname)
- (%pathname-version pathname)))))))))
+ (%pathname-version pathname))))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/d08a26c44064027d44023d0…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/d08a26c44064027d44023d0…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-240-add-hashtable-set-exclusive-or at cmucl / cmucl
Commits:
dac5115d by Raymond Toy at 2023-08-29T06:53:26-07:00
Macroize membership loop in set-exclusiv-or
Add a short macro to handle looping over a list determining the
membership of the list element in the result.
Fix a typo in the docstring.
Update cmucl.pot due to the changed docstring.
- - - - -
2 changed files:
- src/code/list.lisp
- src/i18n/locale/cmucl.pot
Changes:
=====================================
src/code/list.lisp
=====================================
@@ -916,35 +916,36 @@
(type function test test-not))
;; Find the elements in list1 that do not appear in list2 and add
;; them to the result.
- (let ((hashtable (list-to-hashtable list2 key test test-not)))
- (cond
- (hashtable
- (dolist (elt list1)
- (unless (nth-value 1 (gethash (apply-key key elt) hashtable))
- (setq result (cons elt result)))))
- (t
- (dolist (elt list1)
- (unless (with-set-keys (member (apply-key key elt) list2))
- (setq result (cons elt result)))))))
- ;; Now find the elements in list2 that do not appear in list1 and
- ;; them to the result.
- (let ((hashtable (list-to-hashtable list1 key test test-not)))
- (cond
- (hashtable
- (dolist (elt list2)
- (unless (nth-value 1 (gethash (apply-key key elt) hashtable))
- (setq result (cons elt result)))))
- (t
- (let ((test (if testp
- (lambda (x y) (funcall test y x))
- test))
- (test-not (if notp
- (lambda (x y) (funcall test-not y x))
- test-not)))
- (dolist (elt list2)
- (unless (with-set-keys (member (apply-key key elt) list1))
- (setq result (cons elt result))))))))
- result))
+ (macrolet
+ ((compute-membership (item-list test-form)
+ `(dolist (elt ,item-list)
+ (unless ,test-form
+ (setq result (cons elt result))))))
+ (let ((hashtable (list-to-hashtable list2 key test test-not)))
+ (cond
+ (hashtable
+ (compute-membership list1
+ (nth-value 1 (gethash (apply-key key elt) hashtable))))
+ (t
+ (compute-membership list1
+ (with-set-keys (member (apply-key key elt) list2))))))
+ ;; Now find the elements in list2 that do not appear in list1 and
+ ;; them to the result.
+ (let ((hashtable (list-to-hashtable list1 key test test-not)))
+ (cond
+ (hashtable
+ (compute-membership list2
+ (nth-value 1 (gethash (apply-key key elt) hashtable))))
+ (t
+ (let ((test (if testp
+ (lambda (x y) (funcall test y x))
+ test))
+ (test-not (if notp
+ (lambda (x y) (funcall test-not y x))
+ test-not)))
+ (compute-membership list2
+ (with-set-keys (member (apply-key key elt) list1)))))))
+ result)))
;;; The outer loop examines list1 while the inner loop examines list2. If an
=====================================
src/i18n/locale/cmucl.pot
=====================================
@@ -3236,7 +3236,7 @@ msgid "Destructively returns the elements of list1 which are not in list2."
msgstr ""
#: src/code/list.lisp
-msgid "Return new list of elements appearing exactly once in LIST1 and LIST2."
+msgid "Return new list of elements appearing exactly one of LIST1 and LIST2."
msgstr ""
#: src/code/list.lisp
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/dac5115d3df457ac2daadcd…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/dac5115d3df457ac2daadcd…
You're receiving this email because of your account on gitlab.common-lisp.net.