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?.
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
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
On 10 June 2011 22:09, Pascal Costanza pc@p-cos.net wrote:
I think this is a bug in SBCL, and should be reported with its maintainers.
It is. I'll commit a fix later today.
Cheers,
-- nikodemus