[pro] BOA constructor and supplied-p argument
![](https://secure.gravatar.com/avatar/f3826f09cda5af90d95b7df1268825b1.jpg?s=120&d=mm&r=g)
Hi, 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. Anyhow, instead I used (defstruct delayed-iseq "Delayed index sequence evaluation." start-or-end end end? by strict-direction?) (defun iseq (start-or-end &optional (end 0 end?) (by 1) strict-direction?) (make-delayed-iseq :start-or-end start-or-end :end end :end? end? :by by :strict-direction? strict-direction?)) Is there a way to do it in a single defstruct definition? Best, Tamas PS.: (eq end nil) is different from when it is not supplied, hence the need to save end?.
![](https://secure.gravatar.com/avatar/97f4835889e1a68c1f9f3d2d31d18fd2.jpg?s=120&d=mm&r=g)
I'm sure we all knew there had to be a good reason for &aux, but maybe we had trouble remembering what it might be? (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?) - n
![](https://secure.gravatar.com/avatar/d98f66ca82af3dbad2fa1f9c84017055.jpg?s=120&d=mm&r=g)
I think this is a bug in SBCL, and should be reported with its maintainers. Pascal On 10 Jun 2011, at 16:53, Tamas K Papp wrote:
Hi,
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.
Anyhow, instead I used
(defstruct delayed-iseq "Delayed index sequence evaluation." start-or-end end end? by strict-direction?)
(defun iseq (start-or-end &optional (end 0 end?) (by 1) strict-direction?) (make-delayed-iseq :start-or-end start-or-end :end end :end? end? :by by :strict-direction? strict-direction?))
Is there a way to do it in a single defstruct definition?
Best,
Tamas
PS.: (eq end nil) is different from when it is not supplied, hence the need to save end?.
_______________________________________________ pro mailing list pro@common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/pro
-- Pascal Costanza
participants (4)
-
Nick Levine
-
Nikodemus Siivola
-
Pascal Costanza
-
Tamas K Papp