lua-users home
lua-l archive

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

On Sun, Feb 19, 2017 at 12:20 AM, Soni L. <> wrote:
local notnil = require "notnil".notnil

local function f(x)
  x = notnil ^ x

assert(pcall(f, 1))
assert(not pcall(f, nil))

Unfortunately, this is not extendable to chained annotations like the following:

local function f(x, y, z)
  notnil ^ x ^ y ^ z
  -- do something

due to right-associativity of "annotation operator"