Miranda getPropertySlot
From Erights
(Difference between revisions)
Kevin Reid (Talk | contribs) (+cat Miranda messages) |
Kevin Reid (Talk | contribs) (Add Javadoc.) |
||
Line 1: | Line 1: | ||
+ | ==Original Javadoc== | ||
+ | |||
+ | Used in the expansion of '<tt>foo::bar</tt>' so that this syntax | ||
+ | represents foo's "bar" property. | ||
+ | |||
+ | '<tt>foo::bar</tt>' expands to '<tt>foo.__getPropertySlot("bar").get()</tt>'. | ||
+ | When used an an lValue, '<tt>foo::bar := newValue</tt>' expands | ||
+ | essentially to '<tt>foo.__getPropertySlot("bar").put(newValue)</tt>' | ||
+ | except that the expansion also has the value of the assignment | ||
+ | expression be the value assigned. | ||
+ | |||
+ | And finally '<tt>foo::&bar</tt>' expands to '<tt>foo.__getPropertySlot("bar")</tt>' | ||
+ | <p><hr> The Miranda behavior provided here synthesizes, for foo's bar | ||
+ | property, a Slot object <ul> <li>whose '<tt>get()</tt>' does a | ||
+ | '<tt>foo.getBar()</tt>' <li>whose '<tt>put(newValue)</tt>' does a | ||
+ | '<tt>foo.setBar(newValue)</tt>' <li>and whose '<tt>isFinal()</tt>' | ||
+ | returns false</tt>'. </ul> | ||
+ | |||
+ | See also: [http://www.eros-os.org/pipermail/e-lang/2004-April/009720.html Re: On kernel-E, operators, and properties (part 1)] | ||
+ | |||
+ | '''Deprecated:''' Even if E does again decide to support explicit properties, | ||
+ | it'll do it with a global function that asks the object's | ||
+ | {@link #__getAllegedType} for the methods for its | ||
+ | properties. | ||
+ | |||
+ | |||
== Issues == | == Issues == | ||
Revision as of 03:19, 7 August 2011
Original Javadoc
Used in the expansion of 'foo::bar' so that this syntax represents foo's "bar" property.
'foo::bar' expands to 'foo.__getPropertySlot("bar").get()'. When used an an lValue, 'foo::bar := newValue' expands essentially to 'foo.__getPropertySlot("bar").put(newValue)' except that the expansion also has the value of the assignment expression be the value assigned.
And finally 'foo::&bar' expands to 'foo.__getPropertySlot("bar")'
The Miranda behavior provided here synthesizes, for foo's bar property, a Slot object
- whose 'get()' does a 'foo.getBar()'
- whose 'put(newValue)' does a 'foo.setBar(newValue)'
- and whose 'isFinal()' returns false</tt>'.
See also: Re: On kernel-E, operators, and properties (part 1)
Deprecated: Even if E does again decide to support explicit properties, it'll do it with a global function that asks the object's {@link #__getAllegedType} for the methods for its properties.