Permalink
Browse files

Changed readers for invalid-input condition to invalid-input-value

invalid-input-reason and exported them
  • Loading branch information...
1 parent 5d9f71a commit bf988c5f4d0b332e8f75495942e9ed454f63406c @willijar committed Sep 19, 2009
Showing with 7 additions and 5 deletions.
  1. +3 −1 defpackage.lisp
  2. +4 −4 validation.lisp
View
@@ -34,11 +34,13 @@
(:use :cl :cl-ppcre)
(:export
;; main generic interface and condition
- #:parse-input #:format-output #:invalid-input #:use-default
+ #:parse-input #:format-output
+ #:invalid-input #:invalid-input-value #:invalid-input-reason
;; new use data types - ang and date are also formatter functions
#:date #:filename #:eng #:time-period #:pathnames #:separated #:roman
;; functions for doing aggregates of user data and condition
#:parse-options #:parse-arguments #:unknown-option #:too-many-arguments
#:ignore-extra-arguments
+ #:use-default
;; some other more generally useful helper library functions
#:split-string #:join-strings))
View
@@ -28,18 +28,18 @@
(in-package :data-format-validation)
(define-condition invalid-input(condition)
- ((value :reader value
+ ((value :reader invalid-input-value
:initarg :value
:documentation "The value input"
:initform nil)
- (reason :reader reason
+ (reason :reader invalid-input-reason
:initarg :reason
:documentation "Textual description of reason value is invalid."
:initform nil))
(:report (lambda (condition stream)
(format stream "Invalid input: ~S ~@[[Reason: ~A]~]"
- (value condition)
- (reason condition)))))
+ (invalid-input-value condition)
+ (invalid-input-reason condition)))))
(defmacro invalid-input (value &rest reason)
"Generate an invalid-input error for given value using reason"

0 comments on commit bf988c5

Please sign in to comment.