Errors in Lisp<br />
overview<br />General error-signaling functions<br />Specialized error signaling Forms and Macros<br />Special Forms for e...
List functions may signal an error when given incorrect arguments.<br />Each implementation of common lisp will provide an...
General error-signaling functions<br />These functions provide mechanisms for warnings, breaks, continuable errors, and fa...
 error format-string &rest args<br />The function signals a fatal error. It is impossible to continue from this kind of e...
 cerror continue-format-string error-format-string &rest args<br />Cerror is used to signal continuable errors, it allows...
Specialized error signaling Forms and Macros<br />These facilitate the user to insert error checks into the code.<br />Ch...
assert test-form [({place}* ) [string {arg}*]]<br />assert signals an error if the value of the test-form is nil.<br />Co...
Special Forms for exhaustive Case Analysis<br />etypecase and ecase are similar to typecase and case, but signal a continu...
To supply an application-specific error, the user must use typecase with an otherwise clause containing a call to error.<b...
<ul><li>ecase keyform {({({key}*) | key} {form}* )}*</li></ul>If no clause is satisfied, ecase signals an error with a mes...
<ul><li>ccase keyplace {({({key}*) | key} {form}* )}*</li></ul>The keyplace must be a generalized vale reference acceptabl...
Visit more self help tutorials<br />Pick a tutorial of your choice and browse through it at your own pace.<br />The tutori...
Upcoming SlideShare
Loading in …5
×

LISP: Errors In Lisp

1,157 views
1,055 views

Published on

LISP: Errors In Lisp

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,157
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

LISP: Errors In Lisp

  1. 1. Errors in Lisp<br />
  2. 2. overview<br />General error-signaling functions<br />Specialized error signaling Forms and Macros<br />Special Forms for exhaustive Case Analysis<br />
  3. 3. List functions may signal an error when given incorrect arguments.<br />Each implementation of common lisp will provide an interactive debugger that prints the error message along with suitable contextual information such as which function detected the error.<br />Conditions subsume and generalize the notation of errors.<br />The conditions system also provides means for handling conditions and for restarting a computation after a condition has been signaled.<br />
  4. 4. General error-signaling functions<br />These functions provide mechanisms for warnings, breaks, continuable errors, and fatal errors.<br />The caller specifies an error message( a string) that may be processed by the error handling mechanism.<br />Error message should not contain a new-line character either at the beginning or at the end.<br />
  5. 5.  error format-string &rest args<br />The function signals a fatal error. It is impossible to continue from this kind of error. <br /><ul><li>Warn format-string &rest args</li></ul>Warn prints an error message but normally doesn’t go into the debugger. ‘<br />This may be controlled by the variable break *break-on-warnings*<br />If the variable *break-on-warnings* is not null, then the function warn behaves like break. <br />
  6. 6.  cerror continue-format-string error-format-string &rest args<br />Cerror is used to signal continuable errors, it allows the program to be continued from debugger after resolving the error. <br />break &optional format-string &rest args<br />Break prints the message and goes directly into the debugger, without allowing any possibility of interception by programmed error-handling facilities.<br />
  7. 7. Specialized error signaling Forms and Macros<br />These facilitate the user to insert error checks into the code.<br />Check-type place typespec [string]<br />Check-type signals an error if the contents of place are not of the desired type.<br />The user will be asked for a new value, the check-type will store the new value in place and start over.<br />The place must be a generalized variable reference acceptable to setf.<br />Typespec must be a type specifier. (it is not evaluated.)<br />String must be an English description of the type, starting with an indefinite article ( “a” or “an”). (it is evaluated.)<br />
  8. 8. assert test-form [({place}* ) [string {arg}*]]<br />assert signals an error if the value of the test-form is nil.<br />Continuing from this error allows the user to alter the values of some variables , and assert will start over, evaluating the test form again.<br />assert returns nil.<br />
  9. 9. Special Forms for exhaustive Case Analysis<br />etypecase and ecase are similar to typecase and case, but signal a continuable error if no clause is selected.<br />Ctypecase and ccase are similar to typecase and case, but signal a continuable error if no clause is selected.<br /><ul><li>etypecase keyform {(type {form}* )}*</li></ul>This control construct is similar to typecase, but no explicit otherwise or t clause is permitted.<br />
  10. 10. To supply an application-specific error, the user must use typecase with an otherwise clause containing a call to error.<br /> Ctypecase keyplace { (type {form}* )}*<br />The keyplace must be a generalized variable reference acceptable to setf.<br />If n o clause is satisfied, ctypecase signals an error with a message constructed from the clauses.<br />
  11. 11. <ul><li>ecase keyform {({({key}*) | key} {form}* )}*</li></ul>If no clause is satisfied, ecase signals an error with a message constructed from the clauses.<br />It is not permissible to continue from this error.<br />To supply an error message, the user must use case with an otherwise clause containing a call to error.<br />
  12. 12. <ul><li>ccase keyplace {({({key}*) | key} {form}* )}*</li></ul>The keyplace must be a generalized vale reference acceptable to setf.<br />Continuing from this error causes ccase to accept a new value from the user, store it into keyplace, and start over, making the clause tests again.<br />Subforms of keyplace may be evaluated multiple times.<br />
  13. 13. Visit more self help tutorials<br />Pick a tutorial of your choice and browse through it at your own pace.<br />The tutorials section is free, self-guiding and will not involve any additional support.<br />Visit us at www.dataminingtools.net<br />

×