More D newb questions.

Joel C. Salomon joelcsalomon at gmail.com
Tue May 6 06:47:19 PDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Walter Bright wrote:
> Derek Parnell wrote:
>> Concatenating elements to form an array of elements is a pretty natural
>> expectation from people.
> 
> I agree, which is why D supports array literals:
> 
>     [T, T] => T[]

Trouble is, people learn that
	array ~ 'a'
&	'a' ~ array
work and want to generalize.  Maybe it would be better if D required a
cast-to-“array”, as in
	array ~ ['a']
to append.  Remove the special syntax altogether.

- --Joel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIIGFnzLx4GzBL9dYRAs0dAKCCO3nnTP2lu2ax0hqVu37IIMCcQwCggHkW
ogmUrjEaMtCbTR/bqZ5JAJQ=
=jf0D
-----END PGP SIGNATURE-----



More information about the Digitalmars-d mailing list