Tweak MERGE of 2 vectors into a vector.
[sbcl.git] / src / code / cmacros.lisp
blobbb71c0b5527659f3cb54458f787aec31100f5d96
1 ;;;; Compiler macros that are important for the target system
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5 ;;;;
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
12 (in-package "SB!IMPL")
14 ;;;; We often use a source-transform to do macro-like rewriting of an
15 ;;;; ordinary function call. Source-transforms seem to pre-date the ANSI
16 ;;;; specification and are redundant with compiler-macros.
17 ;;;; In the interest of not multiplying entities needlessly, it should
18 ;;;; be feasible to get rid of source-transforms.
19 ;;;; A problem is namespace clobbering: these must not affect the host Lisp.
21 (define-compiler-macro append (&whole form &rest lists)
22 (case (length lists)
23 (0 nil)
24 (1 (car lists))
25 (2 `(append2 ,@lists))
26 (t form)))
28 ;;; A sanity-checker for an extremely common programmer error.
29 (define-compiler-macro format (&whole form destination control &rest args)
30 (declare (ignore control args))
31 (when (stringp destination)
32 (warn "Literal string as destination in FORMAT:~% ~S" form))
33 form)