diff --git a/README.md b/README.md index 6558839..7983350 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Tiny Lisp +# Little Lisp A mini Lisp compiler in JavaScript. Supports lists (obvs), function invocation, lambdas, lets, if statements, numbers, strings and the library functions `first`, `rest` and `print`. diff --git a/tinylisp.js b/littlelisp.js similarity index 97% rename from tinylisp.js rename to littlelisp.js index fdaa880..06d9925 100644 --- a/tinylisp.js +++ b/littlelisp.js @@ -128,7 +128,7 @@ return parenthesize(tokenize(input)); }; - exports.tinyLisp = {}; - exports.tinyLisp.parse = parse; - exports.tinyLisp.interpret = interpret; + exports.littleLisp = {}; + exports.littleLisp.parse = parse; + exports.littleLisp.interpret = interpret; })(typeof exports === 'undefined' ? this : exports); diff --git a/tinylisp.spec.js b/littlelisp.spec.js similarity index 97% rename from tinylisp.spec.js rename to littlelisp.spec.js index 1d0f5db..dd7d512 100644 --- a/tinylisp.spec.js +++ b/littlelisp.spec.js @@ -1,4 +1,4 @@ -var t = require('./tinylisp').tinyLisp; +var t = require('./littlelisp').littleLisp; var is = function(input, type) { return Object.prototype.toString.call(input) === '[object ' + type + ']'; @@ -19,7 +19,7 @@ var unannotate = function(input) { } }; -describe('tinyLisp', function() { +describe('littleLisp', function() { describe('parse', function() { it('should lex an atom in a list', function() { expect(unannotate(t.parse("()"))).toEqual([]); @@ -129,7 +129,7 @@ describe('tinyLisp', function() { it('should not expose parallel bindings to each other', function() { // Expecting undefined for y to be consistent with normal - // identifier resolution in tinyLisp. + // identifier resolution in littleLisp. expect(t.interpret(t.parse("(let ((x 1) (y x)) (x y))"))).toEqual([1, undefined]); }); diff --git a/package.json b/package.json index cba5680..7e32bb7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "tinylisp", - "description": "An interpreter for a tiny lisp.", + "name": "littlelisp", + "description": "An interpreter for a little lisp.", "author": "Mary Rose Cook (http://maryrosecook.com/)", "version": "0.1.0", "scripts": { diff --git a/repl.js b/repl.js index 4a09c7c..cdf1395 100644 --- a/repl.js +++ b/repl.js @@ -1,12 +1,12 @@ var repl = require("repl"); -var tinyLisp = require("./tinylisp").tinyLisp; +var littleLisp = require("./littlelisp").littleLisp; repl.start({ prompt: "> ", eval: function(cmd, context, filename, callback) { if (cmd !== "(\n)") { cmd = cmd.slice(1, -2); // rm parens and newline added by repl - var ret = tinyLisp.interpret(tinyLisp.parse(cmd)); + var ret = littleLisp.interpret(littleLisp.parse(cmd)); callback(null, ret); } else { callback(null);