From 195e6458e34fffceaf5de1e0a6acba67fddd5c91 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Sat, 7 Aug 2021 20:32:29 +0100 Subject: [PATCH 1/2] Added z to print statement to match up with claimed printed value --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 01e341b..dff8f92 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ local thread = co.create(function () local x = co.yield(1) print(x) local y, z = co.yield(2, 3) - print(y) + print(y, z) end) pong(thread) From 2a3c4dc9da5a6781d92d3102eaa22eb1b862d47a Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Sun, 8 Aug 2021 10:37:22 +0100 Subject: [PATCH 2/2] Remove co.create call of thread passed to pong, it expects a function and creates a thread from it --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dff8f92..b6d87bd 100644 --- a/README.md +++ b/README.md @@ -214,12 +214,12 @@ local echo = function (...) return thunk end -local thread = co.create(function () +local thread = function () local x, y, z = co.yield(echo(1, 2, 3)) print(x, y, z) local k, f, c = co.yield(echo(4, 5, 6)) print(k, f, c) -end) +end pong(thread) ```