[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: [ANN] Penlight 0.7 Beta
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 12 May 2009 16:24:33 +0200
Hi guys,
http://penlight.luaforge.net/
Now points to the Guide directly; the module docs are at:
http://penlight.luaforge.net/api
http://luaforge.net/frs/download.php/4063/pl.0.7.0b.zip
The LuaDoc API docs are now much improved.
There are a number of new things. Sequence wrappers have been added as
recently discussed:
http://lua-users.org/wiki/SequenceAdapters
Can now write things like this one liner:
seq(s):last():filter('<'):copy()
seq:enum(s) If s is a simple sequence, then
for i,v in seq.enum(s) do print(i,v) end
(so enum(copy(ls)) is like ipairs ;))
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.
There are a number of significant 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 (solution provided by Flemming Madsden)
dir.copyfile() returns the wrong result for *nix operations.
dir.makepath() was broken for non-Windows paths.
So, a consolidation release, hopefully more solid!
BTW, I have made peace with LuaForge. This little script was most useful:
local L = require 'lexpect'
L.open 'ftp'
L.writeln 'open penlight.luaforge.net'
L.expect(': $',true)
L.writeln 'stevedonovan'
L.expect(':%s*$',true)
L.writeln 'xxxxxxx'
L.prompt = 'ftp>'
print(L.read_response_string())
L.command 'cd penlight/htdocs'
function docmd(cmd)
print(L.command_string(cmd))
end
docmd 'prompt off'
docmd 'put index.html'
docmd 'put examples.html'
docmd 'lcd api'
docmd 'cd api'
docmd 'put index.html'
docmd 'put luadoc.css'
docmd 'lcd modules'
docmd 'mkdir modules'
docmd 'cd modules'
docmd 'mput *.html'
L.command 'quit'
steve d.
PS. I will now get back to my job for a while...