by williamvds · 4y ago · 0 comments
x := 5
Where you can optionally insert the type between the colon and equals, otherwise it is deduced x : int = 5[0] https://cstheory.stackexchange.com/questions/43971/why-colon...
90s fashion is also trendy right now. Which is great because a few years ago it was 80. The cycle continues!
x : t = e
Was called "headform" and was the only syntactic form for the whole language. (Expressions used a shunting yard algorithm to desugar into a sequence of headform.)The language included modules, classes, parameterics, functions, constraints, ..., whatever.
ducks
ML uses `name: type = value`. It came out over a decade before C++ and just one year after C.
Besides, it makes it trivial for text editors to implement "go to definition", and many other niceties without a real semantic parser.
ALGOL, the := in programming languages used for assignment comes from IAL which became ALGOL 58. It's definitely not a modern development. Go reintroduced it to popular mainstream languages, sort of. Except they still use = for assignment and := is used when it's also declaring a new variable.
Unless you now have named loops in modern C++ now this removing goto is problematic.
It was done in the very distant past. It was done in the intervening time. And it's done now. "Modern" trend?