Subject: Re: lisp-1 v lisp-2 (<whine>Can't we all just get along?...
From: rpw3@rpw3.org (Rob Warnock)
Date: Thu, 29 May 2003 05:42:17 -0500
Newsgroups: comp.lang.lisp
Message-ID: <N_ednVayi8aUeUij4p2dnA@speakeasy.net>
[Perhaps getting a bit silly here, but...]

Kent M Pitman  <pitman@world.std.com> wrote:
+---------------
|  (print '(defun foo nil nil)) 
| with no language context is going to either print
| 
|    (DEFUN FOO NIL NIL)
+---------------

Which is what CLISP prints.

+---------------
| You really want
|    (DEFUN FOO () #f)
| and that's going to be hard to achieve without some contextual knowledge.
+---------------

Well, (unlike CLISP) CMUCL actually *does* print the CL version of that!

    > (print '(defun foo nil nil)) 

    (DEFUN FOO () NIL) 
    (DEFUN FOO () NIL) 
    >

+---------------
| [You might want to check whether you can tailor the pretty-printer to 
| do the right thing.  It has, or can be made to have, just about enough 
| contextual knowledge... I think.
+---------------

I think so, too. See above.  ;-}  ;-}

+---------------
| Then again, even the pretty printer is unlikely to get
|  (cons 'nil 'nil)
| right, since this probably should print as
|  (cons 'nil '())
| and I'm not sure it's really up to knowing what kind of argument
| every function needs or wants.]
+---------------

FWIW, both CLISP & CMUCL print "(NIL)" for that.
[Or were you really asking about (quote (cons 'nil 'nil))?]


-Rob

-----
Rob Warnock, PP-ASEL-IA		<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607