On 06/22/2015 03:18 PM, Ilya Yaroshenko wrote:
On Monday, 22 June 2015 at 19:09:40 UTC, weaselcat wrote:
I never seem to use them for anything, has anyone else done anything
interesting with them?
UDAs are very useful for IO libraries. You can find them in vibe.d web
server:
http://d.readthedocs.org/en/latest/examples.html#service (see last method)
Yea, I really like vibe's use of them. I've worked with web tools before
that inferred URLs and querty string value names and visibility from the
names/visibility of classes/functions/arguments. But I never liked that
approach, how it conflates internal names/visibility with external
interface. Too much implicit magic, and too much leaking of internals.
UDA'a maintain the convenience of that approach, but keep a nice clean
separation.