Content deleted Content added
No edit summary |
No edit summary |
||
(11 intermediate revisions by 2 users not shown) | |||
Line 4:
this.calendars = {};
function this
moduleName = require(moduleName); --debug only: not lazily
for index in ... do▼
this.calendars[arg[i]] = moduleName; -- indexed by code, module loaded lazily
end;
end;
this
this
-- more calendars may be added later in new modules pluggable here into this factory...
function this
if index == nil then
index = 0; -- use the default calendar (Gregorian as set above)
end;
local calendar = this.calendars[index];
if calendar == nil then
return index; -- fast path: assume that index is a calendar object (not indexed) already loaded
end;
if type(calendar) == "string" then -- calendar is a string (i.e. a module name)
local moduleName = calendar;
Line 37 ⟶ 39:
end;
end; -- else assume calendar is a valid calendar object
return calendar;
end;
-- main functions
function this
calendar = this
if calendar == nil then
return tostring(Error.error{"Calendar ''" .. calendar .. "'' is either missing or unknown!"});
end;
return
end;
function this
calendar = this
if calendar == nil then
return tostring(Error.error{"Calendar ''" .. calendar .. "'' is either missing or unknown!"});
end;
return calendar
end;
function this
calendar = this
if calendar == nil then
return tostring(Error.error{"Calendar ''" .. calendar .. "'' is either missing or unknown!"});
end;
return calendar
end;
function this
calendar = this
if calendar == nil then
return tostring(Error.error{"Calendar ''" .. calendar .. "'' is either missing or unknown!"});
end;
return calendar
end;
function this
calendar = this
if calendar == nil then
return tostring(Error.error{"Calendar ''" .. calendar .. "'' is either missing or unknown!"});
end;
return calendar
end;
function this
calendar = this
if calendar == nil then
return tostring(Error.error{"Calendar ''" .. calendar .. "'' is either missing or unknown!"});
end;
return calendar
end;
function this
calendar = this
if calendar == nil then
return tostring(Error.error{"Calendar ''" .. calendar .. "'' is either missing or unknown!"});
end;
return calendar
end;
function this
calendar = this
if calendar == nil then
return tostring(Error.error{"Calendar ''" .. calendar .. "'' is either missing or unknown!"});
end;
return calendar
end;
function this
calendar = this
if calendar == nil then
return tostring(Error.error{"Calendar ''" .. calendar .. "'' is either missing or unknown!"});
end;
return calendar
end;
|