Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I had a knee jerk reaction against it as well. But when you think about it, it kind of makes sense.

A) these are properties of the variable, not the value. <close> triggers when the variable goes out of scope, and <const> supposedly was a feature that came out of implementing <close>. Both only work with local variables.

B) the angle brackets leave room for extension with more properties in the future without creating an additional new syntax.

C) you can multi-declare several variables with different properties i.e.: `local a <const>, b, c <const> = "apple", "banana", "carrot"` with only a and c being const.

D) no new keyword(s) added to the language

Compared to the simple syntax of the rest of the language it may be a little jarring, but it was well thought out and imo it's still better than weird stuff like "spaceship operators", "hashrockets" or other weird syntax oddities in more popular languages. Would you really prefer chains of keywords? `static const char *strprbrk` We have angle brackets now. If it turns out to be a mistake, I'm sure Roberto and his team will just take it back out of the language.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: