Giter VIP home page Giter VIP logo

li's Introduction

li

li evaulates Scheme (Lisp) expressions.

Installation

go get github.com/kvu787/li

Usage

li [-h | -i]

If no flags are specified, expressions are read from standard input and evaluated. The value of the final expression is printed to standard output.

The -i flag launches an interactive read-evaluate-print-loop (REPL) interpreter. Expressions are read from standard input. The result of each expression is printed to standard output until EOF is encountered or an error occurs.

Examples

Running Scheme programs

The examples directory contains several Scheme programs that li can evaulate. You can evaluate a term of the Fibonacci sequence by piping fib.scm into li:

li < examples/fib.scm
233

Running the REPL

li runs in interactive mode when given the -i option. Below is the transcript of a sample session that evaluates Fibonacci terms:

$ li -i
(define fib (lambda (n)
  (cond ((= n 0) 0)
        ((= n 1) 1)
        (else (+ (fib (- n 1)) (fib (- n 2)))))))
>>> <nil>
(fib 0)
>>> 0
(fib 2)
>>> 1
(fib 10)
>>> 55
(fib 6)
>>> 8

li's People

Contributors

kvu787 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.