Lua implementation of a switch statement
Switch branches/tags
Nothing to show
Clone or download
Latest commit 313b15e Jan 23, 2018
Permalink
Failed to load latest commit information.
rockspecs Fixed git-0 rockspec Apr 8, 2017
spec initial commit Apr 8, 2017
src Update switch.lua Jan 23, 2018
.gitignore initial commit Apr 8, 2017
LICENSE Initial commit Apr 8, 2017
README.md Added actual readme content Apr 8, 2017

README.md

switch.lua

Lua implementation of a switch statement. Supports an optional default case.

Example

local switch = require 'switch'

switch('lua', {
  goodbye = function(value)
    ...
  end,
  hello = function(value)
    ...
  end,
  [switch.default] = function(value)
    ...
  end
})