summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-02-04 11:12:16 +0100
committerTyge Løvset <[email protected]>2021-02-04 11:12:16 +0100
commit6b96779e99edc8715b85f3ac45536752b27314a6 (patch)
tree966160e573e0d3b656f74b856afc6402a9372342 /docs
parent82a25ecd89d64a2226f30cb15d6612e61a56f057 (diff)
downloadSTC-modified-6b96779e99edc8715b85f3ac45536752b27314a6.tar.gz
STC-modified-6b96779e99edc8715b85f3ac45536752b27314a6.zip
Some docs.
Diffstat (limited to 'docs')
-rw-r--r--docs/ccommon_api.md16
1 files changed, 10 insertions, 6 deletions
diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md
index 9e1d1767..cb2e9226 100644
--- a/docs/ccommon_api.md
+++ b/docs/ccommon_api.md
@@ -24,12 +24,16 @@ c_foreach (i, cvec_x, vec) sum += *i.ref;
```
#### c_forrange
-Declare an iterator and specify a range to iterate with a for loop.
-- c_forrange (end)
-- c_forrange (it, end)
-- c_forrange (it, IterType, end)
-- c_forrange (it, IterType, begin, end)
-- c_forrange (it, IterType, begin, end, step)
+Declare an iterator and specify a range to iterate with a for loop. Like python's ***range()*** function:
+- c_forrange (stop) # for _ in range(stop):
+- c_forrange (i, stop) // IterType=size_t # for i in range(stop):
+- c_forrange (i, IterType, stop) # for i in range(stop):
+- c_forrange (i, IterType, start, stop) # for i in range(start, stop):
+- c_forrange (i, IterType, start, stop, step) # for i in range(start, stop, step):
+```
+c_forrange (i, int, -3, 3) printf(" %d", i);
+// -3 -2 -1 0 1 2
+```
#### c_withbuffer