diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-05-15 20:32:22 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-05-15 20:33:07 -0700 |
| commit | 3ffeaf1f5dbf3e225dc536066d0fedda3f38ac70 (patch) | |
| tree | ffd23e911254ad22593a9574b5c255d9bdf578ff /core/collections.nom | |
| parent | 0a95a264e5829153eb19bde54882e5c135d6bdad (diff) | |
Removed "for all"-style iteration and changed "for % from 1 to 10"-style
to "for % in 1 to 10" for consistency.
Diffstat (limited to 'core/collections.nom')
| -rw-r--r-- | core/collections.nom | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/core/collections.nom b/core/collections.nom index 189aa5d..7922a4f 100644 --- a/core/collections.nom +++ b/core/collections.nom @@ -66,33 +66,18 @@ immediately %comprehension.%i <- %expression return %comprehension - parse [%expression for all %iterable] as - %expression for % in %iterable - parse [..] - %expression for %index from %start to %stop via %step - %expression for %index from %start to %stop by %step + %expression for %index in %start to %stop via %step + %expression for %index in %start to %stop by %step ..as result of %comprehension <- [] - for %index from %start to %stop via %step + for %index in %start to %stop via %step add %expression to %comprehension return %comprehension - parse [%expression for all %iterable] as - %expression for % in %iterable - - parse [%expression for %var from %start to %stop] as - %expression for %var from %start to %stop via 1 - - parse [..] - %expression for all %start to %stop by %step - %expression for all %start to %stop via %step - ..as - %expression for % from %start to %stop via %step - - parse [%expression for all %start to %stop] as - %expression for all %start to %stop via 1 + parse [%expression for %var in %start to %stop] as + %expression for %var in %start to %stop via 1 parse [%expression for %key = %value in %iterable] as result of @@ -109,9 +94,6 @@ immediately %comprehension.%key <- %value return %comprehension - parse [%key = %value for all %iterable] as - %key = %value for % in %iterable - parse [%key = %value for %src_key = %src_value in %iterable] as result of %comprehension <- {} @@ -142,18 +124,18 @@ immediately immediately action [%items sorted, sorted %items] - %copy <- (% for all %items) + %copy <- (% for % in %items) sort %copy return %copy action [%items sorted by %key] - %copy <- (% for all %items) + %copy <- (% for % in %items) sort %copy by %key return %copy action [unique %items] %unique <- [] %seen <- {} - for all %items + for % in %items unless: % in %seen add % to %unique (% in %seen) <- (yes) |
