Mercurial Hosting > luan
diff src/luan/modules/Which_mod.luan @ 1088:bae2d0c2576c
change module naming convention
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 26 Dec 2016 22:29:36 -0700 |
parents | 1a68fc55a80c |
children |
line wrap: on
line diff
--- a/src/luan/modules/Which_mod.luan Mon Dec 19 01:38:21 2016 -0700 +++ b/src/luan/modules/Which_mod.luan Mon Dec 26 22:29:36 2016 -0700 @@ -10,9 +10,9 @@ local print = Io.print or error() -local M = {} +local Which_mod = {} -M.uris = { +Which_mod.uris = { "luan:Luan" "luan:Binary" "luan:Html" @@ -33,9 +33,9 @@ "luan:stripe/Stripe" } -function M.which(name) +function Which_mod.which(name) local ptn = "[:./]"..literal(name).."$" - for _, uri in ipairs(M.uris) do + for _, uri in ipairs(Which_mod.uris) do local mod = require(uri) if matches(uri,ptn) then print(uri) @@ -50,4 +50,4 @@ end end -return M +return Which_mod