Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

Commit ae89024

Browse files
committed
Merge branch 'repository' (metamachine stuff) and thus release R4
2 parents c3b6cdc + 154d967 commit ae89024

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

repository/apps/app-metamachine.lua

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ vmComponent = {
124124
return tk
125125
end,
126126
invoke = function (com, me, ...)
127-
if not components[com] then error("no component " .. com) end
128-
if not components[com][me] then error("no method " .. com .. "." .. me) end
127+
if not components[com] then error("no such component") end
128+
if not components[com][me] then error("no such method") end
129129
return components[com][me](...)
130130
end,
131131
proxy = function (com)
@@ -148,8 +148,11 @@ vmComponent = {
148148
return components[com].type
149149
end,
150150
methods = function (com)
151+
if not components[com] then
152+
return nil, "no such component"
153+
end
151154
local mt = {}
152-
for k, v in pairs(components[address]) do
155+
for k, v in pairs(components[com]) do
153156
if type(v) == "function" then
154157
mt[k] = true
155158
end
@@ -164,10 +167,10 @@ vmComponent = {
164167
end,
165168
doc = function (address, method)
166169
if not components[address] then
167-
error("No such component " .. address)
170+
error("no such component")
168171
end
169172
if not components[address][method] then
170-
error("No such method " .. method)
173+
return
171174
end
172175
return tostring(components[address][method])
173176
end
@@ -381,6 +384,7 @@ vmEnvironment = {
381384
-- This is not exactly the same, but is very similar, to that of machine.lua,
382385
-- differing mainly in how pullSignal timeout scheduling occurs.
383386
coroutine = {
387+
-- NOTE: I can't give you a definitive list from OC because OC (or OpenOS?) screws up a metatable!
384388
yield = function (...)
385389
return coroutine.yield(nil, ...)
386390
end,

repository/data/app-claw/local.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ return {
108108
},
109109
["app-metamachine"] = {
110110
desc = "Virtual machine",
111-
v = 1,
111+
v = 2,
112112
deps = {
113113
"neo",
114114
"zzz-license-pd"

0 commit comments

Comments
 (0)