Skip to content
Snippets Groups Projects
Commit 5ab251cd authored by David Byers's avatar David Byers
Browse files

Removed the valid-digit functions and fixed byte-compilation errors.

parent 21a40826
No related branches found
No related tags found
No related merge requests found
*~ *~
\#* \#*
.#* .#*
.elc *.elc
...@@ -104,3 +104,14 @@ The OLC parse is a structure mainly used internally. Unless you call ...@@ -104,3 +104,14 @@ The OLC parse is a structure mainly used internally. Unless you call
geographical reference to coordinates. Please make sure you follow geographical reference to coordinates. Please make sure you follow
the acceptable use policy for the API (e.g., one request per second, the acceptable use policy for the API (e.g., one request per second,
tops, allowed). tops, allowed).
`(olc-is-valid CODE)`
: Returns non-nil if `CODE` is a valid open location code.
`(olc-is-short CODE)`
: Returns non-nil if `CODE` is a valid short location code. Returns
nil for valid short and for invalid codes.
`(olc-is-full CODE)`
: Returns non-nil if `CODE` is a valid full open location code.
Returns nil for valid long and for invalid codes.
...@@ -91,8 +91,7 @@ ...@@ -91,8 +91,7 @@
(pairs nil :read-only t) (pairs nil :read-only t)
(grid nil :read-only t) (grid nil :read-only t)
(short nil :read-only t) (short nil :read-only t)
(precision nil :read-only t) (precision nil :read-only t))
(code nil :read-only t))
(defsubst olc-parse-length (parse) (defsubst olc-parse-length (parse)
"Get length from a parsed open location code PARSE." "Get length from a parsed open location code PARSE."
...@@ -224,24 +223,13 @@ ...@@ -224,24 +223,13 @@
(olc-parse-create :pairs (nreverse pairs) (olc-parse-create :pairs (nreverse pairs)
:grid (nreverse grid) :grid (nreverse grid)
:short short :short short
:precision precision :precision precision))))
:code code))))
;;; ======================================================================== ;;; ========================================================================
;;; Public functions ;;; Public functions
;;; ======================================================================== ;;; ========================================================================
(defsubst olc-valid-digits (value)
"Return non-nil if VALUE consists of valid digits.
VALUE can be a character or sequence of characters."
(condition-case nil
(if (characterp value)
(olc-digit-value char)
(mapc 'olc-digit-value char))
(error nil)))
(defun olc-is-valid (code) (defun olc-is-valid (code)
"Return non-nil if CODE is a valid open location code." "Return non-nil if CODE is a valid open location code."
(condition-case nil (condition-case nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment