background preloader

Paul Graham

Paul Graham
Related:  Lisp

Setting up Common Lisp on Windows 7 1. Install a Common Lisp implementation, or several of them SBCL for Windows with threads: is slow, and singlethreaded but makes relatively small binariesCCL is reportedly good? 2. Install Emacs. 3. 4. 5. (quicklisp-quickstart:install) (ql:add-to-init-file) 6. (ql:quickload "quicklisp-slime-helper") 7. (add-to-list 'exec-path "C:/sbcl") ;; or wherever you installed SBCL or other Lisp (load (expand-file-name "~/quicklisp/slime-helper.el")) (setq inferior-lisp-program "sbcl") ;; or other Lisp (slime-setup '(slime-fancy slime-asdf)) ;; and possibly other SLIME extensions (add-hook 'slime-mode-hook '(lambda () (set-variable lisp-indent-function 'common-lisp-indent-function) (define-key slime-mode-map [tab] 'slime-indent-and-complete-symbol) (define-key slime-mode-map (kbd "C-<tab>") 'slime-complete-symbol))) Type C-x C-s to save file. 8. cd AppData\Roaming mklink /J quicklisp ..\.. 9. 10. (ql:quickload "cl-ppcre") 11. (:tree "c:/lisp/")

Quicklisp beta Quicklisp is a library manager for Common Lisp. It works with your existing Common Lisp implementation to download, install, and load any of over 1,200 libraries with a few simple commands. Quicklisp is easy to install and works with ABCL, Allegro CL, Clasp, Clozure CL, CLISP, CMUCL, ECL, LispWorks, MKCL, SBCL, and Scieneer CL, on Linux, Mac OS X, and Windows. The libraries were last updated on February 8, 2016. To get started with the Quicklisp beta, download and load PGP signaturesha256 = 4a7a5c2aebe0716417047854267397e24a44d0cce096127411e9ce9ccfeb2c17 Quicklisp is provided as-is without warranty of any kind. To get news and announcements, follow @quicklisp on twitter or read the Quicklisp blog. Installation To install Quicklisp, download quicklisp.lisp and load it. You only need to load once to install Quicklisp. Here's an example installation session on MacOS X with SBCL. Loading After Installation (load "~/quicklisp/setup.lisp") Basic Commands

Contents • Build Your Own Lisp Chapter 1 • Introduction About Who this is for Why learn C How to learn C Why build a Lisp Your own Lisp Chapter 2 • Installation Setup Text Editor Compiler Hello World Compilation Errors Documentation Chapter 3 • Basics Overview Programs Variables Function Declarations Structure Declarations Pointers Strings Conditionals Loops Chapter 4 • An Interactive Prompt Read, Evaluate, Print An Interactive Prompt Compilation Editing input The C Preprocessor Chapter 5 • Languages What is a Programming Language? Chapter 6 • Parsing Polish Notation Regular Expressions Installing mpc Polish Notation Grammar Parsing User Input Chapter 7 • Evaluation Trees Recursion Evaluation Printing Chapter 8 • Error Handling Crashes Lisp Value Enumerations Lisp Value Functions Evaluating Errors Plumbing Chapter 9 • S-Expressions Lists and Lisps Types of List Pointers The Stack & The Heap Parsing Expressions Expression Structure Constructors & Destructors Reading Expressions Printing Expressions Evaluating Expressions Credits

Why monads have not taken the Common Lisp world by storm Topics: monads, Common Lisp, functional programming Author: Marijn Haverbeke Date: July 11th 2008 Today I was trying write a parser for a reasonably complicated language. Since I do not tend to learn from other people's work or even from my own past mistakes, and tend to greatly underestimate the complexity of tasks (or overestimate my own skills) this went something like this: Try to quickly write the whole thing as a single recursive descent parser. Note the exploding amount of ugliness. So, as it stands, I have wasted a few hours, and am still without an acceptable parser. You are bound to have heard of monads. Given how wonderful monads are, why aren't other language suffering from major monad envy? Support ML-style function-fu (trivial currying, single namespace). I'll go into these in a moment. So what would monads look like in CL. (defgeneric >>= (m f)) (defgeneric >> (m1 m2) (:method (m1 m2) (>>= m1 (lambda (x) (declare (ignore x)) m2)))) Awesome!

Lisp as the Maxwell’s equations of software | DDI On my first day of physics graduate school, the professor in my class on electromagnetism began by stepping to the board, and wordlessly writing four equations: He stepped back, turned around, and said something like [1]: “These are Maxwell’s equations. Just four compact equations. With a little work it’s easy to understand the basic elements of the equations – what all the symbols mean, how we can compute all the relevant quantities, and so on. Alan Kay has famously described Lisp as the “Maxwell’s equations of software”. Here’s the half page of code that Kay saw in that manual: What we’re going to do in this essay is understand what that half page of code means, and what it means that Lisp is the Maxwell’s equations of software. That perhaps sounds over-ambitious, but the good news is that it’s easy to learn the basic elements of Lisp. But I won’t stop with just showing you how to write some Lisp. Some elements of Lisp tiddlylisp> tiddlylisp> (+ 2 3) 5 tiddlylisp> (* 3 4) 12 As for atom?

Implementing Lisp I'm interested in a sketch of the accumulated wisdom about ImplementingLisp. Here are some specific questions I've wondered about: How is lambda implemented? What's at the very lowest level, where the code meets the metal/OS. I've heard rumors of a ByteCode set for Lisp. Does anyone know of one, and how it was implemented? Here is an attempt at describing a basic blueprint for a Lisp interpreter. Lookup Find the value of a symbol in an environment. Extension Create a new environment given an old environment, some symbols, and their new values. Input/Output: read RecursiveDescentParser for reading in EssExpressions. print Simple recursive procedure to print out EssExpressions. Evaluator (EvalApply): eval Evaluate a form. apply Unwraps user defined procedures, adjusting environment appropriately and delegates evaluation of body to begin. evlis Takes a list of forms. begin Takes a list of forms. Interface: ReadEvalPrintLoop Some books that may be of interest: LISP 1.5 Programmer's Manual AnatomyOfLisp?

LISP and Common LISP Programming LISP and Common LISP Programming Related Book Categories: Practical Common Lisp (Peter Seibel) This book presents a thorough introduction to Common Lisp, providing you with an overall understanding of the language features and how they work. clcon - emerging Common Lisp IDE Hi! I have started a new attempt on Common Lisp IDE, it is named clcon. See screenshots at Goal is a cross-platform Common Lisp IDE with more "modern" look and feel, under permissive license. It is intended first of all for beginners. IDE is built as a client/server application. On server side, SWANK server on SBCL is responsible for most of the work. Client (IDE itself) is in plain tcl/tk (not generated from Lisp). Client-server dialog organisation did not take its final shape yet. I use bits of cl-tk to communicate from client to server. Features currently demonstrated: - SWANK-based REPL with command history - completion - go to definition - inspector (like slime-inspect) - concept of IDE command. Compilation messages highlighting and hyperlinking is now under development. All this was done in less than two weeks. Current state of code is "development". You are welcome to participate.

Related: