Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions doc/spec-mini.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Some identifiers are [predeclared](#predeclared-identifiers).

### Keywords

The following keywords are reserved and may not be used as identifiers (TODO: some keywords are allowed as identifiers).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep this TODO.

The following keywords are reserved and may not be used as identifiers.

```go
break default func interface select
Expand Down Expand Up @@ -456,7 +456,7 @@ TypeName = identifier | QualifiedIdent .
TypeArgs = "[" TypeList [ "," ] "]" .
TypeList = Type { "," Type } .
TypeLit = ArrayType | StructType | PointerType | FunctionType | InterfaceType |
SliceType | MapType . // TODO: check this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep this TODO.

SliceType | MapType .
```

The language [predeclares]() certain type names. Others are introduced with [type declarations](#type-declarations). _Composite types_—array, struct, pointer, function, interface, slice, map—may be constructed using type literals.
Expand Down Expand Up @@ -2399,15 +2399,19 @@ func protect(g func()) {
}
```

### TODO
### Additional built-in functions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see the builtin/doc.xgo file for all additional built-in functions.


The following additional built-in functions are provided for convenience:

```go
print
printf
println
...
print(args ...any) // prints arguments to standard output
printf(format string, args ...any) // prints formatted output
println(args ...any) // prints arguments with newline
echo(args ...any) // alias for println
```

These functions are primarily intended for quick debugging and simple output. For production code, consider using the `fmt` package for more robust formatting and output control.

## Blocks

A _block_ is a possibly empty sequence of declarations and statements within matching brace brackets.
Expand Down Expand Up @@ -2775,11 +2779,7 @@ import _ "lib/math"

### An example package

Here is a complete XGo package that implements XXX.

```go
TODO
```
> **Note**: A complete example package demonstrating XGo package structure and features will be added here.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep this TODO.


## Program initialization and execution

Expand All @@ -2794,8 +2794,6 @@ var i int
var i int = 0
```

TODO

### Package initialization

Within a package, package-level variable initialization proceeds stepwise, with each step selecting the variable earliest in `declaration order` which has no dependencies on uninitialized variables.
Expand Down Expand Up @@ -2841,7 +2839,7 @@ the initialization order is `d`, `b`, `c`, `a`. Note that the order of subexpres

Dependency analysis is performed per package; only references referring to variables, functions, and (non-interface) methods declared in the current package are considered. If other, hidden, data dependencies exists between variables, the initialization order between those variables is unspecified.

For instance, given the declarations (TODO: use classfile instead of method)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep this TODO.

For instance, given the declarations

```go
var x = I(T{}).ab() // x has an undetected, hidden dependency on a and b
Expand Down