summaryrefslogtreecommitdiffhomepage
path: root/docs/carc_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-08-06 17:48:06 +0200
committerTyge Løvset <[email protected]>2022-08-06 17:48:06 +0200
commit618b5704e6f85cfe1b6e5c9c9373abe76a8bb628 (patch)
tree4e25a538c8ba3fd58bb25b90ff6dc54adfb31aa4 /docs/carc_api.md
parent927fa8093ea0bc1e25586e60c47cf1dd8a311d9e (diff)
downloadSTC-modified-618b5704e6f85cfe1b6e5c9c9373abe76a8bb628.tar.gz
STC-modified-618b5704e6f85cfe1b6e5c9c9373abe76a8bb628.zip
c_apply() deprecated: replaced with c_forarray() macro. Updated and improved README.md docs.
Diffstat (limited to 'docs/carc_api.md')
-rw-r--r--docs/carc_api.md15
1 files changed, 8 insertions, 7 deletions
diff --git a/docs/carc_api.md b/docs/carc_api.md
index 534e3da3..2604e13a 100644
--- a/docs/carc_api.md
+++ b/docs/carc_api.md
@@ -100,25 +100,26 @@ int main()
// POPULATE the stack with shared pointers to Map:
Map *map;
map = Stack_push(&stack, Arc_make(Map_init()))->get;
- c_apply(v, Map_emplace(map, c_pair(v)), Map_raw, {
+ c_forarray (Map_raw, v, {
{"Joey", 1990},
{"Mary", 1995},
- {"Joanna", 1992}
- });
+ {"Joanna", 1992},
+ }) Map_emplace(map, v->first, v->second);
+
map = Stack_push(&stack, Arc_make(Map_init()))->get;
- c_apply(v, Map_emplace(map, c_pair(v)), Map_raw, {
+ c_forarray (Map_raw, v, {
{"Rosanna", 2001},
{"Brad", 1999},
{"Jack", 1980}
- });
+ }) Map_emplace(map, v->first, v->second);
// POPULATE the list:
map = List_push_back(&list, Arc_make(Map_init()))->get;
- c_apply(v, Map_emplace(map, c_pair(v)), Map_raw, {
+ c_forarray (Map_raw, v, {
{"Steve", 1979},
{"Rick", 1974},
{"Tracy", 2003}
- });
+ }) Map_emplace(map, v->first, v->second);
// Share two Maps from the stack with the list by cloning(=sharing) the carc:
List_push_back(&list, Arc_clone(stack.data[0]));