Mercurial Hosting > luan
changeset 1219:b602badc876b
remove "which"
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 21 Mar 2018 15:36:54 -0600 |
parents | a50803fde972 |
children | 4721c482c86b |
files | src/luan/modules/Which_mod.luan src/luan/modules/which.luan |
diffstat | 2 files changed, 0 insertions(+), 62 deletions(-) [+] |
line wrap: on
line diff
diff -r a50803fde972 -r b602badc876b src/luan/modules/Which_mod.luan --- a/src/luan/modules/Which_mod.luan Tue Mar 20 16:24:59 2018 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -local Luan = require "luan:Luan.luan" -local error = Luan.error -local ipairs = Luan.ipairs or error() -local pairs = Luan.pairs or error() -local type = Luan.type or error() -local String = require "luan:String.luan" -local literal = String.literal or error() -local matches = String.matches or error() -local Io = require "luan:Io.luan" -local print = Io.print or error() - - -local Which_mod = {} - -Which_mod.uris = { - "luan:Luan" - "luan:Binary" - "luan:Html" - "luan:Io" - "luan:Math" - "luan:Package" - "luan:String" - "luan:Table" - "luan:Thread" - "luan:Time" - "luan:host/Hosting" - "luan:http/Http" - "luan:http/Server" - "luan:lucene/Lucene" - "luan:lucene/Versioning" - "luan:mail/Mail" - "luan:logging/Logging" - "luan:stripe/Stripe" -} - -function Which_mod.which(name) - local ptn = "[:./]"..literal(name).."$" - for _, uri in ipairs(Which_mod.uris) do - local mod = require(uri) - if matches(uri,ptn) then - print(uri) - end - if type(mod) == "table" then - for key in pairs(mod) do - if key == name then - print(uri.." "..key) - end - end - end - end -end - -return Which_mod
diff -r a50803fde972 -r b602badc876b src/luan/modules/which.luan --- a/src/luan/modules/which.luan Tue Mar 20 16:24:59 2018 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -local Luan = require "luan:Luan.luan" -local error = Luan.error -local values = Luan.values or error() -local Which_mod = require "luan:Which_mod.luan" -local which = Which_mod.which or error() - -for name in values(...) do - which(name) -end