View Single Post
Join Date: Jun 2005
Posts: 2,011
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 137
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is online now Online
Super Senior Demiposter

Re: Object Oriented Programming

 
0
  #10
Jan 23rd, 2007
Lisp certainly is object oriented, if that's what you want. With Lisp's macros and lexical scoping, you can do anything. Common Lisp was the first ANSI-standardized object oriented language, ever.

Common Lisp is not really a 'functional' programming language, it's a language that lets you program the way you want. It has variables that you may modify -- that are mutable -- so you can use it in a brain-dead manner the way you would use C. You could also choose not to modify your variables, and you have lexical scoping, which means you can use it in a functional manner. Scheme is better at that, though, since CL is kind of weird with its 'apply' and whatnot. Lisp certainly is better for object oriented programming than, say, C++ or Java, in the general sense.

The best language for programs that need to retain state, though, is Haskell, IMO. No other language handles state transformation in a better way. None that I've heard of.

Object orientedness is really about having objects pass messages to one another. The purpose of inheritance in languages like C++ is to allow for a form of dynamic typing. Object oriented is really a subset of what Lisp offers, since an object is nothing more than a function that takes some finite enumeration of method names as its first argument, along with a list of further arguments. Common Lisp has more explicit object orientation, with classes and the like.
Last edited by Rashakil Fol; Jan 23rd, 2007 at 9:06 pm.
All my posts may be redistributed under the GNU Free Documentation License.
Reply With Quote