Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#1060 closed defect (worksforme)

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

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


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 (2)

comment:1 Changed 7 years ago by gb

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

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 7 years ago by rme is the section in the spec about constraints on the CL package for conforming implementations. This doesn't mention setf function names. 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 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)
=> 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.