From: Hallvard Traetteberg
Subject: defstruct bug in Allegro CL
Date: 
Message-ID: <33EFF622.4798@idt.unit.no>
Hi,

I think I've stumbled upon a bug in Allegro CL 4.3 [SPARC; R1]
The following is supposed to define a constructor, where a :b
keyword is used to initialize the a slot, or else default to c.

(defstruct (test (:constructor make-test (&key c ((:b a) c))))
  (c nil)
  (a nil)
  )

However, the a slot isn't initialized correctly, as the
following example shows:

(make-test :b 1) => #S(TEST :C NIL :A NIL)
instead of #S(TEST :C NIL :A 1)

And
(make-test :c 1) => #S(TEST :C 1 :A NIL)
instead of #S(TEST :C 1 :A 1)

The behavior I expected is described in CLtL II as an extension
to CLtL I, and in the web manual of Harlequin in
http://www.harlequin.com/education/books/HyperSpec/Body/sec_3-4-6.html
and
http://www.harlequin.com/education/books/HyperSpec/Issues/iss109-writeup.html.

An alternative defstruct form is

(defstruct (test (:constructor make-test (&key c b (a (or b c)))))
  (c nil)
  (a nil)
  )

However, this makes :a a valid keyword and I want to avoid that.

And while at it, REDUCE still doesn't accept the :key keyword argument.

Any patches available?

Hallvard