Browse files

Support keyword-policy in KIND and FLAGS.

  • Loading branch information...
1 parent ce3fa54 commit 83a0931b011eb825aa48219b1e1c304646a27258 @Hexstream committed Oct 26, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 info.lisp
@@ -1,9 +1,11 @@
(in-package #:parse-number-range)
;; Stupid repetition, but I've had enough.
-(defun kind (keyword &key (errorp t))
+(defun kind (keyword &key (errorp t) (keyword-policy :strict))
'(values kind new-direction new-limit-kind)
- (case keyword
+ (case (ecase keyword-policy
+ (:strict keyword)
+ (:loose (intern (symbol-name keyword) '#:keyword)))
((:from :downfrom :upfrom)
(multiple-value-call #'values
@@ -24,9 +26,9 @@
(t (when errorp
(error "~S is not a for-as-arithmetic keyword." keyword)))))
-(defun flags (keyword &key (errorp t))
+(defun flags (keyword &key (errorp t) (keyword-policy :strict))
(multiple-value-bind (kind direction limit-kind)
- (kind keyword :errorp errorp)
+ (kind keyword :errorp errorp :keyword-policy keyword-policy)
(declare (ignore kind))
(values direction limit-kind)))

0 comments on commit 83a0931

Please sign in to comment.