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

Questions on CLOS specification

Questions and comments on Common Lisp Object System Specification

by Masayuki Ida, Japan
with the contributions of:
N. Saji (NEC), Yokoo (NTT), Ohkubo (panaFacom), Shiota (Nippon Symbolics),
Kawabe (Nippon UNIVAC), Nishida (Fuji Xerox)

Basically We are welcome to have an object system for Common Lisp.
Though we have no more experience to read the CLOS Specification,
we send this mail to CL-Object-system bboard as our first impression memo
I hope it may assist the discussion on the comming meeting at Palo Alto.

1>> make-specializable
  PCL has a make-specializable. How can we add method for a Common Lisp
  (defmethod print ...) give us a special procedure to handle special case
  on print in PCL.

2>> initialization protocol of make-instance
  Page 1-5 says "The initialization protocol of make-instance is not yet specified."
  It seems to arise many difficulties if the initialization protocol
  will not be specified. We recommend meta object protocol should be included.
  observation : there is no :initable-instance-variable thing of Flavors
  in CLOS.
  :init qualifier of Flavors is not included. So, we need meta object.

3>> defrecord
  Where is defrecord syntax ?

4>> allocation slot option
  there is no :none allocation
  :none allocation allows us to eliminate the not-needed inherited slots allocation.
  We prefer :none be included

5>> allocation option 2
  there seems to be a :dynamic allocation.
  But there is no explanation on :dynamic.

6>> page 1-6 Accessing Slots
  "The macro with-slots can be used to set up a lexical environment in which
  certain slots are lexically available"
  What is the definition of 'lexical environment' in this context ?
  it only says the slot name shadows the same name symbol if any ?

7>> page 1-7 Inheritance of Slots and Slot options
  there is no story on :dynamic
  :instnce story contains the story for :dynamic ?

8>> page 1-8 Ti can be a Common Lisp Type
  Why does a class NOT allowed to be a :type ?
  If we can write a class name for a :type, with the assistance of metaclass
  idea, we can do more interest things like active-value with simple

9>>page 1-9 7L (and T1 ... Tn)
  It is too severe restriction on type.

10>> Examples of Inheritance
  what is the intension of the example ?

11>> Redefining Classes : Slot renaming
  Is it possible to rename the slot ?
  class-changed enable it ?
  Is it truely possible ?
  Accessor for old-name is safely deleted if w can rename slot by class-changed ?

12>> Redefining Classes : change-class
  Is it possible to go to a quite different class ?
  If it is OK to go to a quite different class,
  a type-conversion may occur for the same slot with different types
  between the old and the new ?
  the intention of change-class is like the become: of smalltalk ?
  become: plays a role to grow the instance, but we feel
  change-class have a more flexible power ?

13>> Page 1-13 Integrating Types and Classes
  How about the following story ?
  split types into three categolies
  1) Essential types; which are the terminal types just above the nil type.
  they will be the defined most-specific types.
  2) Defined types; which are the types defined in CLtl except Essential types.
  3) system dependent types; which are the types defined in the specific
  It is not allowed for the value of class-of to be a type of 3).
  The system must return the type of Essential types if the object belong to
  the type upon class-of invocation.

14>> Page 1-14 'require'
  "We require that an implementation of Common Lisp Object System signal an 
  error if R is inconsistent,..."
  What the word 'require' mean in this case ?

15>> Page 1-15 Examples ; the sequence of defclasses
  (defclass pie (apple cinnamon) ())
  appeared first. It means apple and cinnamon definitions are NOT needed prior to defclassing pie ?

16>> Page 1-17 Local generic function
  Are there any true possibility to have a local (lexical) generic functions ?
  There was a discussion on mlet thing.Mlet will revival ?

17>> individual method with unreadable object
  Is it possible to QUOTE unreadable object on defmethoding ?
  Say, can we write a trap routine which is invoked upon the access to specific memory location ?

18>> we feel (not ..) and (or ..) syntax for defmethod parameter-specializer-name should be included.
  (defmethod foo ((x (or symbol simple-string character))) ...)
  (defmethod foo ((x (not null))) ...)

19>> Page 1-20 Congruent Lambda-lists
  Consider the following three cases.
  1) the case where we need to have a method specifying the classes for optional parameter
  (defmethod foo ((x foo)(y bar) &optional z) ...)
  (defmethod foo ((x foo)(y bar) (z baz) &optional zz) ...)
  2) generic operation concept with different numbers of arguments.
  (defmethod rotate ((x 2d-position)(theata number)) ...)
  (defmethod rotate ((x 3d-position)(theata number)(rou number)) ...)
  3) extending the current methods to new methods with more arguments.
  OLD (defmethod foo ((x ...) (y ...)) ...)
  NEW (defmethod foo ((x ...)(y ...)(z ...)) ...)
  there will be a transient status where the two argument version and 
  three argument version co-exist.

  We feel the congruence should get to be more loose.

20>> call-next-method
  call-next-method has no arguments.
  Then the arguments are from the lambda list of the current method.
  this means the arguments can be modified before call-next-method ?
  The modified value are passed to the next-method ?

21>> add-method
  the first argument is preferable to be a name,not a generic function object
  itself. But we also understand the add-method is generic function itself,
  so, it is not possible to write a name for the first argument.
  Is it impossible to define add-method as a function ?

22>> Page 2-9 5L
  is it allowed to supply :x 2 :y 0 without initable declaration or something ?
  there is no concept of inittable decralation ?

23>> Page 2-11 class-changed
  Remarks says "It is not possible to define methods on class-changed by using defmethod"
  But Page 2-8 example uses defmethod to define class-changed ?

24>> Page 2-16 class-option
  there is no initable related option ?

25>> Page 2-50 multiple-value-prog2
  why multiple-value-prog2 is included as a part of CLOS ?
  it should goto more general discussion ?
  (I know multiple-value-prog2 is used in define-method-combination)