[Openmcl-devel] Is this a bug? defstruct :type option

Raffael Cavallaro raffaelcavallaro at mac.com
Tue Dec 7 22:48:21 UTC 2004


In OpenMCL:

? (defstruct (v3 (:type (vector double-float 3)))
                x y z)
 > Error in process listener(1): Bad defstruct option (:TYPE (VECTOR 
DOUBLE-FLOAT 3)).
 > While executing: DEFSTRUCT
 > Type :POP to abort.
Type :? for other options.


In sbcl:

* (defstruct (v3 (:type (vector double-float 3)))
                x y z)

debugger invoked on a SB-KERNEL::ARG-COUNT-ERROR in thread 10167:
   error while parsing arguments to DESTRUCTURING-BIND:
     invalid number of elements in
       (VECTOR DOUBLE-FLOAT 3)
     to satisfy lambda list
       (VECTOR SB-KERNEL::VTYPE):
     exactly 2 expected, but 3 found

You can type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
   0: [ABORT   ] Reduce debugger level (leaving debugger, returning to 
toplevel).
   1: [TOPLEVEL] Restart at toplevel READ/EVAL/PRINT loop.
(SB-KERNEL::PARSE-1-DD-OPTION
  2
  (:TYPE (VECTOR DOUBLE-FLOAT 3))
  #<SB-KERNEL:DEFSTRUCT-DESCRIPTION V3>)[:EXTERNAL]
0]


However, clisp and LispWorks (Mac OS X) handle this defstruct type 
option just fine.

Is this a valid type specifier for defstruct?

regards,

Ralph

Raffael Cavallaro, Ph.D.
raffaelcavallaro at mac.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 1295 bytes
Desc: not available
URL: <http://lists.clozure.com/pipermail/openmcl-devel/attachments/20041207/475fcd3b/attachment.bin>


More information about the Openmcl-devel mailing list