Skip to content

gpapadok/cl-scheme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

122 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scheme in Common Lisp

                λλλλλλλλλλλλλλ
           λλλλλλ             λλλλλ
        λλλλ                      λλλλ
      λλλ                           λλλλ
    λλλλ                              λλλ
   λλλ                      λλλλλλλλλλ  λλλ
  λλλ                     λλλ        λλλλλλλ
 λλλ                    λλλ             λλλλλ
 λλ                    λλλ                λλλ
 λλ                   λλ                   λλ
λλλ      Eval         λλ      Apply        λλ
 λλ                  λλλ                   λλ
 λλλ                λλλ                    λλ
 λλλλ               λλ                    λλ
  λλλλλ          λλλ                     λλλ
   λλλ λλλλλλλλλλλ                      λλλ
    λλλ                               λλλλ
      λλλ                            λλλ
        λλλ                       λλλλ
          λλλλλλ             λλλλλλ
               λλλλλλλλλλλλλλλ

A Scheme written in Common Lisp to take advantage of the built-in tools Lisp offers to read and evaluate structured expressions. This implementation is a subset of r5rs.pdf. Tested and developed only with SBCL (Steel Bank Common Lisp).

A few words about scheme

Scheme is a very simple language, stripped down to the bear essentials. The most popular implementation is Racket and it is used primarily for research. Its primary goal is to teach how a very simple toolset and a lot of freedom can derive all the major programming paradigms. Developed for educational purposes while reading SICP.

From the Scheme standard:

Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additional features appear necessary. Scheme demonstrates that a very small number of rules for forming expressions, with no restrictions on how they are composed, suffice to form a practical and efficient programming language that is flexible enough to support most of the major programming paradigms in use today.

Usage

Build with:

make build

And run:

./scheme

Examples

Basic
> (+ 4 5)
9
> (cons 1 (list 2 3 4))
(1 2 3 4)
Recursion
> (define (fac n) (if (= n 1) 1 (* n (fac (- n 1)))))
FAC
> (fac 10)
3628800
Higher order functions
> (define (inc x) (+ x 1))
INC
> (reduce + 0 (filter even? (map inc '(0 1 2 3 4 5))))
12

About

Scheme implementation in Common Lisp.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors