December 18, 2013 Re: Type inference and overloaded functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Namespace | Namespace: > No, not currently. But it is an interesting idea. Maybe I will implement this. A use case: https://d.puremagic.com/issues/show_bug.cgi?id=11757#c3 Visible in this line: key2[0 .. digestSize] = key.md5Of; But my suggested syntax is not that good, here $ has already a meaning, that is the whole length of b, So some different idea is needed here :-( b[0 .. $] = foo(); Otherwise you have to write code like: b[0 .. ReturnType!foo.length] = foo(); |
December 19, 2013 Re: Type inference and overloaded functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | On 12/17/2013 07:21 PM, bearophile wrote: > But my suggested syntax is not that good, here $ has already a meaning, > that is the whole length of b, So some different idea is needed here :-( > > b[0 .. $] = foo(); Sorry, I can't resist... Golden rule of system programming language syntax: When in doubt, reach for static: b[0 .. $tatic] = foo(); Done! :p Ali |
Copyright © 1999-2021 by the D Language Foundation