Ticket #866 (closed defect: invalid)

Opened 4 years ago

Last modified 4 years ago

boa constructor supplied-p argument

Reported by: rme Owned by:
Priority: normal Milestone:
Component: Compiler Version: trunk
Keywords: Cc:

Description

From pro@…:

I tried to save a supplied-p parameter from a BOA constructor like this:

(defstruct (delayed-iseq
            (:constructor iseq (start-or-end 
                                &optional (end 0 end?) (by 1)
                                strict-direction?)))
 "Delayed index sequence evaluation."
 start-or-end end end? by strict-direction?)

but SBCL complained that end? was not used. After rereading the CLHS page for defstruct, I am still not 100% sure why this is. My intepretation is that END? is an argument like any other, but probably I am not getting something.

Change History

comment:1 Changed 4 years ago by gb

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

SBCL's behavior in this case isn't very interesting, but it happens to be correct (as does CCL's, Allegro's, ...)

Supplied-p variables in BOA constructor lambda lists aren't matched against slot names, but they can be used to provide default values for lambda-list variables that do match slot names.

(defstruct (delayed-iseq
            (:constructor iseq (start-or-end 
                                &optional (end 0 ENDP) (by 1)
                                strict-direction?)
                                &AUX ((END? ENDP))))
 "Delayed index sequence evaluation."
 start-or-end end end? by strict-direction?)

See section 3.4.6 of CLHS.

Note: See TracTickets for help on using tickets.