According to this answer =>
in Scala is a keyword which has two different meanings: 1 to denote a function type: Double => Double
and 2 to create a lambda expression: (x: Double): Double => 2*x
.
How does this relate to formal grammars, i.e. does this make Scala context sensitive?
I know that most languages are not context free, but I'm not sure whether the situation I'm describing has anything to do with that.
Edit:
Seems like I don't understand context sensitive grammars well enough. I know how the production rules are supposed to look, and what they mean ("this production applies only if A is surrounded by these symbols"), but I'm just not sure how they relate to actual (programming) languages.
I think my confusion stems from reading something like "Chomsky introduced this term because a word's meaning can depend on its context", and I connected =>
with the term "word" in the quote, and those two uses of it being two separate contexts.
It be great if an answer would address my confusion.