We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 801f5d9 commit 3dc2890Copy full SHA for 3dc2890
tinylisp.js
@@ -34,15 +34,13 @@
34
},
35
36
lambda: function(input, context) {
37
- return {
38
- type: "invocation",
39
- value: function(args) {
40
- var lambdaScope = input[1].reduce(function(acc, x, i) {
41
- acc[x.value] = args[i];
42
- return acc;
43
- }, {});
44
- return interpret(input[2], new Context(lambdaScope, context));
45
- }
+ return function() {
+ var lambdaArguments = arguments;
+ var lambdaScope = input[1].reduce(function(acc, x, i) {
+ acc[x.value] = lambdaArguments[i];
+ return acc;
+ }, {});
+ return interpret(input[2], new Context(lambdaScope, context));
46
};
47
48
@@ -96,6 +94,7 @@
96
94
}
97
95
98
+ // do this without depth
99
var parenthesize = function(input) {
100
var output = [];
101
var depth = 0;
0 commit comments