source: branches/qres/ccl/lib/print-db.lisp @ 14308

Last change on this file since 14308 was 13070, checked in by gz, 10 years ago

r13066, r13067 from trunk: copyrights etc

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.4 KB
Line 
1; -*- Mode:Lisp; Package:CCL; -*-
2;;;
3;;;   Copyright (C) 2009 Clozure Associates
4;;;   Copyright (C) 1994-2001 Digitool, Inc
5;;;   This file is part of Clozure CL. 
6;;;
7;;;   Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
8;;;   License , known as the LLGPL and distributed with Clozure CL as the
9;;;   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
10;;;   which is distributed with Clozure CL as the file "LGPL".  Where these
11;;;   conflict, the preamble takes precedence. 
12;;;
13;;;   Clozure CL is referenced in the preamble as the "LIBRARY."
14;;;
15;;;   The LLGPL is also available online at
16;;;   http://opensource.franz.com/preamble.html
17
18(in-package "CCL")
19
20(defmacro print-db (&rest forms &aux)
21  `(multiple-value-prog1
22     (progn ,@(print-db-aux forms))
23     (terpri *trace-output*)))
24
25(defun print-db-aux (forms)
26   (when forms
27     (cond ((stringp (car forms))
28            `((print ',(car forms) *trace-output*)
29              ,@(print-db-aux (cdr forms))))
30           ((null (cdr forms))
31            `((print ',(car forms) *trace-output*)
32              (let ((values (multiple-value-list ,(car forms))))
33                (prin1 (car values) *trace-output*)
34                (apply #'values values))))
35           (t `((print ',(car forms) *trace-output*)
36                (prin1 ,(car forms) *trace-output*)
37                ,@(print-db-aux (cdr forms)))))))
38
39
Note: See TracBrowser for help on using the repository browser.