|
From: | Reuben Thomas |
Subject: | Re: [Bug-zile] Incremental search is dog slow in moderately-sized files |
Date: | Sun, 19 Jan 2014 08:49:08 +0000 |
Hi Reuben,
As in the failure happens when Lua reads alien.default.doesnotexist, presumably while asking alien to resolve the contents of the default table, but before executing user code. Try this:
On Jan 19, 2014, at 1:21 PM, Reuben Thomas <address@hidden> wrote:
> On 18 January 2014 23:20, Gary V. Vaughan <address@hidden> wrote:
>> And since the error is thrown while evaluating `alien.default.memrchr` during parsing, if blows up even when wrapped in pcall (or even `if false then ... end` for that matter).
>>
> Not sure what you mean by "during parsing":
if false then print (tostring (alien.default.doesnotexist)) end
I'd argue getting nil would be more useful than the current behaviour.
local function memrchr (buf, ch, o)where buf is an alien.array wrapping an alien.buffer, per Zile AStr implementation.
local c = string.byte (ch)
for i = o, 1, -1 do
if buf[i] == c then return i end
end
end
> But `memrchr` is a GNU extension, so that's a can of worms...Not insisting, but I'd rather avoid opening the floodgates of adding gnu extensions to luaposix.
>
> OK, libgnu if you insist. I think building a separate libposix is a bit pointless.
I still strongly advocate libposix as a shim between applications that stick to posix apis and libc - avoiding adding thousands of lines of configury and gnulib sources to every project.
[Prev in Thread] | Current Thread | [Next in Thread] |