List comprehensions: Difference between revisions

m
→‎{{header|CoffeeScript}}: 2*syntaxhighlight -> 1 plus comment
m (→‎{{header|C}}: 3 syntaxhighlight -> 1 plus comment)
m (→‎{{header|CoffeeScript}}: 2*syntaxhighlight -> 1 plus comment)
Line 604:
[x, y, z]
))
<code># pyth</code> can also be written more concisely as
<syntaxhighlight# lang="coffeescript">pyth = (n) -> flatten (flatten ([x, y, z] for z in [y..n] when x*x + y*y is z*z for y in [x..n]) for x in [1..n])</syntaxhighlight>
 
console.dir pyth 20</syntaxhighlight>
 
<code>pyth</code> can also be written more concisely as
 
<syntaxhighlight lang="coffeescript">pyth = (n) -> flatten (flatten ([x, y, z] for z in [y..n] when x*x + y*y is z*z for y in [x..n]) for x in [1..n])</syntaxhighlight>
 
=={{header|Common Lisp}}==
7,796

edits