1.0.37.74: support NetBSD-current
[sbcl.git] / tests / destructure.impure.lisp
bloba611b476b373e6ac6a440b4a04ab09c83a112362
1 ;;;; tests, with side effects, of DESTRUCTURING-BIND-ish functionality
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5 ;;;;
6 ;;;; While most of SBCL is derived from the CMU CL system, the test
7 ;;;; files (like this one) were written from scratch after the fork
8 ;;;; from CMU CL.
9 ;;;;
10 ;;;; This software is in the public domain and is provided with
11 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
12 ;;;; more information.
14 ;;; In sbcl-1.0.7.8, the printer for the ERROR condition signalled from
15 ;;; (DESTRUCTURING-BIND (...) 1 ...)
16 ;;; contained the implicit assumption that the bad datum was a list,
17 ;;; so that attempting to print the condition caused a new error.
18 (defun frob-1-0-7-8 (x)
19 (destructuring-bind (y . z) x
20 (print y)
21 (print z)))
22 (multiple-value-bind (whatever error)
23 (ignore-errors (frob-1-0-7-8 1))
24 (declare (ignore whatever))
25 (princ error)) ; shouldn't cause an error