Git Product home page Git Product logo

lips's Introduction

Lisp Is Pretty Sweet

LIPS is a Lisp dialect striving for elegant simplicity and performance.

Installation

The core is implemented in strict C99 which should make it easy to compile with most compilers. Besides a C compiler and make, LIPS requires libao and readline.

On Debian-derieved these are easily:

apt-get install build-essential libreadline-dev libao-dev

The latest version of LIPS is available from the repository

git clone https://github.com/martinolsen/lips

Compile and test the code:

make clean all run-test

There, this is pretty much all it does right now.

Language

Data types

Integers

Integers are simple numbers

42
=> 42

Strings

Strings are denoted by enclosing double-quotes

"Hello world!"
=> "Hello world!"

Cons

Symbols

Functions

CONS

CAR

CDR

ATOM

COND

EQ

ASSOC

PAIR

LABEL

LAMBDA

MACRO

Macros are expanded by the reader, just before evaluation.

ERROR

To indicate an error, simply call ERROR with an identifying symbol:

(ERROR 'MY-ERROR)

To handle errors, define a lambda as *ERROR-HANDLER*:

(LABEL *ERROR-HANDLER*
  (LAMBDA (C) (PRINT "Error!")))

The identifying symbol is passed to the error handler:

(LABEL *ERROR-HANDLER*
  (LAMBDA (C)
    (COND ((EQ C 'MY-ERROR) (PRINT "My bad!")))))

If the error handler returns NIL, the error is treated as not handled.

The UNBOUND-SYMBOL error accurs when a symbol is not bound to a value (defined).

lips's People

Contributors

martinolsen avatar

Stargazers

 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.