Permalink
Browse files

B

i
Initial Git commit
  • Loading branch information...
0 parents commit 57e4c5deaee8b6b12be0792e4f1fdf40e555683a steve donovan committed Mar 9, 2010
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
@@ -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.
@@ -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.
+
+
@@ -0,0 +1,3 @@
+lua /lua/lua/luadoc_start.lua -p /lang/lua/projects/pl-0.8/lua/pl -nofiles
+
+
@@ -0,0 +1,3 @@
+lua c:/lua/lua/luadoc_start.lua -p d:/dev/lua/projects/penlight-0.8/lua/pl -nofiles
+
+
Oops, something went wrong.

0 comments on commit 57e4c5d

Please sign in to comment.