diff --git a/bc.lua b/bc.lua index f6037877a8bc..329426ec3606 100644 --- a/bc.lua +++ b/bc.lua @@ -157,7 +157,21 @@ function BaseControl:get(noun, timeout) end function BaseControl:set(name, value) - error("set unimplemented") + if self.locals.nouns[name] ~= nil then + if type(value) == "function" then + error("\""..name.."\" can't be cast into a verb") + else + self.locals.nouns[name] = value + end + elseif self.locals.verbs[name] ~= nil then + if type(value) ~= "function" then + error("\""..name.."\" can't be cast into a noun") + else + self.locals.verbs[name] = value + end + else + error("\""..name.."\" is not a local") + end end -- }}} @@ -176,7 +190,11 @@ function BaseControl:verbs(local_only) end function BaseControl:call(verb, ...) - error("call unimplemented") + if self.locals.verbs[verb] ~= nil then + self.locals.verbs[verb](...) + else + error("unknown verb") + end end -- }}} -- }}}