Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,12 +0,0 @@
(defun string-valid-number-p (str)
"Test if STR is a numeric string.
Eliminate strings with commas in them because ELisp numbers do
not contain commas. Then check if remaining strings would be
valid ELisp numbers if the quotation marks were removed."
(and
;; no comma in string, because ELisp numbers do not have commas
;; we need to eliminate any string with a comma, because the
;; numberp function below will not weed out commas
(not (string-match-p "," str))
;; no errors from numberp function testing if a number
(ignore-errors (numberp (read str)))))

View file

@ -1,17 +0,0 @@
(setq valid-strings '("3" "0" "-0" "2." "1000" "-4" "-5." "6.2" "-8.45" "+15e2" "-15e2" "#b101100" "#o54" "#x2c" "1500.0" "#24r1k" "3"))
(setq invalid-strings '("3cat" "1,000" "5.6.7" "cat3" "def" "zero"))
(with-current-buffer (pop-to-buffer "my-test")
(erase-buffer)
(insert "Test for valid strings:\n")
(dolist (test-string valid-strings)
(let ((test-result))
(setq test-result (string-valid-number-p test-string))
(insert (format "%-8s - %s \n" test-string test-result))))
(insert "\n" "\n")
(insert "Test for invalid strings:\n")
(dolist (test-string invalid-strings)
(let ((test-result))
(setq test-result (string-valid-number-p test-string))
(insert (format "%-5s - %s \n" test-string test-result)))))