[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] markdown.lua 0.10
- From: Niklas Frykholm <niklas@...>
- Date: Thu, 11 May 2006 14:30:43 +0200
-- Joins an array into text separated by separator
function join(arr, sep)
if #arr == 0 then return "" end
local res = arr
for i = 2,#arr do
res = res .. sep .. arr[i]
Why do you use this instead of table.concat? Since strings are
immutable, this code can use a lot of memory, as explained in PiL.
Sloppy reading of the documentation. I somehow missed table.concat. I'll
make a new release tomorrow that fixes this and any other problems that
are found until then.
Overall, markdown.lua is pretty slow as parsers go. It makes a lot of
passes over the source file, substituting different things in each pass.
(markdown.pl works the same way.)