Message from @Jab
Discord ID: 401851713268613120
Micro$oft
```lua
----------------------------------------------------------------
-- @string body The body of the function.
-- @table args The arguments to put in the function header.
-- @return Returns a function from a body string and provided arguments.
----------------------------------------------------------------
function load_function(body, args)
local function_context = {};
setmetatable(function_context, { __index = _G });
local compiled = "return function(";
local compiled_args = "";
if args ~= nil and type(args) == "table" then
for k,v in pairs(args) do
if compiled_args == "" then
compiled_args = v;
else
compiled_args = compiled_args..","..v;
end
end
end
compiled = compiled..compiled_args..") "..body.." end";
-- Debug print function.
if debugLoadFunction then print("compiled: "..compiled); end
local f, err = loadstring(compiled, body);
if f then
setfenv(f, function_context);
return f();
else
return f, err;
end
end
```
```lua
----------------------------------------------------------------
-- @return Returns a string with the first character upper-cased.
----------------------------------------------------------------
function firstToUpper(str)
str = string.lower(str);
return (str:gsub("^%l", string.upper))
end
```
```Prolog
foo(X,Y,Z) :-
(Y=0;Y<0),%stopping condition
Z is X, !.
foo(X,Y,Z) :-
(X<0;X=0),%stopping condition
Z is Y, !.
foo(X,Y,Z) :-%size n problem
(X=Y;X>Y),
K is X-3,
foo(K,Y,S),%size m problem
Z is S + X.%constructs size n solution from size m problem
foo(X,Y,Z) :-%size n problem
X<Y,
I is Y-2,
foo(X,I,L),%size m problem
Z is Y + L.%constructs size n solution from size m problem
```
```lua
object:function();
object.function();
```
object:CamelCase
object.camelCase
```
(define pairs ( lambda ( x y)
(if (null? x)
'()
(cons
(cons(car x) (car y))
(pairs (cdr x) (cdr y))))))
```
local s = require("serpent")
print(s.block(tbl))
an important or wealthy man regarded as lacking substance, personality, or ability.