[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

defstruct,cmpinclude.h



cmpinclude.h:
Several people have suggested using the -I feature for cmpinclude.h
which is exactly what akcl has been doing for the past year or two.

However when you have a number of lisp images on one machine eg nqthm,
maxima, affine, gve, gypc .. you don't want to have to update them all
each time you update AKCL.  AKCL generally does not need to know a
system directory.  So one image is a free standing entity, and a
change to the akcl directory won't affect it.  People here were
constantly forgetting to make a private copy of cmpinclude.h and alter
the *cc* string appropriately when they saved an image.  Then they
would complain when the cmpinlcude.h their image was pointing to got
changed.  [I am afraid this even happened to me--but I had no one to
complain to but myself].

Defstruct:
Include of named typed structures:
I believe a careful reading of the manual indicates that
if test-struct is named and type vector, its first element should
be test-struct [if no initial offset and no include] 

If test-struct2 is type vector and includes test-struct it should also
satisfy test-struct-p [which according to the manual just checks if
the first element of the vector is eq to test-struct --see binop-p
example].  Therefore we can't put test-struct2 in the first slot.
[see example of annotated-binop].  Now if test-struct2 is named then
this has to be recorded somewhere hence the extra slot for the second
name.

Incidentally lucid [at least the release we have] behaves the
same as AKCL on this point:

    (defstruct (test-struct (:type vector)
                            :named
                            :conc-name
                            ;(:constructor nil)
			    )
      first second third)

    (defstruct (test-struct2 (:type vector)
                             :named
                             (:include test-struct)
                             :conc-name
                             ;(:constructor nil)
			     )
      fourth fifth sixth)

> (make-test-struct)
#(TEST-STRUCT NIL NIL NIL)
> (make-test-struct2)
#(TEST-STRUCT NIL NIL NIL TEST-STRUCT2 NIL NIL NIL)