Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Damn sisters :-)



> This is totally unrelated to the topic at hand, but one of the really cool
> things about C# (no Microsoft flames, please :P) that I wish
> Objective-C had
> are properties. They let you simulate normal member variables
> but actually
> call accessor and set functions.
> For instance, you can have a String myStr property that actually sets
> something in a dictionary in its implementation, like in Ondra's example,
> transparently. This lets the user do simply:
> MyClass.myStr = "Blah"
> String myLocalStr = MyClass.myStr;
> And both will not set the variable directly but will instead call the
> associated get or set function. Pretty neato, if you ask me ;)

Did you ever play with Dylan???

You would've really liked it's design as far as I can tell. As soon as you
declared a member variable, it immediately had an accessor and setter
written for it. To make something private in Dylan you just overrode it's
accessor and/or setter to do nothing/return null.

It's been a while since I studied the manuals so I may not be 100% correct,
but it was pretty cool.


Cheers,
Dave


References: 
 >Re: Damn sisters :-) (From: Brian Luft <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.