From 52d428514631cf9ed54e2f8ad418ea21165011c7 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 1 May 2015 19:18:02 -0400 Subject: Optimized the compiler with 2 tweaks: - Compilation units are not longer wrapped inside Expression/Statement variants. - analyse-apply* no longer returns lists. --- source/lux.lux | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'source/lux.lux') diff --git a/source/lux.lux b/source/lux.lux index a385bb700..06a9a1e58 100644 --- a/source/lux.lux +++ b/source/lux.lux @@ -1364,32 +1364,6 @@ ## _ ## (return (:' SyntaxList (list syntax))))) -(def #export (macro-expand syntax state) - (-> Syntax ($' Lux ($' List Syntax))) - (case' syntax - (#Meta [_ (#Form (#Cons [(#Meta [_ (#Symbol macro-name)]) args]))]) - (do Lux:Monad - [macro' (find-macro macro-name)] - (case' macro' - (#Some macro) - (do Lux:Monad - [expansion (macro args) - expansion' (map% Lux:Monad macro-expand expansion)] - (;return (:' SyntaxList (join-list expansion')))) - - #None - (do Lux:Monad - [parts' (map% Lux:Monad macro-expand (list& ($symbol macro-name) args))] - (;return (:' Syntax (list ($form (join-list parts')))))))) - - (#Meta [_ (#Tuple members)]) - (do Lux:Monad - [members' (map% Lux:Monad macro-expand members)] - (;return (:' Syntax (list ($tuple (join-list members')))))) - - _ - (return (:' SyntaxList (list syntax))))) - ## ## (def (walk-type type) ## ## (-> Syntax ($' Lux Syntax)) ## ## (case' type -- cgit v1.2.3