Ticket #1060 (closed defect: worksforme)

Opened 19 months ago

Last modified 19 months ago

(SETF STREAM-EXTERNAL-FORMAT) shouldn't be defined.

Reported by: gb Owned by:
Priority: minor Milestone:
Component: ANSI CL Compliance Version: trunk
Keywords: Cc:

Description

The ability to change the EXTERNAL-FORMAT of an open stream is sometimes useful and CCL defines (SETF STREAM-EXTERNAL-FORMAT) to do this.

ANSI CL doesn't allow an implementation to define SETF functions or expanders on CL function names that aren't explicitly allowed to work with SETF, so this function should be renamed to something like CCL:SET-STREAM-EXTERNAL-FORMAT.

Change History

comment:1 Changed 19 months ago by gb

  • Status changed from new to closed
  • Resolution set to worksforme

Actually, "the results are undefined" if user code does this, but I don't think that the implementation is prohibited from doing so.

comment:2 Changed 19 months ago by rme

 http://www.lispworks.com/documentation/HyperSpec/Body/11_abaa.htm is the section in the spec about constraints on the CL package for conforming implementations. This doesn't mention setf function names.

 http://www.lispworks.com/documentation/HyperSpec/Issues/iss252_w.htm is the PACKAGE-CLUTTER writeup. This is non-normative of course, but interestingly, this proposal explicitly mentions setf function names, and proposes to forbid them unless the setf function in question is explicitly standardized. In language lawyer mode, then, I wonder if the fact that 11.1.2.1.1 doesn't mention setf function names is intentional.

Additionally, I believe that some implementations (at least SBCL) define a setf expander for logbitp so that you can write something like

(let ((x 8))
  (setf (logbitp 1 x) t)
  x)
=> 10

I'm not suggesting that we add that, by the way. I think it's silly. But it's an additional indication that seems to support your position that it's not forbidden for an implementation to define additional setf functions or expanders on CL function names.

Note: See TracTickets for help on using tickets.