[comp.lang.lisp] Programming style with OOPS....

jonnyg@umd5.umd.edu (Jon Greenblatt) (05/16/89)

	I have been using OOPS for a year now and am becoming fairly
comfortable with it. I started with Actor which is a pure object oriented
language and moved to Xlisp which is a Actor like lisp.

	Now that I am using OO lisp my lisp programing style has changed
considerably. I first changed the syntax of xlisp to use { and } to
delimit message sends so (send object :message parms) is now
{object :message parms}. The major style change that I have taken is
to completely eliminate function declarations in lisp and replace
them with method declarations. I find by doing this my symbol space
becomes much less cluttered with global function declarations and global
variables. My data space is much less cluttered and method names can
be made more understandable since they are only defined for that object
instead of having to be globaly unique.

	I feel that OOPS has made lisp programing more managable and usable.
An entire environment can be easily encapsulated onto one object and have
no undesired side effects. Using Xlisp, the class variables can be used
to define object classes and methods within a class that are private to
that class:

(setf public_class {Class :new '(Instance vars) '(private_class) Object})

{public_class :answer :isnew '() '(
	(unless private_class
		(setf private_class
			{Class :new '(Instance vars) '(Class vars) SuperClass})
		{private_class :asnwer :method1 '(parms) '((do this))})
	(other initialization)
	)}

	This particular ability to define private classes is not available
in Actor but is in Xlisp. I feel a responsable, consistant use of OOPS
in lisp programming can take lisp out of the closet and make real developement
in it more pratical than it is now. Lisp is somewhat object oriented in
itself, restricting programming slyle in the ways I have mentioned will
enhance the object oriented properties already found in lisp.

	I hope this note will raise a descussion in this group on OOPS
programming stlye in lisp. I think too little though is spent on programming
style these days.

						JonnyG.
					(jonnyg@umd5.umd.edu)
					(jonnyg@rover.umd.edu)