top | item 37502548

(no title)

sullyj3 | 2 years ago

It's a runtime check. The following fennel:

    (fn add-1 [x] (+ x 1))

    (lambda add-2 [x] (+ x 2))
transpiles to the following lua:

    local function add_1(x)
      return (x + 1)
    end
    local function add_2(x)
      _G.assert((nil ~= x), "Missing argument x on /home/sullyj3/tmp/fn-vs-lambda/fnl/x.fnl:3")
      return (x + 2)
    end
    return add_2

discuss

order