2 回答
TA贡献1874条经验 获得超12个赞
e := expression.(type)是一个类型断言。
switch p := procedure.(type) {(带有以下 case 语句)是一个类型 switch。
*tokens = (*tokens)[1:]是一个切片表达式,改变存储在 中的值*tokens。
token := (*tokens)[0] // Set token to first element of tokens slice.
*tokens = (*tokens)[1:] // Update tokens to remove first element.
switch token { // Switch on token.
case "(": //a list begins // If token is "("
L := make([]scmer, 0) // Make a new, empty slice.
for (*tokens)[0] != ")" { // While the first element of tokens is not ")":
// Read from tokens; if not empty symbol:
if i := readFrom(tokens); i != symbol("") {
L = append(L, i) // Add the token read (in i) to L.
}
}
*tokens = (*tokens)[1:] // Remove the first element from tokens.
return L // Return the newly created slice.
- 2 回答
- 0 关注
- 159 浏览
添加回答
举报