From 8c26fbfb616ea0bcf9220fc7983ac1a98d282f60 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Mon, 29 Oct 2018 16:33:09 -0700 Subject: [PATCH] Fix up parts of Evaluatable Class; not sure about the `klass` declaration --- src/Data/Syntax/Declaration.hs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Data/Syntax/Declaration.hs b/src/Data/Syntax/Declaration.hs index 12bfe1008..d62d367a1 100644 --- a/src/Data/Syntax/Declaration.hs +++ b/src/Data/Syntax/Declaration.hs @@ -210,22 +210,21 @@ instance Evaluatable Class where supers <- for classSuperclasses $ \superclass -> do name <- maybeM (throwEvalError NoNameError) (declaredName (subterm superclass)) - scope <- associatedScope (Declaration name) - (scope,) <$> subtermAddress superclass + associatedScope (Declaration name) - let imports = (Import,) <$> (fmap pure . catMaybes $ fst <$> supers) + let imports = (Import,) <$> (fmap pure . catMaybes $ supers) current = maybe mempty (fmap (Lexical, ) . pure . pure) currentScope' edges = Map.fromList (imports <> current) childScope <- newScope edges declare (Declaration name) span (Just childScope) - withScope childScope $ do - (_, addr) <- letrec name $ do - void $ subtermValue classBody - classBinds <- Env.head <$> getEnv - klass name (snd <$> supers) classBinds - bind name addr - pure (Rval addr) + -- withScope childScope $ do + -- (_, addr) <- letrec name $ do + -- void $ subtermValue classBody + -- classBinds <- Env.head <$> getEnv + -- klass (Declaration name) (catMaybes supers) classBinds -- TODO: Update klass definition + -- pure (Rval addr) + rvalBox unit -- | A decorator in Python data Decorator a = Decorator { decoratorIdentifier :: !a, decoratorParamaters :: ![a], decoratorBody :: !a }