Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: OOP,

by hding (Chaplain)
on Dec 14, 2001 at 23:39 UTC ( [id://132043]=note: print w/replies, xml ) Need Help??


in reply to OOP, ".NET", Perl, and all that

Anyway, one thing he points out is the ability to supply a default initial value for a data member when it is declared, and not have to specify that value as an initializer in every contructor (though it has that effect). He says (implied all) other OO languages can't do that.

Just for the record (and you quite possibly realize this already), it is possible to do this in Common Lisp by specifying an :initform argument in the slot definition for a class. In fact, as the name suggests, you can do even better than specify a value; you can specify any initialization form you want. I can't think exactly how you'd do in in Smalltalk, though you can of course simulate it a bit (as you can in many other languages) by defining a hierarchy of constructors that call each other, supplying defaults along the way.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://132043]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2025-07-10 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.