ooc-dev team mailing list archive
-
ooc-dev team
-
Mailing list archive
-
Message #00100
Re: New ORC draft - Properties
Yes, I second that motion. Using another name sounds just too damn
confusing.
The part on extern getters/setters looks good to me. fredreichbier, is that
part already implemented? is it easy to add? can we hope to have it in for
0.9.1 ?
On Thu, Apr 22, 2010 at 4:51 AM, Scott Olson <scott@xxxxxxxxxxxxxxx> wrote:
> You're right, we should use =name if the property is called `name`.
> Technically =arg should set the property named `arg`, regardless of which
> property's set() it's in.
>
> On Monday 19 April 2010 07:21:39 Friedrich Weber wrote:
> > Hi all,
> >
> > I just added a basic implementation of the ORC in rock's `properties`
> > branch. To test, use the `properties/001-dog.ooc` example in `tests`.
> >
> > For now, supported features include getters and setters, accessing the
> > actual value inside getters/setters, calling get/set inside
> > getters/setters and replacing ordinary variable accesses `object
> > property` and assignments `object property = value` with appropriate
> > getter/setter calls.
> >
> > Not working for now (but I'm working on this): automatic assignment
> > arguments in setters (`set(=age)`), default getters/setters, missing
> > getters/setters. I think this shouldn't take too long. ;-)
> >
> > One implementation note: A property named `foo` creates a member `foo`
> > in the struct, no name mangling is done. This should be okay, shouldn't
> it?
> >
> > I noticed one thing in the ORC: We have this automatic assignment
> > argument feature (`set(=age)`, aka AssArg). However, this would force
> > the user to use the property name as argument name to avoid
> > inconsistency with the regular automatic assignment argument, right?
> >
> > Some code:
> >
> > Dog: class {
> > name: String {
> > /* This would not work, right? */
> > set(=arg) {
> > /* ... */
> > }
> > /* rather, we'd need */
> > set(=name) {
> > /* ... */
> > }
> > }
> > }
> >
> > I think we should keep this behavior. Just wanted to make sure that this
> > is wanted by everyone =)
> >
> > Greetings,
> >
> > Friedrich
>
> _______________________________________________
> Mailing list: https://launchpad.net/~ooc-dev
> Post to : ooc-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ooc-dev
> More help : https://help.launchpad.net/ListHelp
>
References