Skip to content

Commit

Permalink
Don't upcase symbols unnecessarily when building config file initargs.
Browse files Browse the repository at this point in the history
  • Loading branch information
xach committed Oct 11, 2010
1 parent 2245b35 commit f1b0c7a
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions dist.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
NAME, sorted by preference."))

(defgeneric find-releases-named (name)
(:Documentation
(:documentation
"Return a list of all releases in all enabled dists with the given
NAME, sorted by preference."))

Expand Down Expand Up @@ -266,17 +266,20 @@
(ignorable line)))

(defun config-file-initargs (file)
(let ((initargs '()))
(for-each-line (line file)
(unless (ignorable-line line)
(destructure-line (initarg value)
line
(let ((keyword (intern (string-upcase (string-right-trim '(#\:)
initarg))
:keyword)))
(push value initargs)
(push keyword initargs)))))
initargs))
(flet ((initarg-keyword (string)
;; A concession to mlisp
(or (find-symbol string 'keyword)
(find-symbol (string-upcase string) 'keyword)
(error "Unknown config file option ~S" string))))
(let ((initargs '()))
(for-each-line (line file)
(unless (ignorable-line line)
(destructure-line (initarg value)
line
(let ((keyword (initarg-keyword (string-right-trim ":" initarg))))
(push value initargs)
(push keyword initargs)))))
initargs)))

;;;
;;; A few generic things
Expand Down

0 comments on commit f1b0c7a

Please sign in to comment.