Your example is slightly wrong. It has to be:
(defclass foo ()
((data1 :initarg foo)))
Notice the added parentheses to indicate a list of slot descriptions.
DEFCLASS takes a list of slots. So with two slots we have:
(defclass foo ()
((data1 :initarg :data1arg
:initform (random 1.0)
:type number
:documentation "doc here"
:accessor foo-data1-acc)
(data2 :initarg :data2arg)))
DATA1 is the name of the slot. Behind that you find pairs of :keyword value.
:INITARG tells you what the parameter for MAKE-INSTANCE is.
(make-instance 'foo :data1arg 10) ; creates the object and sets the slot data1 to 10.
Usually you should use a keyword symbol (like :data1arg here).
:INITFORM sets the slot by default, when the object is created. Like in:
(make-instance 'foo) ; creates the object. The slot is set to the value of the initform.
:TYPE specifies the type of the slot's object.
:DOCUMENTATION is just a string for, well, documentation.
:ACCESSOR specifies a function to read and write the slot.
(foo-data1-acc some-foo-object-here) ; read
(setf (foo-data1-acc some-foo-object-here) 7) ; write
Note that you can write the pairs in any order and that you can also specify multiple accessor functions. There are also :READER and :WRITER functions.
With CLOS you can specify all that within the DEFCLASS macro. These things are not automatically generated like in defstruct, which has a shorter notation.
The description of DEFCLASS is here: DEFCLASS.
Short CLOS Intro.