The confusion is this: In some places "int" means "the type of all integers", such as in "array<int>". Elsewhere it's an indeterminate placeholder to be filled in with an actual integer, such as "void f(int x) {return x+1;}" or "int f(int,int)".
-
-
Show this thread
-
This confusion doesn't exist in Pascal or Typescript syntax. "int" refers to the type, and ":int" is always an abstract placeholder for a particular value. The type-value dissonance is stretched to the breaking point when they're mixed as in C++ template partial specialization.
Show this thread
End of conversation
New conversation -
-
-
Who do we blame for this Bjarne Stroustrup?
-
I think he did a pretty decent job, for acting without the benefit of decades of using higher level languages that we have now to give us more insight and hindsight. Moving from 8 bit assembly to using “any higher level language at all” felt like such a blessing in my career!
End of conversation
New conversation -
-
-
Your brain is on a much higher level than mine
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
What's wrong with "int x" ? looks good to me as it mimics math a little.
-
"int x" seems benign, but it runs aground when we expand the type system. Is "int<a,b>x" one declaration or two inequalities? Do we extend the patterns with functions? "int f(int)" seems nice, but what about "int(int)(int(int))f(int(int)(int(int)))"?
- Show replies
New conversation -
-
-
What do you think of local variable type inference (val/var) in Java 10 and Lombok? Are you against type declaration or just that int is used to represent two different things?
-
Strongly-typed, dynamically-typed, and gradually-typed languages all have important roles in the ecosystem. I'm advocating for context-free syntax, meaning that an expression's semantic meaning is independent of where it occurs (except due to name scoping).
- Show replies
New conversation -
-
-
laughs in
@rustlangThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.