Pluto
1 program
Added 2026-02-27T06:34:33Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled
Evidence
Report issue
View issues
Aliases: PlutoLang
Provenance: commit 5987c04a9e · authored 2026-02-27T07:34:54+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
1 source · not in taxonomy (canonical name didn't match any upstream)
Related languages
LLM-contributed programs
Built-in Operators Implementation
Provenance: commit 5987c04a9e · authored 2026-02-27T07:34:54+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
-- lparser.cpp's builtinoperators
local Pluto_operator_new <const> = function(mt, ...)
if not mt then
error("attempt to construct a nil value")
end
if mt.new then
return mt.new(...)
end
local t = {}
setmetatable(t, mt)
if not rawget(mt, "__index") then
mt.__index = mt
end
if mt.__construct then
mt.__construct(t, ...)
end
return t
end
local Pluto_operator_extends <const> = function(c, p)
if (p_type := type(p)) != "table" then
error("expected a class or class-like table to extend, got " .. p_type)
end
for {
-- luaT_eventname
"__index", "__mindex", "__newindex",
"__gc", "__mode", "__len", "__eq",
"__add", "__sub", "__mul", "__mod", "__pow",
"__div", "__idiv",
"__band", "__bor", "__bxor", "__shl", "__shr",
"__unm", "__bnot", "__lt", "__le",
"__concat", "__call", "__close",
-- misc
"__tostring", "__pairs"
} as mm do
if p[mm] and not c[mm] then
c[mm] = p[mm]
end
end
setmetatable(c, { __index = p })
c.__parent = p
end
local Pluto_operator_instanceof <const> = function(t, mt)
t = getmetatable(t)
while t do
if t == mt then
return true
end
t = t.__parent
end
return false
end
local Pluto_operator_spaceship <const> = function(a, b)
return a ~= b ? a < b ? -1 : +1 : 0
end
local Pluto_operator_ipow <const> = function(x, p)
local res = 1
while p > 0 do
if p & 1 ~= 0 then
res *= x
end
p >>= 1
x *= x
end
return res
end