wanted: sbcl version assert
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Low
|
Unassigned |
Bug Description
Several times in my working with other people, since I am keeping up
to date with SBCL, when I have them pull my latest code we go through
a cycle of:
them: "I'm getting error xyz."
me: "Oh, you need to update to the latest SBCL."
So I wrote the following in my initialization file. I'm wondering if
there is a place for this or something like it in the main code
base. If so, please review and I can clean it up as needed.
Also, if this launchpad system is not the best place for things like
this and the sbcl-devel list would be better, please inform me of my
transgressions.
----
(defparameter *required-
(defun split-sbcl-version (str)
(flet ((list-to-num (list)
(loop with acc and vals
for c across str
do (if (digit-char-p c)
finally (return (cons (list-to-num acc) vals)))))
(defun sbcl-version-
(destructurin
(+ (* a 1000000000000)
(* b 100000000)
(* c 10000)
d)))
(let ((this-version (lisp-implement
(when (< (sbcl-version-
(format t "SBCL version of at least ~A is required. This SBCL is ~A.~%"
(quit)))
Changed in sbcl: | |
importance: | Undecided → Wishlist |
status: | New → Triaged |
tags: |
added: feature removed: wishlist |
summary: |
- wish for a sbcl version assert + wanted: sbcl version assert |
tags: | added: easy |
Changed in sbcl: | |
importance: | Wishlist → Low |
Changed in sbcl: | |
assignee: | nobody → Philip Munksgaard (pmunksgaard) |
status: | Triaged → In Progress |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
Launchpad is fine.
In principle I think SB-EXT:VERSION< or similar would be possible.
It does need to deal with non-numeric components, but probably TRT is the right thing to only parse the leading numeric components.
So
(version< "1.0.34.12-foo" "1.0.44. 1.master. 0-dirty" ) => T
and
(version< "1.0.42. debian- something" "1.0.42. debian- something- other") => NIL
. Or possibly use STRING< to compare non-numeric tails. Dunno.
While there's no strict need to have this in SBCL itself, obviously, SBCL _is_ a sufficiently moving target that it might be a good thing.