lua-users home
lua-l archive

Re: vararg, table and nil - again

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Jun 28, 2007, at 22:05, Rici Lake wrote:
<Digression>
If this seems like a reversion to Lua 4 and the old 'n'
field, so be it.... you could use a different key if you liked
</Digression>
And all this so I can finally write:
local HTTP = require( 'HTTP' )
HTTP[ '/hello(.*)' ] = function( aName ) return 'hello ' .. ( aName or 'world' ) .. '!' end
HTTP()
% lua TestHTTP.lua
GET /hello HTTP/1.1
HTTP/1.1 200 OK
Connection: keep-alive
Content-Type: text/html
Content-Length: 12
Etag: fc3ff98e8c6a0d3087d515c0473f8677
Content-Md5: fc3ff98e8c6a0d3087d515c0473f8677
Date: 2007年6月28日 20:50:29 GMT
hello world!
Phhhew... :P
http://dev.alt.textdrive.com/browser/HTTP/HTTP.lua#L329

AltStyle によって変換されたページ (->オリジナル) /