I am posting it here not the love2d forums because it is a working prototype, I am making it multi-stack based (more than one stack).
What is a stack?
Think of a stack as a set of cards. The value of the stack is the card on top. If you "push" a card, it will go on top of the stack, if you "pop" a card, it will go to the bottom.
How to use:
Set of functions:
getStackValue() - returns the value of the stack.
push(value) - Pushes a value
pop(value) - Pops a value
isError(expression) - This is something I added for my own use, it returns true if a value is nil and vice versa.
Here is an example (lua only):
Code: Select all
require("stackie")
push("hi")
print(getStackValue())
Stack is empty - there was no string pushed. (gets called in getStackValue())
Stack instance does not exist - you were messing about with the main file and you deleted the stack. (gets called in getStackValue())
Download:
It is hosted on Github: https://github.com/rokitboy/stackie
Please give me ideas for this project! Do you think I should continue?