More on Rust
spir
denis.spir at gmail.com
Thu Feb 10 07:35:11 PST 2011
On 02/10/2011 06:43 AM, Nick Sabalausky wrote:
> "bearophile"<bearophileHUGS at lycos.com> wrote in message
> news:iivb5n$na3$1 at digitalmars.com...
>>
>> auto x;
>> if (localtime().hours>= 8) {
>> x = "awake!"
>> } else {
>> x = "asleep, go away."
>> }
>> log "I'm " + x;
>>
>
> That would be really nice to have in D. There's been many times I've needed
> to move a declaration up one scope from its initialization and was therefore
> forced to get rid of the "auto". Not a major problem obviously, but that
> sure would be nice.
I don't like that at all. The second main feature of staticity if self-doc
code. How is one, as a reader, supposed to guess what x is and means?
I'm not a great fan of auto, neither, use it would happily live w/o it, except
for functions operating on ranges, that return types coming from who-knows
where (certainly another planet).
Denis
--
_________________
vita es estrany
spir.wikidot.com
More information about the Digitalmars-d
mailing list