Skip to content

Commit 9534905

Browse files
authored
Rename Go+ with XGo (#83)
* Rename Go+ with XGo * Update for/<- to for/in
1 parent 477e648 commit 9534905

71 files changed

Lines changed: 161 additions & 156 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101-Hello-world/hello-11.gop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// There are three ways to write Go+'s Hello world.
1+
// There are three ways to write XGo's Hello world.
22

33
# The first type: command style
44

101-Hello-world/hello-3.gop

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ func main() {
1212
// starting to allow you to establish some basic logic for functional decomposition and team
1313
// collaboration.
1414

15-
// So, how do you try to play Go+?
15+
// So, how do you try to play XGo?
1616

17-
// The simplest, go directly to Go+ Playground to play:
17+
// The simplest, go directly to XGo Playground to play:
1818

19-
// * https://play.goplus.org/
19+
// * https://play.xgo.dev
2020

2121
// When learning basic grammar in the early days, it can actually be done in this way.
2222

23-
// How to install Go+ to play locally? We will talk about this topic later.
23+
// How to install XGo to play locally? We will talk about this topic later.

102-Values/values.gop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// Go+ has various value types including strings,
1+
// XGo has various value types including strings,
22
// integers, floats, booleans, etc.
33

44
// Here are a few basic examples.
55

66
// Strings, which can be added together with `+`.
7-
println "Go"+"Plus"
7+
println "X"+"Go"
88

99
// Integers and floats.
1010
println "1+1 =", 1+1

103-Constants/constants.gop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Go+ supports _constants_ of character, string, boolean,
1+
// XGo supports _constants_ of character, string, boolean,
22
// and numeric values.
33

44
import (

104-Variables/vars.gop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// In Go+, _variables_ are explicitly declared and used by
1+
// In XGo, _variables_ are explicitly declared and used by
22
// the compiler to e.g. check type-correctness of function
33
// calls.
44

@@ -11,7 +11,7 @@ println a
1111
var b, c int = 1, 2
1212
println b, c
1313

14-
// Go+ will infer the type of initialized variables.
14+
// XGo will infer the type of initialized variables.
1515
var d = true
1616
println d
1717

105-Assignments/assign-1.gop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# assignment
22

3-
// = is used for assigning. The values of multiple variables can be changed in one line. In this way, their values can be swapped without an intermediary variable.
3+
// `=` is used for assigning. The values of multiple variables can be changed in one line. In this way, their values can be swapped without an intermediary variable.
44
var age int
55

66
age = 21 // = is used for assigning.

105-Assignments/assign-2.gop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# = vs :=
1+
# `=` vs `:=`
22

33
// := is used for declaring and initializing. Multiple variables can be declared and intialized at one line.
44
age := 21 // age is declared and initialized to 21

106-Types/types-2.gop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Go+ has built-in support for rational numbers:
1+
# XGo has built-in support for rational numbers:
22
//
33
//
4-
// We introduce rational numbers as primitive Go+ types. We use suffix r to denote rational literals. For example, 1r << 200 means a big int whose value is equal to 2^200.
4+
// We introduce rational numbers as primitive XGo types. We use suffix r to denote rational literals. For example, 1r << 200 means a big int whose value is equal to 2^200.
55
//
66
// By default, 1r will have the type of bigint.
77
// And 4/5r means the rational constant 4/5. It will have the type of bigrat.

106-Types/types.gop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Go+ primitive types are
1+
# XGo primitive types are
22
// <pre>
33
// bool
44
// int8 int16 int32 int int64 int128

107-Integers/integers.gop

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
// For int 20 values can also be expressed in hex (0x14), octal (0o24), and binary notation (0b0010100).
1111
// uint, there are no uint literals. All literal whole numbers are treated as int values.
1212
//
13-
// Go+ also supports writing numbers with _ as separator and also support cast bool to number types.
13+
// XGo also supports writing numbers with _ as separator and also support cast bool to number types.
1414
// As example shows
1515

16-
num := 1_000_000 //Go+ support, same as 1000000
16+
num := 1_000_000 //XGo support, same as 1000000
1717
println num
1818

19-
println int(true) //Go+ support cast bool to int
19+
println int(true) //XGo support cast bool to int
2020
println float64(true) //and to float64
2121
println complex64(true) //and to complex64, and so on.
2222

0 commit comments

Comments
 (0)