Skip to content
This repository was archived by the owner on Sep 28, 2021. It is now read-only.

Commit d065cf4

Browse files
committed
Fixing sample code
1 parent 102cb19 commit d065cf4

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

samples/map.erl

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
%% Create initial set.
2-
{ok, S1} = lasp:declare(orset),
2+
{ok, {Id1, _, _, _}} = lasp:declare(orset),
33

44
%% Add elements to initial set and update.
5-
{ok, _} = lasp:update(S1, {add_all, [1,2,3]}, a),
5+
{ok, _} = lasp:update(Id1, {add_all, [1,2,3]}, a),
66

77
%% Create a second set.
8-
{ok, S2} = lasp:declare(orset),
8+
{ok, {Id2, _, _, _}} = lasp:declare(orset),
99

1010
%% Apply map.
11-
ok = lasp:map(S1, fun(X) -> X * 2 end, S2).
11+
ok = lasp:map(Id1, fun(X) -> X * 2 end, Id2),
12+
13+
%% Query map.
14+
{ok, Value1} = lasp:query(Id2), sets:to_list(Value1).

0 commit comments

Comments
 (0)