Do we have an easy way, without having recourse to join or flatten, of generating flat lists in the Wolfram Programming Language, akin to the list comprehension construct available in other functional programming languages ?
For example in Clojure, we can generate a flat list of tuples like so :
user=> ( for [ i ( range 3 ) j ( range i ) ] [ i j ] )
([1 0] [2 0] [2 1])
Of, if we so wish, a nested list, like so :
user=> ( for [ i ( range 3 ) ] ( for [ j ( range i ) ] [ i j ] ) )
(() ([1 0]) ([2 0] [2 1]))
Whereas in the Wolfram Programming Language it seems to me we are forced to generate nested lists and flatten them afterwards, like so :
Join@@Table[{i,j},{i,Range[3]},{j,Range[i]}]
In case there is no builtin support for such constructs, I suppose with some neat metaprogramming trick one may easily come up with a solution, though…
Thanks for your help.