# HG changeset patch # User Mike Pavone # Date 1388984015 28800 # Node ID dc5f487247ee6d1f55ebe26f810b13f182989247 # Parent 6aab8a5a2be9552e92e51b0149dd7cde0bb1e864 Don't rename the symbol self in quote blocks diff -r 6aab8a5a2be9 -r dc5f487247ee interp.js --- a/interp.js Sun Jan 05 19:28:09 2014 -0800 +++ b/interp.js Sun Jan 05 20:53:35 2014 -0800 @@ -320,7 +320,7 @@ }; symbol.prototype.makeHygienic = function(env) { - if (this.dirty) { + if (this.dirty && this.cleanName() != 'self') { var hygenic = env.findQuoteTrans(this.cleanName()); if (hygenic) { @@ -742,6 +742,8 @@ this.expressions[i] = expr.macroexpand(env); if (this.expressions[i].expression instanceof lambda) { env.syms[expr.symbol.cleanName()] = this.expressions[i].expression.eval(env); + } else { + env.syms[expr.symbol.cleanName()] = null; } } } else { @@ -773,7 +775,7 @@ var env = new environment(parentenv); for (var i = 0; i < this.args.length; i++) { env.syms[this.args[i].cleanName()] = null; - if (this.args[i].dirty) { + if (this.args[i].dirty && this.args[i].cleanName() != 'self') { var hygienic = '' + quote_prefix + this.args[i].cleanName(); env.quotetrans[this.args[i].cleanName()] = hygienic; args.push(new symbol(hygienic, this.args[i].symbols));