lua-users home
lua-l archive

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


You can already do this:

debug.setmetatable(1.0, {__lt = function(num,tbl)
  if type(tbl)=='table' then return tbl[1] < num and num < tbl[2]
  else error("attempt to compare number with "..type(tbl))
end end })

if math.pi-3 < {10/71,10/70} then print "Archimedes was right" end




2017-10-15 0:51 GMT+02:00 Soni L. <fakedme@gmail.com>:
This would be cool:

v = f(x) <- g(y) <- h(z)
v = v() -- v = result of f(x, g(y, h(z)))

(I guess Lua 5.3 can do <<- and stuff but has anyone made a lib for it yet?)

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.