This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################ Lispy: Scheme Interpreter in Python | |
## (c) Peter Norvig, 2010; See http://norvig.com/lispy.html | |
################ Symbol, Env classes | |
from __future__ import division | |
Symbol = str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################ Scheme Interpreter in Python | |
## (c) Peter Norvig, 2010; See http://norvig.com/lispy2.html | |
################ Symbol, Procedure, classes | |
from __future__ import division | |
import re, sys, StringIO | |
class Symbol(str): pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;source: http://ideone.com/lEx0T | |
;explanation: http://stackoverflow.com/a/3685147 | |
(defun null. (x) | |
(eq x '())) | |
(defun and. (x y) | |
(cond (x (cond (y 't) ('t '()))) | |
('t '()))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;source: http://norvig.com/paip/interp1.lisp | |
;;; -*- Mode: Lisp; Syntax: Common-Lisp; -*- | |
;;; Code from Paradigms of Artificial Intelligence Programming | |
;;; Copyright (c) 1991 Peter Norvig | |
;;; File interp1.lisp: simple Scheme interpreter, including macro.sgi | |
(defun interp (x &optional env) | |
"Interpret (evaluate) the expression x in the environment env." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;source: http://norvig.com/paip/interp2.lisp | |
;;; -*- Mode: Lisp; Syntax: Common-Lisp; -*- | |
;;; Code from Paradigms of Artificial Intelligence Programming | |
;;; Copyright (c) 1991 Peter Norvig | |
;;; File interp2.lisp: Tail-recursive Scheme interpreter. | |
(requires "interp1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;source: http://norvig.com/paip/interp3.lisp | |
;;; -*- Mode: Lisp; Syntax: Common-Lisp; -*- | |
;;; Code from Paradigms of Artificial Intelligence Programming | |
;;; Copyright (c) 1991 Peter Norvig | |
;;; File interp3.lisp: Scheme interpreter with explicit continuations | |
;;; One bug fix by Cheng Lu Hsu, hsuc@cory.Berkeley.EDU |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang r5rs | |
(define-syntax var | |
(syntax-rules () | |
((_ x) (vector x)))) | |
(define-syntax var? | |
(syntax-rules () | |
((_ x) (vector? x)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://blip.tv/file/get/Richhickey-ClojureDataStructuresPart1411.flv | |
http://blip.tv/file/get/Richhickey-ClojureDataStructuresPart2306.flv | |
http://blip.tv/file/get/Richhickey-ClojureSequences733.flv | |
http://blip.tv/file/get/Richhickey-ClojureConcurrency252.flv | |
http://blip.tv/file/get/Richhickey-ClojureForJavaProgrammers2Of2680.mov | |
http://blip.tv/file/get/Richhickey-ClojureForJavaProgrammers1Of2174.flv | |
http://blip.tv/file/get/Richhickey-ClojureForLispProgrammersPart2299.mov | |
http://blip.tv/file/get/Richhickey-ClojureForLispProgrammersPart1372.flv | |
http://blip.tv/file/get/Richhickey-HammockdrivenDevelopment465.mov | |
http://blip.tv/file/get/Richhickey-MichaelFogusFertileGroundTheRootsOfClojure492.mov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intro | |
|E|-----------------------|-----------------------| | |
|B|-----------------------|-----------------------| | |
|G|-2-----2-----2-----2---|-----------------------| x2 | |
|D|-----------------------|-3-----3-----2-----2---| | |
|A|-0-----0-----0-----0---|-----------------------| | |
|E|-----------------------|-1-----1-----0-----0---| | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A simple implementation of a greedy transition-based parser. Released under BSD license.""" | |
from os import path | |
import os | |
import sys | |
from collections import defaultdict | |
import random | |
import time | |
import pickle | |
SHIFT = 0; RIGHT = 1; LEFT = 2; |