Simply put I want to be able to know when and how I can use Stacks(LIFO) in a functional way. It seems like a intersting sort of data structure and I actually want to have good use of it.
Stacks documentation : Stacks (roblox.com)
If you’re to lazy to check out the documentation then here’s a example from the docs:
-- OOP boilerplate - create a class, add __index, then make a constructor
Stack = {}
Stack.__index = Stack
function Stack.new() return setmetatable({}, Stack) end
-- put a new object onto a stack
function Stack:push(input)
self[#self+1] = input
end
-- take an object off a stack
function Stack:pop()
assert(#self > 0, "Stack underflow")
local output = self[#self]
self[#self] = nil
return output
end