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
Lisp interpreter in 90 lines of C++ | |
I've enjoyed reading Peter Norvig's recent articles on Lisp. He implements a Scheme interpreter in 90 lines of Python in the first, and develops it further in the second. | |
Just for fun I wondered if I could write one in C++. My goals would be | |
1. A Lisp interpreter that would complete Peter's Lis.py test cases correctly... | |
2. ...in no more than 90 lines of C++. | |
Although I've been thinking about this for a few weeks, as I write this I have not written a line of the code. I'm pretty sure I will achieve 1, and 2 will be... a piece of cake! |
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
# More than inspired by JB Steadman - http://pivotallabs.com/users/jb/blog/articles/1152-javascripttests-bind-reality- | |
# | |
# Adds a save_fixture method to Rspec 2's ViewExampleGroups which takes the | |
# rendered and stores it in a js_dom fixture file to be used with jasmine. | |
# | |
# Simply drop this into spec/support. | |
# | |
# Then, at the end of a view spec that you want to save as a fixture, simply call | |
# save_fixture('name_of_fixture_file') | |
# |
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
;; Linked list implementation | |
;; I compile it like this on Mac OS X: | |
; | |
; llvm-as linked-list.ll | |
; llc linked-list.bc | |
; as linked-list.s -o linked-list.o | |
; ld /usr/lib/crt1.o linked-list.o -o linked-list -lSystem -macosx_version_min 10.6 | |
;; Type aliases | |
%free_func = type void (i8*)* |