diff options
author | stevedonovan <steve.j.donovan@gmail.com> | 2010-12-23 13:10:00 +0300 |
---|---|---|
committer | stevedonovan <steve.j.donovan@gmail.com> | 2010-12-23 13:10:00 +0300 |
commit | 4f93342b0e0ffe521dd248817703f7db12c3753f (patch) | |
tree | 4428bb9587e69e896b1ba3cc341be72281535651 /docs | |
parent | 9e7b50027b7ef0de3ef0409f1d10f6b36e0dbeda (diff) |
Minimal documentation and links for pl.comprehension
Diffstat (limited to 'docs')
-rw-r--r-- | docs/api/modules/pl.comprehension.html | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/docs/api/modules/pl.comprehension.html b/docs/api/modules/pl.comprehension.html new file mode 100644 index 0000000..6978e26 --- /dev/null +++ b/docs/api/modules/pl.comprehension.html @@ -0,0 +1,114 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<head> + <title>pl.comprehension: Module Index</title> + <link rel="stylesheet" href="../luadoc.css" type="text/css" /> + <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/--> +</head> + +<body> +<div id="container"> + +<div id="product"> + <div id="product_logo"></div> + <div id="product_name"><big><b></b></big></div> + <div id="product_description"></div> +</div> <!-- id="product" --> + +<div id="main"> + +<div id="navigation"> + + +<h2>LuaDoc</h2> +<ul> + + <li><a href="../index.html">Index</a></li> + +</ul> + + +<!-- Module list --> + +<h2>Modules</h2> +<ul> + + <li><strong>pl.comprehension</strong></li> + +</ul> + + + +<!-- File list --> + + + + + + +</div><!-- id="navigation" --> + +<div id="content"> + +<h1>Module "pl.comprehension"</h1> + +<p>List comprehensions implemented in Lua. <p> + +See the <a href="http://lua-users.org/wiki/ListComprehensions">wiki page</a> +<pre class=example> + local C= require 'pl.comprehension' . new() + + C ('x for x=1,10') () + ==> {1,2,3,4,5,6,7,8,9,10} + C 'x^2 for x=1,4' () + ==> {1,4,9,16} + C '{x,x^2} for x=1,4' () + ==> {{1,1},{2,4},{3,9},{4,16}} + C '2*x for x' {1,2,3} + ==> {2,4,6} + dbl = C '2*x for x' + dbl {10,20,30} + ==> {20,40,60} + C 'x for x if x % 2 == 0' {1,2,3,4,5} + ==> {2,4} + C '{x,y} for x = 1,2 for y = 1,2' () + ==> {{1,1},{1,2},{2,1},{2,2}} + C '{x,y} for x for y' ({1,2},{10,20}) + ==> {{1,10},{1,20},{2,10},{2,20}} + assert(C 'sum(x^2 for x)' {2,3,4} == 2^2+3^2+4^2) +</pre> + +<p> (c) 2008 David Manura. Licensed under the same terms as Lua (MIT license). +<p> -- See <a href="../../index.html#T31">the Guide</a></p> + + + + + + + + + + +<br/> +<br/> + + + + + + + + +</div> <!-- id="content" --> + +</div> <!-- id="main" --> + +<div id="about"> + <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> +</div> <!-- id="about" --> + +</div> <!-- id="container" --> +</body> +</html> |