people[name=="Andrew"].friends ~= peter
Antonio
antonio at abrevia.net
Tue May 9 06:47:44 PDT 2006
Thomas Kuehne escribió:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> antonio schrieb am 2006-05-07:
>
> <snip>
>
>> �Standard D offers some way to build a dynamic array on the fly? (like
>> c#, java)
>>
>> Person someone = new Person();
>> Person anotherone = new Person();
>>
>> int count = new Person[]{ someone, anotherone }; // Hoy do you do
>> this on D?
>
> shouldn't this be:
> # Person[] count = new Person[]{ someone, anotherone };
int count = new Person[]{ someone, anotherone }.length
>
>
> D kludge:
> #
> # template makeDynArray(T){
> # T[] makeDynArray(T[] raw ...){
> # return raw.dup;
> # }
> # }
> #
>
> #
> # Person[] count = makeDynArray!(Person)(someone, anotherone);
> #
>
> Thomas
>
>
> -----BEGIN PGP SIGNATURE-----
>
> iD0DBQFEX0KM3w+/yD4P9tIRAmpKAJiMFtf5O+Rwk40lwN1BRZtK6mo9AJYwC5e9
> vvb3XmuoYeQbRXm2340Y
> =Knpn
> -----END PGP SIGNATURE-----
More information about the Digitalmars-d
mailing list