On 27 Oct 2006, at 4:22 PM, Jim Correia wrote:
I don't know Lua, by my recollection from the last time this came up
was that it wasn't well suited to the pre 8.5 style of CLM function
parsing since functions don't have a delimited block structure
(begin/end).
Well, they do (function/end), but 'end' also gets paired with 'do',
'if..then', and 'if..then..else':
function Message:validate(params)
local retval = {}
for key, item in pairs(self.arg_specs) do
retval[key] = params[key] or item[1] -- The argument,
or its default
if not item[2](retval[key]) then -- Is it
invalid?
error("invalid argument <" .. retval[key] .. "> for '" .. key ..
"'.", 2)
end
end
-- Return the validated argument list.
return retval
end
... which I suspect (without much thought) makes for a gnarly regular
expression.
Oh, also there are anonymous functions that can get assigned to
variables or used as parameters:
table.sort(an_array,
function (a, b) return a.name < b.name end)
Unless someone can persuade me this is regexible, it looks like it
will have to fall back to a coded module.
— F
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <[EMAIL PROTECTED]>