a3b755052ba457767dadbf9100adf382ce8436a8
[sbcl.git] / src / code / destructuring-bind.lisp
1 ;;;; This software is part of the SBCL system. See the README file for
2 ;;;; more information.
3 ;;;;
4 ;;;; This software is derived from the CMU CL system, which was
5 ;;;; written at Carnegie Mellon University and released into the
6 ;;;; public domain. The software is in the public domain and is
7 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
8 ;;;; files for more information.
9
10 (in-package "SB!IMPL")
11
12 (file-comment
13   "$Header$")
14
15 (defmacro-mundanely destructuring-bind (lambda-list arg-list &rest body)
16   #!+sb-doc
17   "Bind the variables in LAMBDA-LIST to the contents of ARG-LIST."
18   (let* ((arg-list-name (gensym "ARG-LIST-")))
19     (multiple-value-bind (body local-decls)
20         (parse-defmacro lambda-list arg-list-name body nil 'destructuring-bind
21                         :anonymousp t
22                         :doc-string-allowed nil)
23       `(let ((,arg-list-name ,arg-list))
24          ,@local-decls
25          ,body))))