Common version patterns fail in UIOP:PARSE-VERSION
It's common to have some extraneous information in a hyphen-separated suffix of a version number. For example, I have a copy of ABCL 1.8 that gives me this:
CL-USER(2): (uiop:lisp-version-string)
"1.8.0-fasl43"
Unfortunately, this causes uiop:parse-version
to fail and return NIL
.
Fixing this on the caller side is unpleasant: (subseq (uiop:lisp-version-string) 0 (position #- (uiop:lisp-version-string)))
I suggest that we modify parse-version
as follows:
- Keep the current behavior, controlled by a
strict
argument. - Remove any hyphen-prefixed suffix, and return that as a second value.
So we would get
(1 8 0)
"fasl43"
unless strict
is true. If strict
was true and on-error
was nil
, then we would just get NIL
.
I would also like to add the option to pass :error
to on-error
, so that programmers do not have to remember to use #'error
, which is awkward.