Giter Site home page Giter Site logo

neo4reo / the-reasoned-schemer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pkrumins/the-reasoned-schemer

0.0 2.0 0.0 101 KB

All the logic programming code examples from the book "The Reasoned Schemer"

Home Page: http://bit.ly/89tulL

Scheme 100.00%

the-reasoned-schemer's Introduction

This repository contains all the code examples from the book "The Reasoned
Schemer." The goal of the book is to show the beauty of relational
programming. The authors of the book believe that it is natural to extend
functional programming to relational programming. They demonstrate this by
extending Scheme with a few new constructs, thereby combining the benefits of
both styles. This extension also captures the essence of Prolog, the most
well-known logic programming language.

If you're interested, get the book from Amazon: http://bit.ly/89tulL

This book assumes that you know the basics of Scheme. The Reasoned Schemer 
can also be viewed as the 3rd book in the Schemer book series. The first two
books are  "The Little Schemer" (http://github.com/pkrumins/the-little-schemer)
and "The Seasoned Schemer" (http://github.com/pkrumins/the-seasoned-schemer).

The code examples were copied (and completed where necessary) from
"The Reasoned Schemer" by Peteris Krumins ([email protected]).

His blog is at http://www.catonmat.net  --  good coders code, great reuse.

------------------------------------------------------------------------------

Table of contents:
    [01] Chapter  1: Playthings
         01-playtings.ss
    [02] Chapter  2: Teaching Old Toys New Tricks
         02-old-toys.ss
    ...
    work in progress, adding new chapters every once in a while


[01]-Chapter-1-Playtings------------------------------------------------------

See 01-playtings.ss file for code examples.

Chapter 1 introduces the basic constructs of relational programming, they are
the goals #s for succeed and #u for fail, the fresh variables, the operators
==, fresh and conde.

The laws of operators fresh, == and conde are postulated:

.----------------------------------------------------------------------------.
|                                                                            |
| The law of fresh:                                                          |
|                                                                            |
| If x is fresh, then (== v x) succeeds and associates x with v.             |
|                                                                            |
'----------------------------------------------------------------------------'

.----------------------------------------------------------------------------.
|                                                                            |
| The law of ==:                                                             |
|                                                                            |
| (== v w) is the same as (== w v).                                          |
|                                                                            |
'----------------------------------------------------------------------------'

.----------------------------------------------------------------------------.
|                                                                            |
| The law of conde:                                                          |
|                                                                            |
| To get more values from conde, pretend that the successful conde line has  |
| failed, refreshing all variables that got an association from that line.   |
|                                                                            |
'----------------------------------------------------------------------------'

After you have read the chapter,

              go make yourself a peanut butter and jam sandwich!


[02]-Chapter-2-Teaching-Old-Toys-New-Tricks-----------------------------------

See 02-old-toys.ss file for code examples.

Chapter 2 teaches the old tricks from The Little Schemer. They are caro, cdro,
conso, nullo, eqo and pairo.


------------------------------------------------------------------------------

That's it. I hope you find these examples useful when reading "The Reasoned
Schemer" yourself! Go get it at http://bit.ly/89tulL, if you haven't already!


Sincerely,
Peteris Krumins
http://www.catonmat.net

the-reasoned-schemer's People

Contributors

pkrumins 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.