Skip to content
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
haifenghuang committed Apr 26, 2018
1 parent 125c278 commit 14ee87a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,20 @@ let hh = =^10 // Use the '=^' prefix operator
printf("hh=%d\n", hh) // result: hh=-10
```

```swift
fn .^(x, y) {
arr = []
while x <= y {
arr += x
x += 2
}
return arr
}

let pp = 10.^20
printf("pp=%v\n", pp) // result: pp=[10, 12, 14, 16, 18, 20]
```

Below is a list of predefined operators and user defined operators:

<table>
Expand Down
14 changes: 14 additions & 0 deletions README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,20 @@ let hh = =^10 // 使用用户自定义的前缀运算符'=^'
printf("hh=%d\n", hh) // 结果: hh=-10
```

```swift
fn .^(x, y) {
arr = []
while x <= y {
arr += x
x += 2
}
return arr
}

let pp = 10.^20
printf("pp=%v\n", pp) // result: pp=[10, 12, 14, 16, 18, 20]
```

下面的表格列出了Monkey内置的运算符和用户可以自定义的运算符:

<table>
Expand Down

0 comments on commit 14ee87a

Please sign in to comment.