From b829ce67af6e53cc4e61f0e9f82e20f5c695b454 Mon Sep 17 00:00:00 2001 From: Gavin Schulz Date: Wed, 14 Jan 2015 23:19:31 -0800 Subject: [PATCH] Rename `forall` to `all`. --- builtin/core.wren | 2 +- src/wren_core.c | 2 +- test/list/forall.wren | 6 +++--- test/list/forall_non_bool_returning_fn.wren | 2 +- test/list/forall_non_function_arg.wren | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/builtin/core.wren b/builtin/core.wren index 3fe304dc..7f63a3ef 100644 --- a/builtin/core.wren +++ b/builtin/core.wren @@ -15,7 +15,7 @@ class Sequence { return result } - forall(f) { + all(f) { for (element in this) { if (!f.call(element)) return false } diff --git a/src/wren_core.c b/src/wren_core.c index d5faecd1..9ab2cd35 100644 --- a/src/wren_core.c +++ b/src/wren_core.c @@ -58,7 +58,7 @@ static const char* libSource = " return result\n" " }\n" "\n" -" forall(f) {\n" +" all(f) {\n" " for (element in this) {\n" " if (!f.call(element)) return false\n" " }\n" diff --git a/test/list/forall.wren b/test/list/forall.wren index 55e3d29b..c3ec24e5 100644 --- a/test/list/forall.wren +++ b/test/list/forall.wren @@ -1,9 +1,9 @@ var a = [1, 2, 3] -var b = a.forall {|x| x > 1 } +var b = a.all {|x| x > 1 } IO.print(b) // expect: false -var d = a.forall {|x| x > 0 } +var d = a.all {|x| x > 0 } IO.print(d) // expect: true -var e = [].forall {|x| false } +var e = [].all {|x| false } IO.print(e) // expect: true diff --git a/test/list/forall_non_bool_returning_fn.wren b/test/list/forall_non_bool_returning_fn.wren index a0cfaf94..b217702d 100644 --- a/test/list/forall_non_bool_returning_fn.wren +++ b/test/list/forall_non_bool_returning_fn.wren @@ -1 +1 @@ -[1, 2, 3].forall {|x| "string" } // expect runtime error: String does not implement method '!' with 0 arguments. +[1, 2, 3].all {|x| "string" } // expect runtime error: String does not implement method '!' with 0 arguments. diff --git a/test/list/forall_non_function_arg.wren b/test/list/forall_non_function_arg.wren index 6c48c77a..cca752fc 100644 --- a/test/list/forall_non_function_arg.wren +++ b/test/list/forall_non_function_arg.wren @@ -1 +1 @@ -[1, 2, 3].forall("string") // expect runtime error: String does not implement method 'call' with 1 argument. \ No newline at end of file +[1, 2, 3].all("string") // expect runtime error: String does not implement method 'call' with 1 argument. \ No newline at end of file