[pro] BOA constructor and supplied-p argument
Pascal Costanza
pc at p-cos.net
Fri Jun 10 19:09:50 UTC 2011
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 at common-lisp.net
> http://lists.common-lisp.net/cgi-bin/mailman/listinfo/pro
--
Pascal Costanza
More information about the pro
mailing list