spec: What does SimpleStmt do?

68 views
Skip to first unread message

Zhuo Meng

unread,
Dec 7, 2021, 4:01:41 AM12/7/21
to golang-nuts
From spec: https://go.dev/ref/spec

Statements is for control execution.

If, else, select, return etc do change the control execution, however 

Stmt also included "SimpleStmt" can contains:

SimpleStmt = EmptyStmt | ExpressionStmt | SendStmt | IncDecStmt | Assignment | ShortVarDecl . 

which are not changing execution flow like "ComplexStmt" do.

Is the definition of Statement inappropriate, maybe "Statement contains execution expressions"?

Axel Wagner

unread,
Dec 7, 2021, 4:30:06 AM12/7/21
to golang-nuts
IMO the text as-is is fine. The point of the spec is to be confer meaning and I think the meaning of the current text is clear.

Note that, strictly speaking, a SimpleStmt *does* control execution flow, in that it always continue executing the following statement.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/f50c2997-afbe-46f4-99a5-ab4150f410a7n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages