Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

B

i
Initial Git commit
  • Loading branch information...
commit 57e4c5deaee8b6b12be0792e4f1fdf40e555683a 0 parents
steve donovan authored
Showing with 32,037 additions and 0 deletions.
  1. +21 −0 LICENCE.txt
  2. +185 −0 README.txt
  3. +3 −0  docs/api/gen_modules
  4. +3 −0  docs/api/gen_modules.bat
  5. +291 −0 docs/api/index.html
  6. +286 −0 docs/api/luadoc.css
  7. +292 −0 docs/api/modules/pl.app.html
  8. +1,100 −0 docs/api/modules/pl.array2d.html
  9. +724 −0 docs/api/modules/pl.class.html
  10. +557 −0 docs/api/modules/pl.classx.html
  11. +261 −0 docs/api/modules/pl.config.html
  12. +351 −0 docs/api/modules/pl.data.html
  13. +559 −0 docs/api/modules/pl.dir.html
  14. +462 −0 docs/api/modules/pl.file.html
  15. +529 −0 docs/api/modules/pl.func.html
  16. +382 −0 docs/api/modules/pl.input.html
  17. +554 −0 docs/api/modules/pl.lexer.html
  18. +1,550 −0 docs/api/modules/pl.list.html
  19. +945 −0 docs/api/modules/pl.operator.html
  20. +817 −0 docs/api/modules/pl.path.html
  21. +260 −0 docs/api/modules/pl.permute.html
  22. +305 −0 docs/api/modules/pl.pretty.html
  23. +1,053 −0 docs/api/modules/pl.seq.html
  24. +469 −0 docs/api/modules/pl.sip.html
  25. +245 −0 docs/api/modules/pl.stringio.html
  26. +1,144 −0 docs/api/modules/pl.stringx.html
  27. +1,887 −0 docs/api/modules/pl.tablex.html
  28. +310 −0 docs/api/modules/pl.test.html
  29. +444 −0 docs/api/modules/pl.text.html
  30. +872 −0 docs/api/modules/pl.utils.html
  31. +9 −0 docs/doc.css
  32. +44 −0 docs/docgen.lua
  33. +301 −0 docs/function_index.html
  34. +275 −0 docs/function_index.txt
  35. +2,540 −0 docs/index.html
  36. +83 −0 docs/index.lua
  37. +2,266 −0 docs/penlight.md
  38. +54 −0 examples/seesubst.lua
  39. +33 −0 examples/sipscan.lua
  40. +222 −0 examples/symbols.lua
  41. +4 −0 examples/test-cmp.lua
  42. +11 −0 examples/test-listcallbacks.lua
  43. +13 −0 examples/test-pretty.lua
  44. +85 −0 examples/test-symbols.lua
  45. +5 −0 examples/testapp.lua
  46. +38 −0 examples/testclone.lua
  47. +51 −0 examples/testconfig.lua
  48. +27 −0 examples/testglobal.lua
  49. +13 −0 examples/testinputfields.lua
  50. +8 −0 examples/testinputfields2.lua
  51. +81 −0 examples/testxml.lua
  52. +28 −0 examples/which.lua
  53. BIN  lua/pl.zip
  54. +115 −0 lua/pl/app.lua
  55. +358 −0 lua/pl/array2d.lua
  56. +359 −0 lua/pl/class.lua
  57. +177 −0 lua/pl/classx.lua
  58. +24 −0 lua/pl/compat52.lua
  59. +278 −0 lua/pl/comprehension.lua
  60. +127 −0 lua/pl/config.lua
  61. +447 −0 lua/pl/data.lua
  62. +352 −0 lua/pl/dir.lua
  63. +64 −0 lua/pl/file.lua
  64. +353 −0 lua/pl/func.lua
  65. +45 −0 lua/pl/init.lua
  66. +157 −0 lua/pl/input.lua
  67. +322 −0 lua/pl/lapp.lua
  68. +386 −0 lua/pl/lexer.lua
  69. +497 −0 lua/pl/list.lua
  70. +255 −0 lua/pl/luabalanced.lua
  71. +190 −0 lua/pl/operator.lua
  72. +289 −0 lua/pl/path.lua
  73. +59 −0 lua/pl/permute.lua
  74. +162 −0 lua/pl/pretty.lua
  75. +512 −0 lua/pl/seq.lua
  76. +295 −0 lua/pl/sip.lua
  77. +70 −0 lua/pl/strict.lua
  78. +52 −0 lua/pl/stringio.lua
  79. +335 −0 lua/pl/stringx.lua
  80. +747 −0 lua/pl/tablex.lua
  81. +66 −0 lua/pl/test.lua
  82. +168 −0 lua/pl/text.lua
  83. +392 −0 lua/pl/utils.lua
  84. +26 −0 nrun.lua
  85. +63 −0 penlight-0.8-1.rockspec
  86. +26 −0 run.lua
  87. +21 −0 tests/test-args.lua
  88. +14 −0 tests/test-array.lua
  89. +13 −0 tests/test-compare-no-order.lua
  90. +70 −0 tests/test-comprehension.lua
  91. +68 −0 tests/test-config.lua
  92. +122 −0 tests/test-data.lua
  93. +83 −0 tests/test-func.lua
  94. +20 −0 tests/test-job-query.lua
  95. +46 −0 tests/test-lapp.lua
  96. +42 −0 tests/test-lexer.lua
  97. +17 −0 tests/test-map.lua
  98. +12 −0 tests/test-move.lua
  99. +20 −0 tests/test-path.lua
  100. +36 −0 tests/test-pretty.lua
  101. +57 −0 tests/test-pylib.lua
  102. +9 −0 tests/test-seq.lua
  103. +96 −0 tests/test-set.lua
  104. +99 −0 tests/test-sip.lua
  105. +8 −0 tests/test-strict.lua
  106. +8 −0 tests/test-stringio.lua
  107. +103 −0 tests/test-tablex.lua
  108. +61 −0 tests/test-text.lua
  109. +83 −0 tests/testfunc.lua
  110. +96 −0 tests/testset.lua
  111. +13 −0 teststrictmod1.lua
21 LICENCE.txt
@@ -0,0 +1,21 @@
+Copyright (C) 2009 Steve Donovan, David Manura.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
+OR OTHER DEALINGS IN THE SOFTWARE.
185 README.txt
@@ -0,0 +1,185 @@
+Penlight Lua Libraries
+
+1. Why a new set of libraries?
+
+Penlight brings together a set of generally useful pure Lua modules,
+focussing on input data handling (such as reading configuration files),
+functional programming (such as map, reduce, placeholder expressions,etc),
+and OS path management. Much of the functionality is inspired by the
+Python standard libraries.
+
+2. Requirements
+
+The file and directory functions depend on LuaFileSystem (lfs). If you want
+dir.copyfile to work elegantly on Windows, then you need Alien. (Both are
+present in Lua for Windows.)
+
+3. Known Issues
+
+Error handling is still hit and miss.
+
+There are 7581 lines of source and 1764 lines of formal tests,
+which is not an ideal ratio.
+
+Formal documentation for comprehension and luabalanced is missing.
+
+4. Installation
+
+The directory structure is
+
+ lua
+ pl
+ (module files)
+ examples
+ (examples)
+ tests
+ (tests)
+ docs
+ (index.html)
+ api
+ (index.html)
+ modules
+
+All you need to do is copy the pl directory into your Lua module path, which
+is typically /usr/local/share/lua/5.1 on a Linux system (of course, you
+can set LUA_PATH appropriately.)
+
+With Lua for Windows, if LUA stands for 'c:\Program Files\Lua\5.1',
+then pl goes into LUA\lua, docs goes into LUA\examples\penlight and
+both examples and tests goes into LUA\examples
+
+5. Building the Documentation
+
+The Users Guide is processed by markdown.lua. If you like the section headers,
+you'll need to download my modified version:
+
+http://mysite.mweb.co.za/residents/sdonovan/lua/markdown.zip
+
+docgen.lua will preprocess the documentation (handles @see references)
+and use markdown.
+
+gen_modules.bat does the LuaDoc stuff.
+
+6. What's new with 0.8b ?
+
+Features:
+
+pl.app provides useful stuff like simple command-line argument parsing and require_here(), which
+makes subsequent require() calls look in the local directory by preference.
+
+p.file provides useful functions like copy(),move(), read() and write(). (These are aliases to
+dir.copyfile(),movefile(),utils.readfile(),writefile())
+
+Custom error trace will only show the functions in user code.
+
+More robust argument checking.
+
+In function arguments, now supports 'string lambdas', e.g. '|x| 2*x'
+
+utils.readfile,writefile now insist on being given filenames. This will cause less confusion.
+
+tablex.search() is new: will look recursively in an arbitrary table; can specify tables not to follow.
+tablex.move() will work with source and destination tables the same, with overlapping ranges.
+
+Bug Fixes:
+
+dir.copyfile() now works fine without Alien on Windows
+
+dir.makepath() and rmtree() had problems.
+
+tablex.compare_no_order() is now O(NlogN), as expected.
+tablex.move() had a problem with source size
+
+7. What's New with 0.7.0b?
+
+Features:
+
+utils.is_type(v,tp) can say is_type(s,'string') and is_type(l,List).
+utils.is_callable(v) either a function, or has a __call metamethod.
+
+Sequence wrappers: can write things like this:
+
+seq(s):last():filter('<'):copy()
+
+seq:mapmethod(s,name) - map using a named method over a sequence.
+
+seq:enum(s) If s is a simple sequence, then
+ for i,v in seq.enum(s) do print(i,v) end
+
+seq:take(s,n) Grab the next n values from a (possibly infinite)
+sequence.
+
+In a related change suggested by Flemming Madsden, the in-place List
+methods like reverse() and sort() return the list, allowing for
+method chaining.
+
+list.join() explicitly converts using tostring first.
+
+tablex.count_map() like seq.count_map(), but takes an equality function.
+
+tablex.difference() set difference
+tablex.set() explicit set generator given a list of values
+
+Template.indent_substitute() is a new Template method which adjusts
+for indentation and can also substitute templates themselves.
+
+pretty.read(). This reads a Lua table (as dumped by pretty.write)
+and attempts to be paranoid about its contents.
+
+sip.match_at_start(). Convenience function for anchored SIP matches.
+
+Bug Fixes:
+
+tablex.deepcompare() was confused by false boolean values, which
+it thought were synonymous with being nil.
+
+pretty.write() did not handle cycles, and could not display tables
+with 'holes' properly (Flemming Madsden)
+
+The SIP pattern '$(' was not escaped properly.
+sip.match() did not pass on options table.
+
+seq.map() was broken for double-valued sequences.
+seq.copy_tuples() did not use default_iter(), so did not e.g. like
+table arguments.
+
+dir.copyfile() returns the wrong result for *nix operations.
+dir.makepath() was broken for non-Windows paths.
+
+8. What's New with 0.6.3?
+
+The map and reduce functions now take the function first, as Nature intended.
+
+The Python-like overloading of '*' for strings has been dropped, since it
+is silly. Also, strings are no longer callable; use 's:at(1)' instead of
+'s(1)' - this tended to cause Obscure Error messages.
+
+Wherever a function argument is expected, you can use the operator strings
+like '+','==',etc as well as pl.operator.add, pl.operator.eq, etc.
+(see end of pl/operator.lua for the full list.)
+
+tablex now has compare() and compare_no_order(). An explicit set()
+function has been added which constructs a table with the specified
+keys, all set to a value of true.
+
+List has reduce() and partition() (This is a cool function which
+separates out elements of a list depending on a classifier function.)
+
+There is a new array module which generalizes tablex operations like
+map and reduce for two-dimensional arrays.
+
+The famous iterator over permutations from PiL 9.3 has been included.
+
+David Manura's list comprehension library has been included.
+
+Also, utils now contains his memoize function, plus a useful function
+args which captures the case where varargs contains nils.
+
+There was a bug with dir.copyfile() where the flag was the wrong way round.
+
+config.lines() had a problem with continued lines.
+
+Some operators were missing in pl.operator; have renamed them to be
+consistent with the Lua metamethod names.
+
+
3  docs/api/gen_modules
@@ -0,0 +1,3 @@
+lua /lua/lua/luadoc_start.lua -p /lang/lua/projects/pl-0.8/lua/pl -nofiles
+
+
3  docs/api/gen_modules.bat
@@ -0,0 +1,3 @@
+lua c:/lua/lua/luadoc_start.lua -p d:/dev/lua/projects/penlight-0.8/lua/pl -nofiles
+
+
291 docs/api/index.html
@@ -0,0 +1,291 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+ <title>Reference</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">
+
+
+<h1>LuaDoc</h1>
+<ul>
+
+ <li><strong>Index</strong></li>
+
+</ul>
+
+
+<!-- Module list -->
+
+<h1>Modules</h1>
+<ul>
+
+ <li>
+ <a href="modules/pl.app.html">pl.app</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.array2d.html">pl.array2d</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.class.html">pl.class</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.classx.html">pl.classx</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.config.html">pl.config</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.data.html">pl.data</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.dir.html">pl.dir</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.file.html">pl.file</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.func.html">pl.func</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.input.html">pl.input</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.lexer.html">pl.lexer</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.list.html">pl.list</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.operator.html">pl.operator</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.path.html">pl.path</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.permute.html">pl.permute</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.pretty.html">pl.pretty</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.seq.html">pl.seq</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.sip.html">pl.sip</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.stringio.html">pl.stringio</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.stringx.html">pl.stringx</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.tablex.html">pl.tablex</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.test.html">pl.test</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.text.html">pl.text</a>
+ </li>
+
+ <li>
+ <a href="modules/pl.utils.html">pl.utils</a>
+ </li>
+
+</ul>
+
+
+
+<!-- File list -->
+
+
+
+
+
+
+</div> <!-- id="navigation" -->
+
+<div id="content">
+
+
+
+<h2>Modules</h2>
+<table class="module_list">
+<!--<tr><td colspan="2">Modules</td></tr>-->
+
+ <tr>
+ <td class="name"><a href="modules/pl.app.html">pl.app</a></td>
+ <td class="summary">Application support functions.</td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.array2d.html">pl.array2d</a></td>
+ <td class="summary">Operations on two-dimensional arrays.</td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.class.html">pl.class</a></td>
+ <td class="summary">Wrapper classes: Map and Set.</td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.classx.html">pl.classx</a></td>
+ <td class="summary">extra classes: MultiMap, OrderedMap and Typed List.</td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.config.html">pl.config</a></td>
+ <td class="summary">reads configuration files into a Lua table.</td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.data.html">pl.data</a></td>
+ <td class="summary">Reading and querying simple tabular data.</td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.dir.html">pl.dir</a></td>
+ <td class="summary">Useful functions for getting directory contents and matching them against wildcards </td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.file.html">pl.file</a></td>
+ <td class="summary">File Operations: copy,move,reading,writing </td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.func.html">pl.func</a></td>
+ <td class="summary">Functional helpers like composition,binding and placeholder expressions.</td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.input.html">pl.input</a></td>
+ <td class="summary">Iterators for extracting words or numbers from an input source.</td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.lexer.html">pl.lexer</a></td>
+ <td class="summary">Lexical scanner for creating a sequence of tokens from text.</td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.list.html">pl.list</a></td>
+ <td class="summary"></td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.operator.html">pl.operator</a></td>
+ <td class="summary">Lua operators available as functions.</td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.path.html">pl.path</a></td>
+ <td class="summary">path manipulation and file queries.</td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.permute.html">pl.permute</a></td>
+ <td class="summary">Permutation operations </td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.pretty.html">pl.pretty</a></td>
+ <td class="summary">Pretty-printing Lua tables </td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.seq.html">pl.seq</a></td>
+ <td class="summary">Manipulating sequences as iterators.</td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.sip.html">pl.sip</a></td>
+ <td class="summary">Simple Input Patterns (SIP).</td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.stringio.html">pl.stringio</a></td>
+ <td class="summary">reading and writing strings using Lua IO </td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.stringx.html">pl.stringx</a></td>
+ <td class="summary">Python-style string library.</td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.tablex.html">pl.tablex</a></td>
+ <td class="summary">Extended operations on Lua tables </td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.test.html">pl.test</a></td>
+ <td class="summary"></td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.text.html">pl.text</a></td>
+ <td class="summary">Text processing utilities.</td>
+ </tr>
+
+ <tr>
+ <td class="name"><a href="modules/pl.utils.html">pl.utils</a></td>
+ <td class="summary">Generally useful routines.</td>
+ </tr>
+
+</table>
+
+
+
+
+
+
+</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>
286 docs/api/luadoc.css
@@ -0,0 +1,286 @@
+body {
+ margin-left: 1em;
+ margin-right: 1em;
+ font-family: arial, helvetica, geneva, sans-serif;
+ background-color:#ffffff; margin:0px;
+}
+
+code {
+ font-family: "Andale Mono", monospace;
+}
+
+tt {
+ font-family: "Andale Mono", monospace;
+}
+
+body, td, th { font-size: 11pt; }
+
+h1, h2, h3, h4 { margin-left: 0em; }
+
+textarea, pre, tt { font-size:10pt; }
+body, td, th { color:#000000; }
+small { font-size:0.85em; }
+h1 { font-size:1.5em; }
+h2 { font-size:1.25em; }
+h3 { font-size:1.15em; }
+h4 { font-size:1.06em; }
+
+a:link { font-weight:bold; color: #004080; text-decoration: none; }
+a:visited { font-weight:bold; color: #006699; text-decoration: none; }
+a:link:hover { text-decoration:underline; }
+hr { color:#cccccc }
+img { border-width: 0px; }
+
+
+h3 { padding-top: 1em; }
+
+p { margin-left: 1em; }
+
+p.name {
+ font-family: "Andale Mono", monospace;
+ padding-top: 1em;
+ margin-left: 0em;
+}
+
+blockquote { margin-left: 3em; }
+
+pre.example {
+ background-color: rgb(245, 245, 245);
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-style: solid;
+ border-right-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-top-color: silver;
+ border-right-color: silver;
+ border-bottom-color: silver;
+ border-left-color: silver;
+ padding: 1em;
+ margin-left: 1em;
+ margin-right: 1em;
+ font-family: "Andale Mono", monospace;
+ font-size: smaller;
+}
+
+
+hr {
+ margin-left: 0em;
+ background: #00007f;
+ border: 0px;
+ height: 1px;
+}
+
+ul { list-style-type: disc; }
+
+table.index { border: 1px #00007f; }
+table.index td { text-align: left; vertical-align: top; }
+table.index ul { padding-top: 0em; margin-top: 0em; }
+
+table {
+ border: 1px solid black;
+ border-collapse: collapse;
+ margin-left: auto;
+ margin-right: auto;
+}
+th {
+ border: 1px solid black;
+ padding: 0.5em;
+}
+td {
+ border: 1px solid black;
+ padding: 0.5em;
+}
+div.header, div.footer { margin-left: 0em; }
+
+#container
+{
+ margin-left: 1em;
+ margin-right: 1em;
+ background-color: #f0f0f0;
+}
+
+#product
+{
+ text-align: center;
+ border-bottom: 1px solid #cccccc;
+ background-color: #ffffff;
+}
+
+#product big {
+ font-size: 2em;
+}
+
+#product_logo
+{
+}
+
+#product_name
+{
+}
+
+#product_description
+{
+}
+
+#main
+{
+ background-color: #f0f0f0;
+ border-left: 2px solid #cccccc;
+}
+
+#navigation
+{
+ float: left;
+ width: 18em;
+ margin: 0;
+ vertical-align: top;
+ background-color: #f0f0f0;
+ overflow:visible;
+}
+
+#navigation h1 {
+ background-color:#e7e7e7;
+ font-size:1.1em;
+ color:#000000;
+ text-align:left;
+ margin:0px;
+ padding:0.2em;
+ border-top:1px solid #dddddd;
+ border-bottom:1px solid #dddddd;
+}
+
+#navigation ul
+{
+ font-size:1em;
+ list-style-type: none;
+ padding: 0;
+ margin: 1px;
+}
+
+#navigation li
+{
+ text-indent: -1em;
+ margin: 0em 0em 0em 0.5em;
+ display: block;
+ padding: 3px 0px 0px 12px;
+}
+
+#navigation li li a
+{
+ padding: 0px 3px 0px -1em;
+}
+
+#content
+{
+ margin-left: 18em;
+ padding: 1em;
+ border-left: 2px solid #cccccc;
+ border-right: 2px solid #cccccc;
+ background-color: #ffffff;
+}
+
+#about
+{
+ clear: both;
+ margin: 0;
+ padding: 5px;
+ border-top: 2px solid #cccccc;
+ background-color: #ffffff;
+}
+
+@media print {
+ body {
+ font: 12pt "Times New Roman", "TimeNR", Times, serif;
+ }
+ a { font-weight:bold; color: #004080; text-decoration: underline; }
+
+ #main
+ {
+ background-color: #ffffff;
+ border-left: 0px;
+ }
+
+ #container
+ {
+ margin-left: 2%;
+ margin-right: 2%;
+ background-color: #ffffff;
+ }
+
+ #content
+ {
+ margin-left: 0px;
+ padding: 1em;
+ border-left: 0px;
+ border-right: 0px;
+ background-color: #ffffff;
+ }
+
+ #navigation
+ {
+ display: none;
+ }
+ pre.example {
+ font-family: "Andale Mono", monospace;
+ font-size: 10pt;
+ page-break-inside: avoid;
+ }
+}
+
+table.module_list td
+{
+ border-width: 1px;
+ padding: 3px;
+ border-style: solid;
+ border-color: #cccccc;
+}
+table.module_list td.name { background-color: #f0f0f0; }
+table.module_list td.summary { width: 100%; }
+
+table.file_list
+{
+ border-width: 1px;
+ border-style: solid;
+ border-color: #cccccc;
+ border-collapse: collapse;
+}
+table.file_list td
+{
+ border-width: 1px;
+ padding: 3px;
+ border-style: solid;
+ border-color: #cccccc;
+}
+table.file_list td.name { background-color: #f0f0f0; }
+table.file_list td.summary { width: 100%; }
+
+
+table.function_list
+{
+ border-width: 1px;
+ border-style: solid;
+ border-color: #cccccc;
+ border-collapse: collapse;
+}
+table.function_list td
+{
+ border-width: 1px;
+ padding: 3px;
+ border-style: solid;
+ border-color: #cccccc;
+}
+table.function_list td.name { background-color: #f0f0f0; }
+table.function_list td.summary { width: 100%; }
+
+
+table.table_list
+{
+ border-width: 1px;
+ border-style: solid;
+ border-color: #cccccc;
+ border-collapse: collapse;
+}
+table.table_list td
292 docs/api/modules/pl.app.html
@@ -0,0 +1,292 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+ <title>Reference</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">
+
+
+<h1>LuaDoc</h1>
+<ul>
+
+ <li><a href="../index.html">Index</a></li>
+
+</ul>
+
+
+<!-- Module list -->
+
+<h1>Modules</h1>
+<ul>
+
+ <li><strong>pl.app</strong></li>
+
+ <li>
+ <a href="../modules/pl.array2d.html">pl.array2d</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.class.html">pl.class</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.classx.html">pl.classx</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.config.html">pl.config</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.data.html">pl.data</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.dir.html">pl.dir</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.file.html">pl.file</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.func.html">pl.func</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.input.html">pl.input</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.lexer.html">pl.lexer</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.list.html">pl.list</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.operator.html">pl.operator</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.path.html">pl.path</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.permute.html">pl.permute</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.pretty.html">pl.pretty</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.seq.html">pl.seq</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.sip.html">pl.sip</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.stringio.html">pl.stringio</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.stringx.html">pl.stringx</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.tablex.html">pl.tablex</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.test.html">pl.test</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.text.html">pl.text</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.utils.html">pl.utils</a>
+ </li>
+
+</ul>
+
+
+
+<!-- File list -->
+
+
+
+
+
+
+</div><!-- id="navigation" -->
+
+<div id="content">
+
+<h1>Module <code>pl.app</code></h1>
+
+<p>Application support functions.</p>
+
+
+
+
+
+
+<h2>Functions</h2>
+<table class="function_list">
+
+ <tr>
+ <td class="name" nowrap><a href="#appfile">appfile</a>&nbsp;(file)</td>
+ <td class="summary">return a suitable path for files private to this application.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#parse_args">parse_args</a>&nbsp;(args, flags_with_values)</td>
+ <td class="summary">parse command-line arguments into flags and parameters.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#require_here">require_here</a>&nbsp;()</td>
+ <td class="summary">add the current script's path to the Lua module path.</td>
+ </tr>
+
+</table>
+
+
+
+
+
+<br/>
+<br/>
+
+
+
+<h2><a name="functions"></a>Functions</h2>
+<dl class="function">
+
+
+
+<dt><a name="appfile"></a><strong>appfile</strong>&nbsp;(file)</dt>
+<dd>
+return a suitable path for files private to this application. These will look like '~/.SNAME/file', with '~' as with expanduser and SNAME is the name of the script without .lua extension.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>file</em></code>: a filename (w/out path)
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+<ul>a full pathname</ul>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="parse_args"></a><strong>parse_args</strong>&nbsp;(args, flags_with_values)</dt>
+<dd>
+parse command-line arguments into flags and parameters. Understands GNU-style command-line flags; short (-f) and long (--flag). These may be given a value with either '=' or ':' (-k:2,--alpha=3.2,-n2); note that a number value can be given without a space. Multiple short args can be combined like so: (-abcd).
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>args</em></code>: an array of strings (default is the global 'arg')
+ </li>
+
+ <li>
+ <code><em>flags_with_values</em></code>: any flags that take values, e.g. <code>{out=true}</code>
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return values:</h3>
+<ol>
+
+ <li>a table of flags (flag=value pairs)</li>
+
+ <li>an array of parameters</li>
+
+</ol>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="require_here"></a><strong>require_here</strong>&nbsp;()</dt>
+<dd>
+add the current script's path to the Lua module path. Applies to both the source and the binary module paths. It makes it easy for the main file of a multi-file program to access its modules in the same directory.
+
+
+
+
+
+
+
+<h3>Return value:</h3>
+<ul>the current script's path with a trailing slash</ul>
+
+
+
+</dd>
+
+
+</dl>
+
+
+
+
+
+
+</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>
1,100 docs/api/modules/pl.array2d.html
@@ -0,0 +1,1100 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+ <title>Reference</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">
+
+
+<h1>LuaDoc</h1>
+<ul>
+
+ <li><a href="../index.html">Index</a></li>
+
+</ul>
+
+
+<!-- Module list -->
+
+<h1>Modules</h1>
+<ul>
+
+ <li>
+ <a href="../modules/pl.app.html">pl.app</a>
+ </li>
+
+ <li><strong>pl.array2d</strong></li>
+
+ <li>
+ <a href="../modules/pl.class.html">pl.class</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.classx.html">pl.classx</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.config.html">pl.config</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.data.html">pl.data</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.dir.html">pl.dir</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.file.html">pl.file</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.func.html">pl.func</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.input.html">pl.input</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.lexer.html">pl.lexer</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.list.html">pl.list</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.operator.html">pl.operator</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.path.html">pl.path</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.permute.html">pl.permute</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.pretty.html">pl.pretty</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.seq.html">pl.seq</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.sip.html">pl.sip</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.stringio.html">pl.stringio</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.stringx.html">pl.stringx</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.tablex.html">pl.tablex</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.test.html">pl.test</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.text.html">pl.text</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.utils.html">pl.utils</a>
+ </li>
+
+</ul>
+
+
+
+<!-- File list -->
+
+
+
+
+
+
+</div><!-- id="navigation" -->
+
+<div id="content">
+
+<h1>Module <code>pl.array2d</code></h1>
+
+<p>Operations on two-dimensional arrays.</p>
+
+
+
+
+
+
+<h2>Functions</h2>
+<table class="function_list">
+
+ <tr>
+ <td class="name" nowrap><a href="#column">column</a>&nbsp;(a, key)</td>
+ <td class="summary">extract a column from the 2D array.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#extract_cols">extract_cols</a>&nbsp;(t, cidx, a)</td>
+ <td class="summary">extract the specified columns.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#extract_rows">extract_rows</a>&nbsp;(t, ridx, a)</td>
+ <td class="summary">extract the specified rows.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#forall">forall</a>&nbsp;(t, row_op, end_row_op, i1, j1, i2, j2, a)</td>
+ <td class="summary">perform an operation for all values in a 2D array.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#iter">iter</a>&nbsp;(a, indices, i1, j1, i2, j2)</td>
+ <td class="summary">iterate over all elements in a 2D array, with optional indices.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#map">map</a>&nbsp;(f, a, arg)</td>
+ <td class="summary">map a function over a 2D array </td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#map2">map2</a>&nbsp;(f, ad, bd, a, b, arg)</td>
+ <td class="summary">map a function over two arrays.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#parse_range">parse_range</a>&nbsp;(s)</td>
+ <td class="summary">parse a spreadsheet range.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#product">product</a>&nbsp;(f, t1, t2)</td>
+ <td class="summary">cartesian product of two 1d arrays.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#range">range</a>&nbsp;(t, rstr)</td>
+ <td class="summary">get a slice of a 2D array using spreadsheet range notation (see <a href="#parse_range">parse_range</a>).</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#reduce2">reduce2</a>&nbsp;(opc, opr, a)</td>
+ <td class="summary">reduce a 2D array into a scalar, using two operations.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#reduce_cols">reduce_cols</a>&nbsp;(f, a)</td>
+ <td class="summary">reduce the columns using a function.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#reduce_rows">reduce_rows</a>&nbsp;(f, a)</td>
+ <td class="summary">reduce the rows using a function.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#remove_col">remove_col</a>&nbsp;(t, j)</td>
+ <td class="summary">remove a column from an array.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#remove_row">remove_row</a>&nbsp;(t, i)</td>
+ <td class="summary">remove a row from an array.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#set">set</a>&nbsp;(t, value, i1, j1, i2, j2)</td>
+ <td class="summary">set a specified range of an array to a value.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#slice">slice</a>&nbsp;(t, i1, j1, i2, j2)</td>
+ <td class="summary">get a slice of a 2D array.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#swap_cols">swap_cols</a>&nbsp;(t, j1, j2, i1, i2)</td>
+ <td class="summary">swap two columns of an array.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#swap_rows">swap_rows</a>&nbsp;(t, i1, i2)</td>
+ <td class="summary">swap two rows of an array.</td>
+ </tr>
+
+ <tr>
+ <td class="name" nowrap><a href="#write">write</a>&nbsp;(t, f, fmt, i1, j1, i2, j2)</td>
+ <td class="summary">write a 2D array to a file.</td>
+ </tr>
+
+</table>
+
+
+
+
+
+<br/>
+<br/>
+
+
+
+<h2><a name="functions"></a>Functions</h2>
+<dl class="function">
+
+
+
+<dt><a name="column"></a><strong>column</strong>&nbsp;(a, key)</dt>
+<dd>
+extract a column from the 2D array.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>a</em></code>: 2d array
+ </li>
+
+ <li>
+ <code><em>key</em></code>: an index or key
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+<ul>1d array</ul>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="extract_cols"></a><strong>extract_cols</strong>&nbsp;(t, cidx, a)</dt>
+<dd>
+extract the specified columns.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>t</em></code>:
+ </li>
+
+ <li>
+ <code><em>cidx</em></code>: a table of column indices
+ </li>
+
+ <li>
+ <code><em>a</em></code>: 2d array
+ </li>
+
+</ul>
+
+
+
+
+
+
+
+
+</dd>
+
+
+
+
+<dt><a name="extract_rows"></a><strong>extract_rows</strong>&nbsp;(t, ridx, a)</dt>
+<dd>
+extract the specified rows.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>t</em></code>:
+ </li>
+
+ <li>
+ <code><em>ridx</em></code>: a table of row indices
+ </li>
+
+ <li>
+ <code><em>a</em></code>: 2d array
+ </li>
+
+</ul>
+
+
+
+
+
+
+
+
+</dd>
+
+
+
+
+<dt><a name="forall"></a><strong>forall</strong>&nbsp;(t, row_op, end_row_op, i1, j1, i2, j2, a)</dt>
+<dd>
+perform an operation for all values in a 2D array.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>t</em></code>:
+ </li>
+
+ <li>
+ <code><em>row_op</em></code>: function to call on each value
+ </li>
+
+ <li>
+ <code><em>end_row_op</em></code>: function to call at end of each row
+ </li>
+
+ <li>
+ <code><em>i1</em></code>: start row (default 1)
+ </li>
+
+ <li>
+ <code><em>j1</em></code>: end col (default M)
+ </li>
+
+ <li>
+ <code><em>i2</em></code>: end row (default N)
+ </li>
+
+ <li>
+ <code><em>j2</em></code>:
+ </li>
+
+ <li>
+ <code><em>a</em></code>: 2D array
+ </li>
+
+</ul>
+
+
+
+
+
+
+
+
+</dd>
+
+
+
+
+<dt><a name="iter"></a><strong>iter</strong>&nbsp;(a, indices, i1, j1, i2, j2)</dt>
+<dd>
+iterate over all elements in a 2D array, with optional indices.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>a</em></code>: 2D array
+ </li>
+
+ <li>
+ <code><em>indices</em></code>: with indices (default false)
+ </li>
+
+ <li>
+ <code><em>i1</em></code>: start row (default 1)
+ </li>
+
+ <li>
+ <code><em>j1</em></code>: end col (default M)
+ </li>
+
+ <li>
+ <code><em>i2</em></code>: end row (default N)
+ </li>
+
+ <li>
+ <code><em>j2</em></code>:
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+<ul>either value or i,j,value depending on indices</ul>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="map"></a><strong>map</strong>&nbsp;(f, a, arg)</dt>
+<dd>
+map a function over a 2D array
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>f</em></code>: a function of at least one argument
+ </li>
+
+ <li>
+ <code><em>a</em></code>: 2d array
+ </li>
+
+ <li>
+ <code><em>arg</em></code>: an optional extra argument to be passed to the function.
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+<ul>2d array</ul>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="map2"></a><strong>map2</strong>&nbsp;(f, ad, bd, a, b, arg)</dt>
+<dd>
+map a function over two arrays. They can be both or either 2D arrays
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>f</em></code>: function of at least two arguments
+ </li>
+
+ <li>
+ <code><em>ad</em></code>: order of first array
+ </li>
+
+ <li>
+ <code><em>bd</em></code>: order of second array
+ </li>
+
+ <li>
+ <code><em>a</em></code>: 1d or 2d array
+ </li>
+
+ <li>
+ <code><em>b</em></code>: 1d or 2d array
+ </li>
+
+ <li>
+ <code><em>arg</em></code>: optional extra argument to pass to function
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+<ul>2D array, unless both arrays are 1D</ul>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="parse_range"></a><strong>parse_range</strong>&nbsp;(s)</dt>
+<dd>
+parse a spreadsheet range. The range can be specified either as 'A1:B2' or 'R1C1:R2C2'; a special case is a single element (e.g 'A1' or 'R1C1')
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>s</em></code>: a range.
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return values:</h3>
+<ol>
+
+ <li>start col</li>
+
+ <li>start row</li>
+
+ <li>end col</li>
+
+ <li>end row</li>
+
+</ol>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="product"></a><strong>product</strong>&nbsp;(f, t1, t2)</dt>
+<dd>
+cartesian product of two 1d arrays.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>f</em></code>: a function of 2 arguments
+ </li>
+
+ <li>
+ <code><em>t1</em></code>: a 1d table
+ </li>
+
+ <li>
+ <code><em>t2</em></code>: a 1d table
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+<ul>2d table</ul>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="range"></a><strong>range</strong>&nbsp;(t, rstr)</dt>
+<dd>
+get a slice of a 2D array using spreadsheet range notation (see <a href="#parse_range">parse_range</a>).
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>t</em></code>: a 2D array
+ </li>
+
+ <li>
+ <code><em>rstr</em></code>: range expression
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+<ul>a slice</ul>
+
+
+
+<h3>See also:</h3>
+<ul>
+
+ <!-- <li><a href="#../modules/pl.array2d.html#parse_rangeparse_range"> -->
+ <li><a href="#parse_range">
+ parse_range</li>
+ </a>
+
+ <!-- <li><a href="#../modules/pl.array2d.html#sliceslice"> -->
+ <li><a href="#slice">
+ slice</li>
+ </a>
+
+</ul>
+
+</dd>
+
+
+
+
+<dt><a name="reduce2"></a><strong>reduce2</strong>&nbsp;(opc, opr, a)</dt>
+<dd>
+reduce a 2D array into a scalar, using two operations.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>opc</em></code>: operation to reduce the final result
+ </li>
+
+ <li>
+ <code><em>opr</em></code>: operation to reduce the rows
+ </li>
+
+ <li>
+ <code><em>a</em></code>: 2D array
+ </li>
+
+</ul>
+
+
+
+
+
+
+
+
+</dd>
+
+
+
+
+<dt><a name="reduce_cols"></a><strong>reduce_cols</strong>&nbsp;(f, a)</dt>
+<dd>
+reduce the columns using a function.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>f</em></code>: a binary function
+ </li>
+
+ <li>
+ <code><em>a</em></code>: 2d array
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+<ul>1d array</ul>
+
+
+
+<h3>See also:</h3>
+<ul>
+
+ <!-- <li><a href="#../modules/pl.tablex.html#reducepl.tablex.reduce"> -->
+ <li><a href="#pl.tablex.reduce">
+ pl.tablex.reduce</li>
+ </a>
+
+</ul>
+
+</dd>
+
+
+
+
+<dt><a name="reduce_rows"></a><strong>reduce_rows</strong>&nbsp;(f, a)</dt>
+<dd>
+reduce the rows using a function.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>f</em></code>: a binary function
+ </li>
+
+ <li>
+ <code><em>a</em></code>: 2d array
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+<ul>1d array</ul>
+
+
+
+<h3>See also:</h3>
+<ul>
+
+ <!-- <li><a href="#../modules/pl.tablex.html#reducepl.tablex.reduce"> -->
+ <li><a href="#pl.tablex.reduce">
+ pl.tablex.reduce</li>
+ </a>
+
+</ul>
+
+</dd>
+
+
+
+
+<dt><a name="remove_col"></a><strong>remove_col</strong>&nbsp;(t, j)</dt>
+<dd>
+remove a column from an array.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>t</em></code>: a 2d array
+ </li>
+
+ <li>
+ <code><em>j</em></code>: a column index
+ </li>
+
+</ul>
+
+
+
+
+
+
+
+
+</dd>
+
+
+
+
+<dt><a name="remove_row"></a><strong>remove_row</strong>&nbsp;(t, i)</dt>
+<dd>
+remove a row from an array.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>t</em></code>: a 2d array
+ </li>
+
+ <li>
+ <code><em>i</em></code>: a row index
+ </li>
+
+</ul>
+
+
+
+
+
+
+
+
+</dd>
+
+
+
+
+<dt><a name="set"></a><strong>set</strong>&nbsp;(t, value, i1, j1, i2, j2)</dt>
+<dd>
+set a specified range of an array to a value.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>t</em></code>: a 2D array
+ </li>
+
+ <li>
+ <code><em>value</em></code>: the value
+ </li>
+
+ <li>
+ <code><em>i1</em></code>: start row (default 1)
+ </li>
+
+ <li>
+ <code><em>j1</em></code>: end col (default M)
+ </li>
+
+ <li>
+ <code><em>i2</em></code>: end row (default N)
+ </li>
+
+ <li>
+ <code><em>j2</em></code>:
+ </li>
+
+</ul>
+
+
+
+
+
+
+
+
+</dd>
+
+
+
+
+<dt><a name="slice"></a><strong>slice</strong>&nbsp;(t, i1, j1, i2, j2)</dt>
+<dd>
+get a slice of a 2D array. Note that if the specified range has a 1D result, the rank of the result will be 1.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>t</em></code>: a 2D array
+ </li>
+
+ <li>
+ <code><em>i1</em></code>: start row (default 1)
+ </li>
+
+ <li>
+ <code><em>j1</em></code>: end col (default M)
+ </li>
+
+ <li>
+ <code><em>i2</em></code>: end row (default N)
+ </li>
+
+ <li>
+ <code><em>j2</em></code>:
+ </li>
+
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+<ul>an array, 2D in general but 1D in special cases.</ul>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="swap_cols"></a><strong>swap_cols</strong>&nbsp;(t, j1, j2, i1, i2)</dt>
+<dd>
+swap two columns of an array.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>t</em></code>: a 2d array
+ </li>
+
+ <li>
+ <code><em>j1</em></code>:
+ </li>
+
+ <li>
+ <code><em>j2</em></code>:
+ </li>
+
+ <li>
+ <code><em>i1</em></code>: a column index
+ </li>
+
+ <li>
+ <code><em>i2</em></code>: a column index
+ </li>
+
+</ul>
+
+
+
+
+
+
+
+
+</dd>
+
+
+
+
+<dt><a name="swap_rows"></a><strong>swap_rows</strong>&nbsp;(t, i1, i2)</dt>
+<dd>
+swap two rows of an array.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>t</em></code>: a 2d array
+ </li>
+
+ <li>
+ <code><em>i1</em></code>: a row index
+ </li>
+
+ <li>
+ <code><em>i2</em></code>: a row index
+ </li>
+
+</ul>
+
+
+
+
+
+
+
+
+</dd>
+
+
+
+
+<dt><a name="write"></a><strong>write</strong>&nbsp;(t, f, fmt, i1, j1, i2, j2)</dt>
+<dd>
+write a 2D array to a file.
+
+
+<h3>Parameters:</h3>
+<ul>
+
+ <li>
+ <code><em>t</em></code>: a 2D array
+ </li>
+
+ <li>
+ <code><em>f</em></code>: a file object (default stdout)
+ </li>
+
+ <li>
+ <code><em>fmt</em></code>: a format string (default is just to use tostring)
+ </li>
+
+ <li>
+ <code><em>i1</em></code>: start row (default 1)
+ </li>
+
+ <li>
+ <code><em>j1</em></code>: end col (default M)
+ </li>
+
+ <li>
+ <code><em>i2</em></code>: end row (default N)
+ </li>
+
+ <li>
+ <code><em>j2</em></code>:
+ </li>
+
+</ul>
+
+
+
+
+
+
+
+
+</dd>
+
+
+</dl>
+
+
+
+
+
+
+</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>
724 docs/api/modules/pl.class.html
@@ -0,0 +1,724 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+ <title>Reference</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">
+
+
+<h1>LuaDoc</h1>
+<ul>
+
+ <li><a href="../index.html">Index</a></li>
+
+</ul>
+
+
+<!-- Module list -->
+
+<h1>Modules</h1>
+<ul>
+
+ <li>
+ <a href="../modules/pl.app.html">pl.app</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.array2d.html">pl.array2d</a>
+ </li>
+
+ <li><strong>pl.class</strong></li>
+
+ <li>
+ <a href="../modules/pl.classx.html">pl.classx</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.config.html">pl.config</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.data.html">pl.data</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.dir.html">pl.dir</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.file.html">pl.file</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.func.html">pl.func</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.input.html">pl.input</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.lexer.html">pl.lexer</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.list.html">pl.list</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.operator.html">pl.operator</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.path.html">pl.path</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.permute.html">pl.permute</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.pretty.html">pl.pretty</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.seq.html">pl.seq</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.sip.html">pl.sip</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.stringio.html">pl.stringio</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.stringx.html">pl.stringx</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.tablex.html">pl.tablex</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.test.html">pl.test</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.text.html">pl.text</a>
+ </li>
+
+ <li>
+ <a href="../modules/pl.utils.html">pl.utils</a>