Duck typing for structs

2010-10-21 Thread Ash Logan
Hello all, I was experimenting with Kenji Hara's interfaces.d, and I thought it would be interesting to be able to adapt not just objects but struct values to an interface. So I came up with a hacky solution, adapter.d, and put it on Google Docs at http://goo.gl/Y7Oa in case anyone is intereste

Re: Duck typing for structs

2010-10-21 Thread Ash Logan
On 10/21/2010 12:58 PM, bearophile wrote: Just a question. Aren't lines like: if (is(typeof(candidate) == const)) Better as static ifs? Bye, bearophile Probably they are; this was my first try at compile-time functions, and while writing it I kept crossing the line between what could and coul