Squirrel is an expression-oriented programming language inspired by Lisp.
Check out the language reference to learn how it works.
[ program that defines a function,
invokes it, and displays the result ]
(block
(def {factorial}
(lambda {x}
{if (eq x 0)
{id 1}
{mul x (factorial (sub x 1))}
}
)
)
(display (factorial 5)) [ prints 120 ]
)
Install .NET Core 1.1 or later in order to build and run the project.
cd src/app/
dotnet restore
# run an interactive Squirrel console
dotnet run
# run a Squirrel source file
dotnet run <path>
# run one of the included modules: Conway's Game of Life
dotnet run ../../modules/game-of-life.sq
cd test/test-library/
dotnet restore
dotnet test