[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lpeg as a part of lua (was: An introduction to Lua)
- From: Sean Conner <sean@...>
- Date: Mon, 23 Oct 2017 03:14:15 -0400
It was thus said that the Great Sean Conner once stated:
>
> function range(low,high)
> return lpeg.Cmt(d^1,function(subject,position,capture)
> local v = tostring(capture)
> if v >= low and v <= high then
> return position,v
> end
> end)
> end
I'm getting tired and shouldn't be programming. This *should* be:
function range(low,high)
return lpeg.Cmt(d^1,function(subject,position,capture)
local v = tonumber(capture)
if v >= low and v <= high then
return position,v
end
end)
end
-spc (Sigh)
- References:
- lpeg as a part of lua (was: An introduction to Lua), szbnwer@<a href="/cgi-bin/echo.cgi?gmail.com">...</a>
- Re: lpeg as a part of lua (was: An introduction to Lua), Sean Conner
- Re: lpeg as a part of lua (was: An introduction to Lua), Jonathan Goble
- Re: lpeg as a part of lua (was: An introduction to Lua), Sean Conner
- Re: lpeg as a part of lua (was: An introduction to Lua), Sean Conner
- Re: lpeg as a part of lua (was: An introduction to Lua), Jonathan Goble
- Re: lpeg as a part of lua (was: An introduction to Lua), Sean Conner
- Re: lpeg as a part of lua (was: An introduction to Lua), Jonathan Goble
- Re: lpeg as a part of lua (was: An introduction to Lua), Sean Conner
- Re: lpeg as a part of lua (was: An introduction to Lua), Sean Conner