Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Clojure and OOP
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  14 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
HB  
View profile  
 More options Feb 11 2010, 7:46 am
From: HB <hubaghd...@gmail.com>
Date: Thu, 11 Feb 2010 04:46:55 -0800 (PST)
Local: Thurs, Feb 11 2010 7:46 am
Subject: Clojure and OOP
Hey,
Since Clojure is a LISP dialect, does this mean that it doesn't
support OOP?
Thanks.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Timothy Pratley  
View profile  
 More options Feb 11 2010, 8:00 am
From: Timothy Pratley <timothyprat...@gmail.com>
Date: Thu, 11 Feb 2010 23:00:32 +1000
Local: Thurs, Feb 11 2010 8:00 am
Subject: Re: Clojure and OOP
On 11 February 2010 22:46, HB <hubaghd...@gmail.com> wrote:

> Since Clojure is a LISP dialect, does this mean that it doesn't
> support OOP?

You might find this article interesting:
http://blog.thinkrelevance.com/2009/8/12/rifle-oriented-programming-w...

And related:
http://stackoverflow.com/questions/1517855/clojure-allows-encapsulati...

Regards,
Tim.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Reeves  
View profile  
 More options Feb 11 2010, 9:08 am
From: James Reeves <weavejes...@googlemail.com>
Date: Thu, 11 Feb 2010 06:08:12 -0800 (PST)
Local: Thurs, Feb 11 2010 9:08 am
Subject: Re: Clojure and OOP
On Feb 11, 12:46 pm, HB <hubaghd...@gmail.com> wrote:

> Hey,
> Since Clojure is a LISP dialect, does this mean that it doesn't
> support OOP?
> Thanks.

To quote Dr. Alan Kay:

"OOP to me means only messaging, local retention and protection and
hiding of state-process, and extreme late-binding of all things. It
can be done in Smalltalk and in LISP. There are possibly other systems
in which this is possible, but I'm not aware of them."

I suspect that Clojure is actually more suited to OOP than Java,
assuming you're going by Dr. Kay's definition. :)

- James


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joel Westerberg  
View profile  
 More options Feb 11 2010, 7:52 am
From: Joel Westerberg <joel.westerb...@gmail.com>
Date: Thu, 11 Feb 2010 13:52:46 +0100
Local: Thurs, Feb 11 2010 7:52 am
Subject: Re: Clojure and OOP

You can work with java objects. But clojure itself is not object oriented,
because it's functional, and object orientation requires state manipulation.
Other lisps support object orientation, common-lisp for example.

cheers,

/J


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff Schwab  
View profile  
 More options Feb 11 2010, 9:46 am
From: Jeff Schwab <j...@schwabcenter.com>
Date: Thu, 11 Feb 2010 09:46:45 -0500
Local: Thurs, Feb 11 2010 9:46 am
Subject: Re: Clojure and OOP

Joel Westerberg wrote:
> You can work with java objects. But clojure itself is not object
> oriented, because it's functional, and object orientation requires state
> manipulation.

By whose definition?  Are you saying there is no such thing as an
immutable object?

> Other lisps support object orientation, common-lisp for
> example.

Clojure is not purely functional.  In fact, it has special support for
managing mutable state in coherent ways.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Laurent PETIT  
View profile  
 More options Feb 11 2010, 10:11 am
From: Laurent PETIT <laurent.pe...@gmail.com>
Date: Thu, 11 Feb 2010 16:11:02 +0100
Local: Thurs, Feb 11 2010 10:11 am
Subject: Re: Clojure and OOP
The problem is about the overloading of the "object based" expression.

A step forward could be to recognize that:
 * Java is a weak/simplified version of a class based language
(simplifications made for several well known reasons: ease of adoption
by C/C++ crowd: - algol like syntax-, reduced functionalities for
debatable reasons: e.g. no C++ multiple
inheritence/templates/pointers-, not fully class based for debatable
performance reasons: primitive types, not everything is a class
method). It did at least have the good property of popularizing the
JVM and the notion of garbage collection, to cite the most evident to
me.
 * Javascript (at least in its ancestral forms, don't know for sure
since the later ECMA standardizations) is a prototype based language
=> true object orientation, methods "belong" to objects, not to their
classes (by belong, I mean one can redefine methods on an object
basis)
 * Smalltalk is a pure class based language. No static methods in
smalltalk, thanks to its correct use of the meta-class concept.

 * Clojure is a pragmatic language, function based, with a clear story
for managing the parts of your application which require manipulation
of internal (essential) state, or external (I/O resources) state.

I don't know if it is at all possible to map the "concept" of "object
orientation" to one category and not the other ...

2010/2/11 Jeff Schwab <j...@schwabcenter.com>:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Pall  
View profile  
 More options Feb 11 2010, 10:57 am
From: John Pall <johnabcd.a...@gmail.com>
Date: Thu, 11 Feb 2010 07:57:43 -0800 (PST)
Local: Thurs, Feb 11 2010 10:57 am
Subject: Re: Clojure and OOP
can we creat threads in clojure?

On Feb 11, 8:11 pm, Laurent PETIT <laurent.pe...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michał Marczyk  
View profile  
 More options Feb 11 2010, 1:01 pm
From: Michał Marczyk <michal.marc...@gmail.com>
Date: Thu, 11 Feb 2010 19:01:17 +0100
Local: Thurs, Feb 11 2010 1:01 pm
Subject: Re: Clojure and OOP
On 11 February 2010 13:46, HB <hubaghd...@gmail.com> wrote:

> Hey,
> Since Clojure is a LISP dialect, does this mean that it doesn't
> support OOP?
> Thanks.

Regardless of whether Clojure supports OOP, not supporting it
certainly doesn't follow from being a Lisp dialect. Take a look at
CLOS (Common Lisp Object System), for instance. Incidentally, CLOS
was, AFAIK, originally engineered as a package of macros and functions
built on top of CL's core and only later included in the language
standard.

Similarly for being functional: apart from Clojure, Ocaml and F# offer
OOP-like syntactic features in otherwise mostly functional language
packages. While for F# this might be considered an interop feature,
that's certainly not the case with Ocaml.

I'm ill prepared to debate the correct definition of object
orientation, so I won't offer one, but at the very least I feel
justified in believing that there simply isn't one superior approach
to OOP (personally, I'm partial to the approach of not prodding it
with less than a 10 foot pole, but... um... never mind). If anything,
Clojure's being a Lisp makes it easier to come up with your own
approach, code it up and use it.

And then the Java approach is obviously directly accessible through
the Java interop facilities; perhaps not all of it at this stage, but
enough to give one's code quite a Javaish smell if one so desires.

Sincerely,
Michał


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
.Bill Smith  
View profile  
 More options Feb 11 2010, 1:14 pm
From: ".Bill Smith" <william.m.sm...@gmail.com>
Date: Thu, 11 Feb 2010 10:14:58 -0800 (PST)
Local: Thurs, Feb 11 2010 1:14 pm
Subject: Re: Clojure and OOP
Instead of getting caught up in whether or not it supports OOP, and
how to define OOP, I recommend watching
http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey.

On Feb 11, 6:46 am, HB <hubaghd...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tayssir John Gabbour  
View profile  
 More options Feb 11 2010, 1:16 pm
From: Tayssir John Gabbour <tayssir.j...@googlemail.com>
Date: Thu, 11 Feb 2010 10:16:17 -0800 (PST)
Local: Thurs, Feb 11 2010 1:16 pm
Subject: Re: Clojure and OOP
Hi,

On Feb 11, 1:46 pm, HB <hubaghd...@gmail.com> wrote:

> Since Clojure is a LISP dialect, does this mean that it doesn't
> support OOP?

Careful not to come to the conclusion that if something's a Lisp, it's
not OOP.
For instance, Common Lisp has a powerful OOP system which includes
multiple-inheritance, metaobject protocol, and so forth.
http://en.wikipedia.org/wiki/Common_Lisp_Object_System

The world is a bit upside-down. I suspect people would look at me
strangely if I claimed that C++ wasn't seriously OOPish. However, Alan
Kay claimed:

    "Actually I made up the term "object-oriented", and I can tell you
    I did not have C++ in mind."
    -- http://video.google.com/videoplay?docid=-2950949730059754521

... and later in that video strongly regrets coining the term, as it
gives the wrong impression.

OOP is a term which can mean many (even conflicing?) things, as
Jonathan Rees discussed:
http://www.paulgraham.com/reesoo.html

As for Clojure, Rich Hickey claims it's not OOP. I guess he means
this: Instead of modelling me as an object whose internal state
changes as I change (from moment to moment), you instead model me as a
reference which points to a different immutable value as I change.
That is, I'm a different person from the one a few seconds ago; just
that my identity points to the most recent version of me.

(As a software optimization, those immutable versions may share
significant structure.)

This means that if you took a snapshot of me (an immutable value),
that snapshot won't change. You'll just have an old version of me. But
in a traditional OOP language, if you had a pointer to my object, that
object could be updated willy-nilly by other threads; you'd need to
make a threadsafe deep copy of me or something, to have an immutable
snapshot.

I hope I grok the Clojure Way well enough that my explanation is
right.
http://clojure.org/state

Incidentally, you could create your own OOP system on top of Clojure,
if you wish.

All the best,
Tayssir


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Newman  
View profile  
 More options Feb 11 2010, 1:54 pm
From: Richard Newman <holyg...@gmail.com>
Date: Thu, 11 Feb 2010 10:54:14 -0800
Local: Thurs, Feb 11 2010 1:54 pm
Subject: Re: Clojure and OOP

> I suspect that Clojure is actually more suited to OOP than Java,
> assuming you're going by Dr. Kay's definition. :)

Another Kay quote:

"I invented Object-Oriented Programming, and C++ is not what I had in  
mind."


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Raoul Duke  
View profile  
 More options Feb 11 2010, 2:25 pm
From: Raoul Duke <rao...@gmail.com>
Date: Thu, 11 Feb 2010 11:25:00 -0800
Subject: Re: Clojure and OOP

On Thu, Feb 11, 2010 at 4:46 AM, HB <hubaghd...@gmail.com> wrote:
> Hey,
> Since Clojure is a LISP dialect, does this mean that it doesn't
> support OOP?
> Thanks.

http://lambda-the-ultimate.org/node/3465

sincerely.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Wood  
View profile  
 More options Feb 11 2010, 4:17 pm
From: Michael Wood <esiot...@gmail.com>
Date: Thu, 11 Feb 2010 23:17:13 +0200
Local: Thurs, Feb 11 2010 4:17 pm
Subject: Re: Clojure and OOP
On 11 February 2010 17:57, John Pall <johnabcd.a...@gmail.com> wrote:

> can we creat threads in clojure?

Yes.

Clojure 1.2.0-master-SNAPSHOT
user=> (Thread.)
#<Thread Thread[Thread-0,5,main]>

But often you would use an agent or pmap etc. instead of creating
explicit threads.

--
Michael Wood <esiot...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Simms  
View profile  
 More options Feb 12 2010, 12:56 pm
From: Daniel Simms <daniel.si...@gmail.com>
Date: Fri, 12 Feb 2010 09:56:02 -0800
Local: Fri, Feb 12 2010 12:56 pm
Subject: Re: Clojure and OOP

On Thu, Feb 11, 2010 at 4:46 AM, HB <hubaghd...@gmail.com> wrote:
> Since Clojure is a LISP dialect, does this mean that it doesn't
> support OOP?

Another answer is that ``it could be if you wanted it to be'', for example:

    http://s-expressions.com/2009/12/10/frumios-a-silly-object-system-for...

.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »