Skip to content

Commit b8adfa8

Browse files
committed
Make let bind more succinct. Use generic var name for binding data.
1 parent 01b49c8 commit b8adfa8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tinylisp.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@
2727
var special = {
2828
let: function(input, context) {
2929
var letContext = new Context({}, context);
30-
input[1].forEach(function(binding) {
31-
var name = binding[0].value;
32-
var init = binding[1];
33-
letContext.scope[name] = interpret(init, context);
30+
input[1].forEach(function(x) {
31+
letContext.scope[x[0].value] = interpret(x[1], context);
3432
});
3533
return interpret(input[2], letContext);
3634
},

0 commit comments

Comments
 (0)