local function reportIssue(actor, …)
local numArgs = select('#', …)
local category
– figure out the category:
if numArgs >= 1 then
category = string.lower(select(1, …) or "")
– make sure it's a known category
if not _M.isCategory(category) then
actor:sendText("Unknown category: '" .. category .. "'.\n")
category = _M.promptForCategory(actor)
– on cancel, abort the command
if not category then
actor:sendText("Canceled.\n")
return cmds.OK
end
end
else
category = _M.promptForCategory(actor)
– on cancel, abort the command
if not category then
actor:sendText("Canceled.\n")
return cmds.OK
end
end
actor:sendText("Enter a subject line: ")
local subject = commands.waitForInput()
actor:sendText("Describe the issue in more detail.\n")
local text = commands.waitForEditorBuffer()
– on cancel, abort the command
if not text then
actor:sendText("Canceled.\n")
return cmds.OK
end
createIssue(actor, category, subject, text)
return cmds.OK
end
An awful lot of stuff, really, is possible with a language as "dumb" as mudprog – certainly not something I'd call a decent scripting language. Perhaps not even writing "actual" code – by any of the definitions given here so far.
At this point I'm not sure we're making useful progress though because there's nothing concrete to compare. It's rather tautological that being able to add stuff on the fly lets you do more than if you can only choose from a list of things. Of course, if you can choose from a list of things using well-known combination and conditional operators, but still without actually writing code, perhaps you can do a whole bunch of stuff again.
I think it's clear at this point that it's nice to be able to add dynamic behavior, but it's still unclear to me that you need a full-fledged language to do so.