monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] Re: Feature Request: enhanced .mtn-ignore


From: Alex Queiroz
Subject: Re: [Monotone-devel] Re: Feature Request: enhanced .mtn-ignore
Date: Sun, 6 Aug 2006 19:07:23 -0300

Hallo,

On 8/5/06, Steven E. Harris <address@hidden> wrote:
Chad Walstrom <address@hidden> writes:

> function ignore_file(name)
>       if (string.find(name, "%.pyc$")) then return true end
>       if (string.find(name, "%.pyo$")) then return true end

Wow, that is really crying out for a macro, or a declarative
specification. It's just a giant short-circuiting OR form.¹


    Something like this could be cleaner:

local ignore_patterns = {
  "%.pyc$", "%.pyo$", etc.
}

for _, pat in ipairs(ignore_patterns) do
    if string.find(name, pat) then return true end
end

--
-alex
http://www.ventonegro.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]