From 1957ac95f826d484c261e5266f415d8617563008 Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Sat, 27 Jun 2020 10:12:58 -0700 Subject: [PATCH] Support function definitions that set earlier bindings. --- anticompiler.fnl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/anticompiler.fnl b/anticompiler.fnl index 8f5d314..c50d600 100644 --- a/anticompiler.fnl +++ b/anticompiler.fnl @@ -20,8 +20,12 @@ (unpack (map body compile)))) (fn declare-function [compile ast] - (doto (function compile ast) - (table.insert 2 (compile ast.id)))) + (if (or ast.locald (= :MemberExpression ast.id.kind)) + (doto (function compile ast) + (table.insert 2 (compile ast.id))) + (list (sym :set-forcibly!) + (compile ast.id) + (function compile ast)))) (fn local-declaration [compile {: names : expressions}] (list (sym :var) -- 2.26.2