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 關注
- 180 瀏覽
添加回答
舉報