floc-proto.lisp
base-lexer-error class
base-syntax-error class
- cerror* function
cerror*-with-location function
cerror-with-location function
classify-condition generic
condition-with-location class
count-and-report-errors macro
- enclosed-condition generic
- enclosing-condition class
enclosing-condition-with-location class
enclosing-condition-with-location-type generic
enclosing-error-with-location class
file-location-filename function
file-location-line function
file-location-p function
- info function
info-with-location function
- information class
information-with-location class
make-condition-with-location function
make-file-location function
- noted function
parser-error class
parser-error-expected generic
parser-error-found generic
report-parser-error function
simple-condition-with-location class
simple-error-with-location class
- simple-information class
simple-information-with-location class
simple-lexer-error class
simple-syntax-error class
sb-pcl::slot-object
cl:condition
condition-with-location
- enclosing-condition-with-location [enclosing-condition]
+ enclosing-condition-with-location [sod-utilities:enclosing-condition]
enclosing-error-with-location [cl:error]
- enclosing-information-with-location [information]
+ enclosing-information-with-location [sod-utilities:information]
enclosing-warning-with-location [cl:warning]
error-with-location [cl:error]
base-lexer-error
simple-error-with-location [cl:simple-error]
simple-lexer-error [base-lexer-error]
simple-syntax-error [base-syntax-error]
- information-with-location [information]
- simple-information-with-location [simple-information]
+ information-with-location [sod-utilities:information]
+ simple-information-with-location [sod-utilities:simple-information]
simple-condition-with-location [cl:simple-condition]
warning-with-location [cl:warning]
simple-warning-with-location [cl:simple-warning]
- enclosing-condition
+ sod-utilities:enclosing-condition
enclosing-condition-with-location [condition-with-location]
enclosing-error-with-location [cl:error]
- enclosing-information-with-location [information]
+ enclosing-information-with-location [sod-utilities:information]
enclosing-warning-with-location [cl:warning]
- information
+ sod-utilities:information
enclosing-information-with-location [enclosing-condition-with-location]
information-with-location [condition-with-location]
- simple-information-with-location [simple-information]
- simple-information [cl:simple-condition]
+ simple-information-with-location [sod-utilities:simple-information]
+ sod-utilities:simple-information [cl:simple-condition]
simple-information-with-location [information-with-location]
cl:serious-condition
cl:error
simple-error-with-location [error-with-location]
simple-lexer-error [base-lexer-error]
simple-syntax-error [base-syntax-error]
- simple-information [information]
+ sod-utilities:simple-information [sod-utilities:information]
simple-information-with-location [information-with-location]
cl:simple-warning [cl:warning]
simple-warning-with-location [warning-with-location]
cl:warning
base-lexer-error
base-syntax-error
- information
-enclosed-condition
- enclosing-condition
+ sod-utilities:information
enclosing-condition-with-location-type
cl:condition
cl:error
cl:warning
- information
+ sod-utilities:information
expand-parser-form
t (eql cl:and) t
t (eql cl:list) t
awhen macro
backtrack-position function
categorize macro
+ cerror* function
compose function
copy-instance function
copy-instance-using-class generic
designated-condition function
distinguished-point-shortest-paths function
dosequence macro
+ enclosed-condition generic
+ enclosing-condition class
sb-mop:eql-specializer class
sb-mop:eql-specializer-object generic
find-duplicates function
frob-identifier function
sb-mop:generic-function-methods generic setf
inconsistent-merge-error class
+ info function
+ information class
instance-initargs generic
invoke-associated-restart function
it
merge-error-present-function generic
merge-lists function
sb-mop:method-specializers generic
+ noted function
once-only macro
parse-body function
partial-order-minima function
print-ugly-stuff function
+ promiscuous-cerror function
ref function setf
simple-control-error class
+ simple-information class
symbolicate function
update-position function
whitespace-char-p function
cl:t
sb-pcl::slot-object
cl:condition
+ enclosing-condition
+ information
+ simple-information [cl:simple-condition]
cl:serious-condition
cl:error
cl:control-error
cl:simple-condition
cl:simple-error [cl:error]
simple-control-error [cl:control-error]
+ simple-information [information]
cl:standard-object
sb-mop:metaobject
sb-mop:specializer
loc
Methods:
+sod-parser:classify-condition
+ information
copy-instance-using-class
cl:standard-class t
+enclosed-condition
+ enclosing-condition
+sod-parser:enclosing-condition-with-location-type
+ information
sb-mop:eql-specializer-object
sb-mop:eql-specializer
sb-mop:generic-function-methods
{invoke-associated-restart @<restart> @<condition> \&rest @<arguments>}
\end{describe}
+\begin{describe*}
+ {\dhead{cls}{enclosing-condition (condition) \&key :condition}
+ \dhead{gf}{enclosed-condition @<enclosing-condition> @> @<condition>}}
+\end{describe*}
+
+\begin{describe}{cls}{information (condition) \&key}
+\end{describe}
+
+\begin{describe}{cls}
+ {simple-information (simple-condition information) \\ \ind
+ \&key :format-control :format-arguments}
+\end{describe}
+
+\begin{describe*}
+ {\dhead{fun}{info @<datum> \&rest @<arguments> @> @<flag>}
+ \dhead{rst}{noted}
+ \dhead{fun}{noted \&optional @<condition>}}
+\end{describe*}
+
+\begin{describe}{fun}
+ {promiscuous-cerror @<continue-string> @<datum> \&rest @<arguments>}
+\end{describe}
+
+\begin{describe}{fun}{cerror* @<datum> \&rest @<arguments>}
+\end{describe}
+
\subsection{Very miscellaneous utilities}
@[[ :read-only @<read-only-flag> @]]}
\end{describe}
-%%%--------------------------------------------------------------------------
-\section{Condition utilities} \label{sec:misc.condition}
-
-These symbols are defined in the @|sod-parser| package.
-
-\begin{describe}{cls}{enclosing-condition (condition) \&key :condition}
-\end{describe}
-
-\begin{describe}{gf}
- {enclosed-condition @<enclosing-condition> @> @<condition>}
-\end{describe}
-
-\begin{describe}{cls}{information (condition) \&key}
-\end{describe}
-
-\begin{describe}{cls}
- {simple-information (simple-condition information) \\ \ind
- \&key :format-control :format-arguments}
-\end{describe}
-
-\begin{describe}{fun}{info @<datum> \&rest @<arguments> @> @<flag>}
-\end{describe}
-
-\begin{describe*}
- {\dhead{rst}{noted}
- \dhead{fun}{noted \&optional @<condition>}}
-\end{describe*}
-
-\begin{describe}{fun}{cerror* @<datum> \&rest @<arguments>}
-\end{describe}
-
%%%--------------------------------------------------------------------------
\section{Option parser} \label{sec:misc.optparse}
`file-location designator'.")
(:method ((thing file-location)) thing))
-;;;--------------------------------------------------------------------------
-;;; Enclosing conditions.
-
-(export '(enclosing-condition enclosed-condition))
-(define-condition enclosing-condition (condition)
- ((%enclosed-condition :initarg :condition :type condition
- :reader enclosed-condition))
- (:documentation
- "A condition which encloses another condition
-
- This is useful if one wants to attach additional information to an
- existing condition. The enclosed condition can be obtained using the
- `enclosed-condition' function.")
- (:report (lambda (condition stream)
- (princ (enclosed-condition condition) stream))))
-
;;;--------------------------------------------------------------------------
;;; Conditions with location information.
(condition-with-location enclosing-condition)
())
-(export 'information)
-(define-condition information (condition)
- ())
-
(export 'error-with-location)
(define-condition error-with-location (condition-with-location error)
())
(warning-with-location simple-warning)
())
-(export 'simple-information)
-(define-condition simple-information (simple-condition information)
- ())
-
-(export 'info)
-(defun info (datum &rest arguments)
- "Report some useful diagnostic information.
-
- Establish a simple restart named `noted', and signal the condition of type
- `information' designated by DATUM and ARGUMENTS. Return non-nil if the
- restart was invoked, otherwise nil."
- (restart-case
- (signal (designated-condition 'simple-information datum arguments))
- (noted () :report "Noted." t)))
-
-(export 'noted)
-(defun noted (&optional condition)
- "Invoke the `noted' restart, possibly associated with the given CONDITION."
- (invoke-associated-restart 'noted condition))
-
(export 'simple-information-with-location)
(define-condition simple-information-with-location
(information-with-location simple-information)
'simple-information-with-location
floc datum arguments)))
-(defun my-cerror (continue-string datum &rest arguments)
- "Like standard `cerror', but robust against sneaky changes of conditions.
-
- It seems that `cerror' (well, at least the version in SBCL) is careful
- to limit its restart to the specific condition it signalled. But that's
- annoying, because `with-default-error-location' substitutes different
- conditions carrying the error-location information."
- (restart-case (apply #'error datum arguments)
- (continue ()
- :report (lambda (stream)
- (apply #'format stream continue-string datum arguments))
- nil)))
-
(export 'cerror-with-location)
(defun cerror-with-location (floc continue-string datum &rest arguments)
"Report a continuable error with attached location information."
- (my-cerror continue-string
+ (promiscuous-cerror continue-string
(apply #'make-condition-with-location
'simple-error-with-location
floc datum arguments)))
-(export 'cerror*)
-(defun cerror* (datum &rest arguments)
- (apply #'my-cerror "Continue" datum arguments))
-
(export 'cerror*-with-location)
(defun cerror*-with-location (floc datum &rest arguments)
(apply #'cerror-with-location floc "Continue" datum arguments))
condition)))
arguments))
+(export '(enclosing-condition enclosed-condition))
+(define-condition enclosing-condition (condition)
+ ((%enclosed-condition :initarg :condition :type condition
+ :reader enclosed-condition))
+ (:documentation
+ "A condition which encloses another condition
+
+ This is useful if one wants to attach additional information to an
+ existing condition. The enclosed condition can be obtained using the
+ `enclosed-condition' function.")
+ (:report (lambda (condition stream)
+ (princ (enclosed-condition condition) stream))))
+
+(export 'information)
+(define-condition information (condition)
+ ())
+
+(export 'simple-information)
+(define-condition simple-information (simple-condition information)
+ ())
+
+(export 'info)
+(defun info (datum &rest arguments)
+ "Report some useful diagnostic information.
+
+ Establish a simple restart named `noted', and signal the condition of type
+ `information' designated by DATUM and ARGUMENTS. Return non-nil if the
+ restart was invoked, otherwise nil."
+ (restart-case
+ (signal (designated-condition 'simple-information datum arguments))
+ (noted () :report "Noted." t)))
+
+(export 'noted)
+(defun noted (&optional condition)
+ "Invoke the `noted' restart, possibly associated with the given CONDITION."
+ (invoke-associated-restart 'noted condition))
+
+(export 'promiscuous-cerror)
+(defun promiscuous-cerror (continue-string datum &rest arguments)
+ "Like standard `cerror', but robust against sneaky changes of conditions.
+
+ It seems that `cerror' (well, at least the version in SBCL) is careful
+ to limit its restart to the specific condition it signalled. But that's
+ annoying, because `sod-parser:with-default-error-location' substitutes
+ different conditions carrying the error-location information."
+ (restart-case (apply #'error datum arguments)
+ (continue ()
+ :report (lambda (stream)
+ (apply #'format stream continue-string datum arguments))
+ nil)))
+
+(export 'cerror*)
+(defun cerror* (datum &rest arguments)
+ (apply #'promiscuous-cerror "Continue" datum arguments))
+
;;;--------------------------------------------------------------------------
;;; CLOS hacking.