Кто изобрел бросок/попытку/выгоду [/наконец] вид обработки ошибок?

Моими вопросами является больше исторической природы, чем практичный:

  1. Кто изобрел его?
  2. Какой язык использовал его сначала (и до какой степени)?
  3. Какова была исходная идея, базовое понятие (какие фактические проблемы должны были быть решены в эти дни, приветствующиеся бумаги)?
  4. Действительно ли система условия LISP является предком текущей обработки исключений?

14
задан Frunsi 13 December 2009 в 23:51
поделиться

3 ответа

Today's Common Lisp condition system is a relative newcomer. The design was based on previous systems, but wasn't included as part of the Common Lisp language until the late 80's around the time of CLTL2

I believe the conditions chapter in that book has a fair amount commentary on the history and background of the design, and references to related research and prior implementations of similar systems.

5
ответ дан 1 December 2019 в 15:21
поделиться

The VAX CPUs had a stack-based exception handling system. In every call frame, one 32-bit cell was allocated and filled with a zero. If the subroutine being called wanted to handle exceptions, all it had to do was fill in that cell with the address of the exception-handling routine.

When an exception took place, a stack search would occur. This was easy, since the stack frames were all chained together. The first stack frame with a non-zero entry would cause an stack unwind to that point, and the exception handler would be called.

I remember this as being one of the features of the processor which were aimed at higher-level languages, but I don't know that there was a higher-level language that took advantage of the feature. I believe it was used by library code, which would likely have been written in assembler.

4
ответ дан 1 December 2019 в 15:21
поделиться

Doesn't it go back to the setjmp, longjmp functions in C? Richie, Kernighan, et al?

0
ответ дан 1 December 2019 в 15:21
поделиться
Другие вопросы по тегам:

Похожие вопросы: