|
From: SourceForge.net <no...@so...> - 2011-10-03 08:07:03
|
Bugs item #3417358, was opened at 2011-10-03 01:45 Message generated for change (Comment added) made by haible You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3417358&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clisp Group: ANSI compliance issue Status: Open Resolution: None Priority: 5 Private: No Submitted By: Pascal J. Bourguignon (informatimago) Assigned to: Bruno Haible (haible) Summary: 22.1.3.5 conformance Initial Comment: As per 22.1.3.5, (write (quote (john (quote s) weight)) :pretty nil :readably nil) should print (JOHN (QUOTE S) WEIGHT) but instead it prints: (JOHN 'S WEIGHT) [and similarly for :readtably t, it prints: (|COMMON-LISP-USER|::|JOHN| '|COMMON-LISP-USER|::|S| |COMMON-LISP-USER|::|WEIGHT|) instead of: (|COMMON-LISP-USER|::|JOHN| (|CL|:|QUOTE| |COMMON-LISP-USER|::|S|) |COMMON-LISP-USER|::|WEIGHT|) ] ======================================================================== Implementation: CLISP 2.49 (2010-07-07) (built 3499302370) (memory 3499302538) on X86_64 Reading of: "(write (quote (john (quote s) weight)) :pretty nil :readably nil)" signaled no error Evaluation of: (WRITE '(JOHN 'S WEIGHT) :PRETTY NIL :READABLY NIL) signaled no error wrote nothing on *ERROR-OUTPUT* wrote the following *STANDARD-OUTPUT* (lines excluded): ------------------------------------------------------------------------ (JOHN 'S WEIGHT) ------------------------------------------------------------------------ returned the following value: --> (JOHN 'S WEIGHT) ======================================================================== ---------------------------------------------------------------------- >Comment By: Bruno Haible (haible) Date: 2011-10-03 10:07 Message: Your interpretation of CLHS 22.1.3.5 is debatable. CLHS never explicitly says under which conditions it is OK to print (QUOTE FOO) as 'FOO. Likewise for backquote, for which clisp has an elaborate algorithm. Therefore IMO it's an omission. CLHS 22.1.3.5 says "list notation is preferred over dot notation". It does not say "list notation is preferred over quote and backquote notation". The description of *print-readably* says that the "standard readtable" can be assumed when reading objects. Therefore you can assume that the read-macro for #\' is in place, as much as you can assume that the read-macros for #\( and #\) are in place. The rationale for clisp's behaviour is that the symbol QUOTE, when it occurs in lists, most often occurs when printing a piece of a program. In this case, printing 'FOO instead of (QUOTE FOO) is always a win in legibility. Changing clisp to print (QUOTE FOO) when *print-pretty* is false -- like SBCL does -- would be a regression, IMO. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=3417358&group_id=1355 |