Questions tagged [condition-system]

11 questions
8
votes
1 answer

Are restarts part of a function's "public interface"? in Common Lisp?

I've been trying to understand proper use of restarts and handlers in Common Lisp by reading Peter Seibel's Beyond Exception Handling: Conditions and Restart chapter of Practical Common Lisp, Kent Pitman's Conditional Handling in the Lisp Language…
Tianxiang Xiong
  • 3,887
  • 9
  • 44
  • 63
7
votes
2 answers

common lisp exception handling (condition and restart)

I have been read the common lisp "Practical Common Lisp" exception handling chapter for days, but I am now so confused with the samples and the explanations, in the meanwhile I tried to write some testing sample, but it didn't work as I expected,…
4
votes
1 answer

How can conditions be handled in GCL?

handler-case is key to handling conditions in Common Lisp, but GCL 2.6.12 on Ubuntu 18.04 considers it to be an undefined function: >(handler-case (error "test") (error (condition) condition)) …
4
votes
1 answer

Common List: Use handler-case in different packages

I've got the following lisp code : ;;; hop.lisp (defpackage #:hop (:use #:cl )) (in-package :hop) (export 'hop) (defun hop () (restart-case (error "Hop") (hop () (format t "hop")))) Where I define a dummy function that always…
Guillaume
  • 289
  • 1
  • 7
3
votes
1 answer

In common lisp how do you restart where the error was thrown not caught?

This question is really about my lack of understanding of restarts. In the encoder for cl-json there exists a tempting macro I would like to use with-substitute-printed-representation-restart But alas I do not quite understand…
Jim
  • 329
  • 1
  • 5
3
votes
2 answers

Is there a book/guide for implementing a conditional restart system

I'm interesting in learning more about conditional restart systems and how they work. I'm not sure where to start. I've been looking at source code but was wondering if there was any higher level guides available.
zcaudate
  • 13,998
  • 7
  • 64
  • 124
3
votes
2 answers

Semantics of the 'store-value' and 'use-value' restarts in the Common Lisp error handling system

I've been reading the excellent book by Peter Seibel Practical Common Lisp in order to address some research I've been doing related with the Common Lisp error handling system. Although I have read the explanation in the book and tried to dig some…
Paulo Tomé
  • 1,910
  • 3
  • 18
  • 27
2
votes
1 answer

Is using handler-bind with a stateful closure valid?

Is this a conforming Common Lisp program? (handler-bind ((condition (let ((x 0)) (lambda (c) (declare (ignore c)) (print (incf x)))))) (signal 'condition) …
coredump
  • 37,664
  • 5
  • 43
  • 77
1
vote
1 answer

How to continue normal execution after exception in Common Lisp?

I want to catch unbound-variable exceptions and avoid them, creating some variables on-the-fly without execution breaks. I'm trying to use handler-bind with invoke-restart in the following code: (defmacro my-progn (&rest rest) `(handler-bind …
Pavel
  • 363
  • 1
  • 2
  • 14
1
vote
0 answers

What is condition system in R, frames?

I'm currently studying about frames, environments in R using Advanced R. But I can't quite understand the last paragraph of this section. The frame also holds exit handlers created with on.exit(), restarts and handlers for the condition system,…
HyeonPhil Youn
  • 428
  • 4
  • 11
0
votes
1 answer

How to query conditions for request in nestjs?

I want to implement a system for query conditions in requests. for example, if I want to say get objects with the id of less than 2 send this request. https://example.com/getObjects?id_less=2 Is there any way to do this in nestJS or express or…
NimiA
  • 1
  • 1
  • 6