Skip to content

docs(spec-mini): document Commands and Calls syntax #2481

@xushiwei

Description

@xushiwei

Summary

  • Document XGo's command-style syntax for function/method calls
  • Explain both function-call style (with parentheses) and command-style (without parentheses)
  • Include grammar definition: CommandStmt = IDENT [ "." IDENT ] SPACE LambdaExprList [ "..." ]
  • Provide examples of qualified and unqualified calls
  • Document variadic argument support with ...
  • Clarify XGo's preference for command-style syntax

Changes

  • Replaced TODO at lines 1167-1172 in /workspace/doc/spec-mini.md with comprehensive documentation
  • Added subsections for function-call style and command-style syntax
  • Included code examples demonstrating both approaches
  • Explained that echo is an alias for println emphasizing command-oriented design

References

  • Grammar definition: doc/spec/mini/mini.xgo:119
  • Quick start documentation: doc/docs.md (lines 138-158)

Test plan

  • Review documentation for accuracy
  • Verify all code examples are valid XGo syntax
  • Confirm alignment with quick start guide
  • Check grammar definition matches implementation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions