defsetf不能定义last与nthcdr

Bug #1756241 reported by liushizhi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Invalid
Undecided
Unassigned

Bug Description

在windows系统中:
在clozure common lisp中:?(defsetf nthcdr (index lst)(ele)......)返回NTHCDR
在clisp中:(defsetf nthcdr (index lst)(ele)......)返回NTHCDR
在steel bank common lisp中:(defsetf nthcdr (index lst)(ele)...)--error

; in: DEFSETF NTHCDR
; (LAMBDA (INDEX LST) (BLOCK NTHCDR 1))
; ==>
; #'(LAMBDA (INDEX LST) (BLOCK NTHCDR 1))
;
; caught STYLE-WARNING:
; The variable INDEX is defined but never used.
;
; caught STYLE-WARNING:
; The variable LST is defined but never used.

; (SB-INT:NAMED-LAMBDA (SB-IMPL::%DEFSETF NTHCDR)
; (#:SUBFORMS #:ENV ELE)
; (DECLARE (SB-C::LAMBDA-LIST (INDEX LST)))
; (DECLARE (IGNORE #:ENV))
; (APPLY (LAMBDA (INDEX LST) (BLOCK NTHCDR 1)) #:SUBFORMS))
;
; caught STYLE-WARNING:
; The variable ELE is defined but never used.
;
; compilation unit finished
; caught 3 STYLE-WARNING conditions

debugger invoked on a SYMBOL-PACKAGE-LOCKED-ERROR in thread
#<THREAD "main thread" RUNNING {23D30061}>:
  Lock on package COMMON-LISP violated when defining a setf-expander for NTHCDR
  while in package COMMON-LISP-USER.
See also:
  The SBCL Manual, Node "Package Locks"
  The ANSI Standard, Section 11.1.2.1.2

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE ] Ignore the package lock.
  1: [IGNORE-ALL ] Ignore all package locks in the context of this operation.

  2: [UNLOCK-PACKAGE] Unlock the package.
  3: [ABORT ] Exit debugger, returning to top level.

(PACKAGE-LOCK-VIOLATION #<PACKAGE "COMMON-LISP"> :SYMBOL NTHCDR :FORMAT-CONTROL
"defining a setf-expander for ~A" :FORMAT-ARGUMENTS (NTHCDR))

Revision history for this message
Christophe Rhodes (csr21-cantab) wrote : Re: [Bug 1756241] [NEW]defsetf不能定义last与nthcdr

 status invalid
 done

Hi,

liushizhi <email address hidden> writes:

> See also:
> The SBCL Manual, Node "Package Locks"
> The ANSI Standard, Section 11.1.2.1.2

The reason that this is an error in SBCL is documented in these sections
of the manual and the CL standard.

Christophe

Changed in sbcl:
status: New → Invalid
Revision history for this message
Paul F. Dietz (paul-f-dietz) wrote :

A user can write conforming CL for this by shadowing NTHCDR with their own symbol. The definitions for this can of course invoke CL:NTHCDR as needed.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.