microsoft / qsharp-language

Official repository for design of the quantum programming language Q# and its core libraries
MIT License
233 stars 54 forks source link

Rename "expression statement" to "call statement" #86

Closed tcNickolas closed 3 years ago

tcNickolas commented 3 years ago

The term "expression statement" is used only once in the language spec and points to a page detailing "call statements", so it looks like a leftover from a previous naming convention. C# and Java define "expression statements" but those are broader than Q# "call statements" and include assignments and new object creation, so using these terms interchangeably might be confusing.

(If my reading is incorrect and these are intended to be used as synonyms, feel free to close the PR)

bamarsha commented 3 years ago

Q# compiler internals also refer to it as an expression statement, since it's a statement that contains an expression and nothing else. There's the additional restriction that the expression must be a call expression, but that restriction could be lifted in the future (especially if Q# goes expression-based). Maybe for now it's less confusing to use the more specific term though. @bettinaheim?

bettinaheim commented 3 years ago

Q# compiler internals also refer to it as an expression statement, since it's a statement that contains an expression and nothing else. There's the additional restriction that the expression must be a call expression, but that restriction could be lifted in the future (especially if Q# goes expression-based). Maybe for now it's less confusing to use the more specific term though. @bettinaheim?

Yes, I agree that calling it a call statement until/unless we remove the restriction in the future is less confusing.