Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

reveal #type and reformat

  • Loading branch information...
commit e0f58d15b6c7c496c9a3d1a217e431ece4f16ef7 1 parent 77f4e11
@jondistad authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 javascripts/repl.js
View
14 javascripts/repl.js
@@ -37,6 +37,7 @@ function Fn(form, fn) {
this.fn = fn;
this.evalArgs = true;
this.type = "Fn";
+ this.bindings = {};
}
(function($) {
@@ -49,11 +50,14 @@ function Fn(form, fn) {
_b = Bindings;
function init() {
- var builtins = ["car", "cdr", "cons", {"quote":{evalArgs: false}}, {"eval":{fn:evalForm}}];
+ var builtins = ["car", "cdr", "cons", "type",
+ {"quote": {evalArgs: false}},
+ {"eval": {fn: evalForm}},
+ {"fn": {evalArgs: false, fn: makeFn}}];
$.each(builtins, function(i, sym) {
var ext = {}, name = sym;
if (typeof(sym) == "object") {
- for (s in sym) name = s;
+ for (name in sym);
ext = sym[name];
}
var newSym = new Symbol(name);
@@ -82,6 +86,10 @@ function Fn(form, fn) {
return form.type || typeof(form);
}
+ function makeFn(form) {
+
+ }
+
REPL.readerFn = function(input) {
try {
var inputStream = new StringStream(REPL.inputBuffer + input);
@@ -95,7 +103,7 @@ function Fn(form, fn) {
REPL.inputBuffer = inputStream.string + "\n";
return false;
} else
- return "READ ERROR: " + err;
+ return "READ ERROR: " + err;
}
try {
Please sign in to comment.
Something went wrong with that request. Please try again.