diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-08-29 15:59:30 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-08-29 16:00:04 -0700 |
| commit | 811fdd685670d2eb8c6bcb9e6e103e57bf402ca8 (patch) | |
| tree | c599fd7a609159c2ec50a30f1131000070e8eb03 /core/collections.nom | |
| parent | 22495c7d708b4950b83c5bc9b97806e19cd1fcfa (diff) | |
Tweaked version 3.6 to include deprecating list append/removal functions
in favor of using a method call style.
Diffstat (limited to 'core/collections.nom')
| -rw-r--r-- | core/collections.nom | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/collections.nom b/core/collections.nom index cba20f9..aade458 100644 --- a/core/collections.nom +++ b/core/collections.nom @@ -58,9 +58,9 @@ test: %list = [1, 2, 3, 4, 5] append 6 to %list assume ((last in %list) is 6) - pop from %list + %list::pop assume ((last in %list) is 5) - remove index 1 from %list + %list::remove index 1 assume ((first in %list) is 2) compile [..] append %item to %list, add %item to %list, to %list add %item, to %list append %item @@ -85,7 +85,7 @@ parse [%expression for %item in %iterable] as (..) result of: %comprehension = [] for %item in %iterable: - add %expression to %comprehension + %comprehension::add %expression return %comprehension parse [..] @@ -95,7 +95,7 @@ parse [..] result of: %comprehension = [] for %index in %start to %stop via %step: - add %expression to %comprehension + %comprehension::add %expression return %comprehension ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -114,7 +114,7 @@ parse [..] result of: %comprehension = [] for %key = %value in %iterable: - add %expression to %comprehension + %comprehension::add %expression return %comprehension # Dict comprehensions @@ -164,7 +164,7 @@ test: action [%lists flattened]: %flat = [] for %list in %lists: - for %item in %list: add %item to %flat + for %item in %list: %flat::add %item return %flat test: @@ -240,7 +240,7 @@ action [unique %items]: %seen = {} for % in %items: unless %seen.%: - add % to %unique + %unique::add % %seen.% = (yes) return %unique |
