lua-users home
lua-l archive

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


Sigh, another example of the arg handling ad hockery...

Indeed; this is one of the several reasons I think it would be good for even the standard Lua libraries to be written using tolua (or a similar tool), and for this practice to be encouraged for everyone. The Lua API could probably be simplified even further if it were only intended for writers of binding tools, and the annoying bugs that tend to crop up (especially with stack handling) would go away.
It would not be contrary to the 4.0 manual to change this behaviour
[...]
Could this be done?

(I know it *can* be done, I was making a request for 4.1!)
[...] is there any way around this?

I was perhaps unclear; I was asking if there was any way to do better searching on Yahoo!! [Note to those who don't like multiple exclamation marks: one of them is part of the word "Yahoo!", which is presumably from Xhosa or a similar language.]
function strfind(a,b,c,d)
  c = c or 1  -- c has a similar problem...
  if d then
    return %strfind(a,b,c,d)
  else
    return %strfind(a,b,c)
  end
end

Although having said that, thanks for the prompt; I'll add the function above to my standard library, along with the wrapper for tinsert we discussed a while ago. Anyway, this is another small thing to clear up for 4.1.
--
http://sc3d.org/rrt/