AltoLang / Alto

Compiler in the works!
MIT License
3 stars 1 forks source link

Allow for nested functions #66

Closed FilipToth closed 3 years ago

FilipToth commented 3 years ago

Syntax

{
    function evaluateProposal(👎count  : int, 👍count  : int, name : string = "test") : bool {
        if (👍count > 👎count)
        {
            print("Proposal " + name + " passed by a " + tostring(👍count) + " to " + tostring(👎count) + " margin")
            return true
        }
        print("Proposal " + name + " did not pass!")
        return false
    }

    evaluateProposal(2, 3, "Add support for nested functions?")
}

PS: Yes, this isn't the cleanest implementation, but hey, I'm 🥱...

Closes #60