]> git.kianting.info Git - anotherTypesetter/commitdiff
make it neat.
authorTan Kian-ting <chenjt30@gmail.com>
Fri, 5 Apr 2024 15:39:09 +0000 (23:39 +0800)
committerTan Kian-ting <chenjt30@gmail.com>
Fri, 5 Apr 2024 15:39:09 +0000 (23:39 +0800)
src/index.ts

index 448d3fb6f7e6aae409dbc8cac1cdfaf93ab8f573..5700e3e8dbe08f0c65b8666716ac20ebcd952246 100644 (file)
@@ -548,8 +548,8 @@ function interp(prog: AST, env: Env): AST {
 
 
             // for recursion function usage
-            for(let i=0;i<Object.keys(env).length;i++){
-              const currentKey = Object.keys(env)[i];
+            for(const key in env){
+              const currentKey = key;
               const currentValue = env[currentKey];
               if (currentValue[0].isRec !== undefined && currentValue[0].isRec === true){
                 newEnv = extendEnv(newEnv, currentKey, true, currentValue[0].value);