25 ms·
From a computer science standpoint it is obvious that generic declarations are just functions that accept type parameters and return a declaration according to
by imtringued 7y ago
From a computer science standpoint it is obvious that generic declarations are just functions that accept type parameters and return a declaration according to the type parameters. So the only reasonable suggestion would be to use the same syntax for both type parameters and normal parameters and optionally add something that distinguishes between the two (like your !).
Meanwhile picking either <> or [] feels like that decision is based on personal preference. Obviously, you can justify choosing the most popular syntax because of familiarity but then [] was never an option to begin with.
- WalterBright 7y ago> From a computer science standpoint it is obvious that generic declarations are just functions that accept type parameters I'm ashamed that realization was slow in coming to me. But once it did, it was key to greatly simplifying the D template syntax.