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 similar to Perl's "Tied" variables. It's pretty cool to play with, and darn handy.

At 4:27 PM -0600 12/10/01, David W. Halliday wrote:
Brian Luft wrote:

On 12/10/01 3:17 PM, "Ondra Cada" <email@hidden> wrote:
>...

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 ;)

Thanks. Brian

Mere syntactic sugar. :-) However, it's certainly nice syntactic sugar to get
old-hand C++ programmers to start doing The Right Thing\TM\. :-)

David email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: Damn sisters :-) (From: Brian Luft <email@hidden>)
 >Re: Damn sisters :-) (From: "David W. Halliday" <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.