pseudo array properties

Oskar Linde oskar.lindeREM at OVEgmail.com
Thu Jul 5 22:17:15 PDT 2007


Derek Parnell skrev:
> On Fri, 6 Jul 2007 11:52:38 +1000, Derek Parnell wrote:
> 
>> In V2, were we meant to lose the (undocumented) facility to have pseudo
>> properties for arrays?
>>
>> In other words, the code below compiled and ran for V1 but it doesn't for
>> V2.
>>
>> char[] foo(char[] a) { return a; }
>> void main()
>> {
>>     char[] q;
>>     q = q.foo;  // Invoke 'foo' as if it were a property.
>> }
> 
> Ok, maybe I got this wrong 'cos I can't get it to run in V1 either. Didn't
> we used to be able to do this?

The limitation (that has always been there) is that for "pseudo 
properties", you need to call them with the trailing parentheses:

q = q.foo(); // should work

-- 
Oskar



More information about the Digitalmars-d mailing list