Skip to content
This repository was archived by the owner on May 21, 2020. It is now read-only.

Latest commit

 

History

History
56 lines (44 loc) · 1.05 KB

README.md

File metadata and controls

56 lines (44 loc) · 1.05 KB

Squirrel

Squirrel is an expression-oriented programming language inspired by Lisp.

Check out the language reference to learn how it works.

Sample

[ 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 ]
)

Prerequisites

Install .NET Core 1.1 or later in order to build and run the project.

Running

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

Testing

cd test/test-library/
dotnet restore
dotnet test

Resources