Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

OOP

Name: Anonymous 2011-01-14 5:07

Tell me, /prog/.

What is `true OOP´

Name: Anonymous 2011-01-14 5:15

´CLOS`

Name: Anonymous 2011-01-14 5:23

>>1
I could destroy from whence I sit.

Name: Anonymous 2011-01-14 6:35

CLOS+MOP if you want something incredibly flexible that can be made to be anything you could imagine by extending it with itself.
Smalltalk or possibly Self if you want a more classic approach to it.

Name: Anonymous 2011-01-14 13:13

Funny, I was about to make a thread like this. I'll just piggyback on this one instead.

Which is better: generic functions or message-passing? I'm inclined to favor generic functions myself. We need to work this out so we can be properly elitist.

Name: Anonymous 2011-01-14 13:17

>>5
Generic functions are a lot more flexible and technically you can just use them in a limited form if you only want message-passing, however you can't really get generic functions if you only have message-passing without some nastier design patterns, thus generic functions are more "generic" than message-passing, but I'm guessing you all knew that.

Name: Anonymous 2011-01-14 13:17

>>5
generic functions and multi-dispatch.

CLOS.

Name: Anonymous 2011-01-14 13:32

ragesage

Name: Anonymous 2011-01-14 14:48

>>6,7
I like the way this is going.

Name: Anonymous 2011-01-14 17:23

OOP is perception of world in term of **beings** that communicate trough **messages** (in fact there are only beings and messages here).

BTW all "for", "while" and "if" conditions known from C++ or Java aren't OOP through (also many other things aren't).

(Sage was not used intentionally)

Name: Anonymous 2011-01-14 17:55

>>10
**
Use BBCode for emphasis, /prog/ is not reddit.

However, the concept of OOP is splitted in three parts:
1. The braindead unborn monster used in C++/Java and like.
2. CLOS (generics and multi-dispatching).
3. Smalltalk's (message passing, everything is an object, everything is a method, even control structures, that is exactly what you described).

I really like CLOS, but Smalltalk's pureness intrigues me.

Name: Anonymous 2011-01-14 18:00

[quote]Use BBCode for emphasis, /prog/  is not reddit.[/quote]

roger that

Name: Anonymous 2011-01-14 18:05

>>12
> your quote here.

Name: Anonymous 2011-01-14 18:07

>>13
thanks dude

Name: Anonymous 2011-01-14 18:15

BTW I would like to see in OOP languages ability do redefine build in concepts (inb4 lisp).

As example: I have number "13", now I would like to add method to all numbers, say be_in_8_base_now, and be able to write sth like 13.be_in_8_base_now(). I would also like to completely redefine what numbers are, eg, to be able to write them in any base or form, that I created (I know, it would be hard to parse).

Numbers are only example here.

Name: Anonymous 2011-01-14 18:47

>>15
Ruby is all about monkey-patching methods onto the built-in objects.
For the latter part, the sane (i.e., not Cocks user-defined literals) way would probably be to use macros/templates/compile-time functions, and give them a string.

Name: Anonymous 2011-01-14 18:53

>>15
That would be pretty trivial in Li
inb4 lisp
Oh, well, with Ruby, you can write things like 4.day.ago and you can redefine almost everything. It feels very Lispy, too bad it's SLOW AS FUCK.
With JavaScript, you can add things to the object's prototypes. I added car and cdr to the Array object and now I can do [1,2,3].car() (1) and [1,2,3].cdr() ([2,3])

Name: Anonymous 2011-01-14 22:56

>>17
It feels very Lispy, too bad it's SLOW AS FUCK.
Just like Lisp!

Name: Anonymous 2011-01-15 2:01

>>17
Proto-OO languages are pretty cool that way. I have no idea how Perl 6 ended up with a class system when prototypes just scream "perl". So we get metamethods instead. (And the ability to graft a proto system directly onto the class system. Or something equally weird.)

4.day.ago
I know S-F-A about Ruby, how does that work? I don't think it would make it into the core of Perl 6, but I imagine it would go like this if it did:

.day is Coolhttp://perlgeek.de/blog-en/perl-6/cool.html, producing a Duration and .ago is a method on Durations, taking a second argument (Instant) to subtract the interval from, defaulting to &now.

Name: Anonymous 2011-01-15 2:42

>>18
Fuck off, ``faggot''.

>>19
Cool
Perl 6: has everything for everything!

Name: Anonymous 2011-02-03 8:28

Name: Anonymous 2011-02-04 16:16

Don't change these.
Name: Email:
Entire Thread Thread List