History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-798
Type: Wish Wish
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Arron Washington
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

"property" keyword macro.

Created: 12/Feb/07 02:29 PM   Updated: 12/Feb/07 02:29 PM
Component/s: Parser, Compiler
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide
Would be nice to have a "property" keyword that made creating properties much easier.

Currently we have [property(foo)] _bar as type but that syntax goes out the window if you have to modify the getter or setter.

I would prefer a syntax like:

[attributes] <accessors> property Foo as <type>. This syntax would automatically create a private member called _foo and wire up the getter and setter behind the scenes.

If one wanted to modify either the getter or the setter, this syntax would also be allowed:

[attributes] <accessors> property Foo as <type>:
get: #optional

{code-block}

set: #optional
_foo = value;

If one wanted to change the access level of the underlying member accessed by the property, this could work:

<accessors> _foo as <type>
[attributes] <accessors> property Foo as <type>

and instead of creating its own member we would have the property use the existing _foo instead (so long as the types matched up).

The "readonly" keyword could be applied to properties to make them get-only, however, I'm not sure of a solution to make a property write-only.

As an aside, I'm willing to work on this from the compiler backend provided someone alters the boo parser grammar files to support the property keyword. No idea how to do any of that black magic stuff.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.