4 ms·
Yes, there's an extra barrier with D because of type checking, but in exchange, you get compile-time checks. I actually kind of like those template errors becau
by jordigh 7y ago
Yes, there's an extra barrier with D because of type checking, but in exchange, you get compile-time checks. I actually kind of like those template errors because they tell you what kind of Python-like compile-time duck-typing D is trying to use!
Oh, and you can also use type deductions for function declarations! Just make it a template and let D figure out for you what type you want, or use typeof to record the type you want and use that typename in your function declaration.
- axaxs 7y agoThat second feature sounds really neat. I'd always wished Go had implemented something like this, even if just for numeric types.
- cppforlife 7y agojust use a wrong type (bool lets say), and check out go compilation error. it will tell you what type it wants.