User talk:Hout

From Rosetta Code
Revision as of 18:29, 7 September 2015 by Hout (talk | contribs) (Matches all three criteria, and arguably to a higher degree than the example which has been left in place.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Restored this on the grounds that it matches all three of the stated requirements:

- They should be distinct from (nested) for loops within the syntax of the language. - They should return either a list or an iterator (something that returns successive members of a collection, in order). - The syntax has parts corresponding to that of set-builder notation.

It uses no for loops, returns a list, and has the parts corresponding to set-building notation.

The previous alternative is useful, but is restricted to a smaller subset of JavaScript, and arguably uses for loops.

If we are to delete one, we should delete both, but I am not sure that either approach has much value.

Both examples are illustrative of such resources as JavaScript is currently able to provide for patterns of this kind.