You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-58Lines changed: 1 addition & 58 deletions
Original file line number
Diff line number
Diff line change
@@ -33,61 +33,4 @@ After that, commit and push them for update. GitHub will handle the rest.
33
33
34
34
## Documenting Goby Code
35
35
36
-
We use Markdown to document. All markdown syntax are supported.
37
-
38
-
### Documenting Classes
39
-
40
-
All classes can be found in `/vm` directory. Each class is represented by a file. For example, you can find `Integer` class in `integer.go` file.
41
-
42
-
The class definition can be found with the `type` named as the filename or suffixed with "Object". The documentation for this class is right above this `type`. For example, `Integer` class is documented as:
43
-
44
-
```go
45
-
// Integer represents number objects which can bring into mathematical calculations.
46
-
//
47
-
// ```
48
-
// 1 + 1 # => 2
49
-
// 2 * 2 # => 4
50
-
// ```
51
-
typeIntegerObjectstruct {
52
-
Class *RInteger
53
-
Valueint
54
-
}
55
-
```
56
-
57
-
### Documenting Methods
58
-
59
-
Methods of a class are stored in an array, with its name prefixed with `builtin` and suffixed with `Methods`. For example, the name for `Integer` class is `builtinIntegerMethods`.
60
-
61
-
Each method comes with two keys, `Fn` and `Name`. The document of a method comes right above `Name`. For example:
62
-
63
-
```go
64
-
varbuiltinIntegerMethods = []*BuiltInMethod{
65
-
{
66
-
// Returns the sum of self and another Integer.
67
-
//
68
-
// ```
69
-
// 1 + 1
70
-
// ```
71
-
Name: "+",
72
-
Fn: func(receiver Object) builtinMethodBody {
73
-
// ...
74
-
},
75
-
},
76
-
}
77
-
```
78
-
79
-
Remember to leave one space after `//`.
80
-
81
-
### Others
82
-
83
-
Currently the documentation only supports `//` comments, not `/* */`. The following style will not be parsed:
84
-
85
-
```go
86
-
/*
87
-
Integer represents number objects which can bring into mathematical calculations.
88
-
*/
89
-
typeIntegerObjectstruct {
90
-
Class *RInteger
91
-
Valueint
92
-
}
93
-
```
36
+
Go to [Goby wiki](https://github.com/goby-lang/goby/wiki/Documenting-Goby-Code).
0 commit comments