• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Damn sisters :-)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Damn sisters :-)


  • Subject: Re: Damn sisters :-)
  • From: Matt Rollefson <email@hidden>
  • Date: Tue, 11 Dec 2001 13:34:12 -0800

Those of you interested in this (automatic accessors, that is) in the context of Cocoa might look into Key Value Coding:

http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ProgrammingTopics/
KeyValueCoding/

Rollie


On Tuesday, December 11, 2001, at 10:08 AM, Dave MacLachlan 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 ;)

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
_______________________________________________
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.


  • Follow-Ups:
    • Re: Damn sisters :-)
      • From: Marcel Weiher <email@hidden>
References: 
 >RE: Damn sisters :-) (From: "Dave MacLachlan" <email@hidden>)

  • Prev by Date: Re: buy that new Book?
  • Next by Date: Re: buy that new Book?
  • Previous by thread: Re: Damn sisters :-)
  • Next by thread: Re: Damn sisters :-)
  • Index(es):
    • Date
    • Thread