I understand Rust being type safe, but Im seeing syntax that Ive never seen in my life in Go which looks too messy
var test int < bruh what?
:=
func(u User) hi () { … } Where is the return type and why calling this fct doesnt require passing the u parameter but rather u.hi().
map := map[string] int {} < wtf
It goes back to mathematics pseudo code which was then used to sketch the ALGOL symbols way back in the days and which then gave birth to everything you know of programming today
That shit’s quite ancient
But that mathematical pseudo code has nothing in common with the walrus operator(Edit: I’m so sick of my stupidness.):=
in Python and Go. They are just the same symbols, but with a totally different meaning and use case. Its an operator designed specifically for programming languages, because that is not applicable to mathematics at all. In mathematics you don’t have an assignment operatora = 69
that cannot be used as part of an expression. Therefore you don’t need a dedicated:=
that yields an expression that can be used as part of an expression and create a variable if its not already.