From ef46487bb4c0c3199186d6e1e6ca025a45b2e4d0 Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 23 Mar 2001 12:12:18 +0000 Subject: [PATCH] [project @ 2001-03-23 12:12:18 by simonmar] make :def work again --- ghc/compiler/ghci/InteractiveUI.hs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index 7987405..58266f5 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: InteractiveUI.hs,v 1.55 2001/03/15 11:23:19 simonmar Exp $ +-- $Id: InteractiveUI.hs,v 1.56 2001/03/23 12:12:18 simonmar Exp $ -- -- GHC Interactive User Interface -- @@ -345,14 +345,9 @@ defineMacro s = do (new_cmstate, maybe_hv) <- io (cmCompileExpr (cmstate st) dflags new_expr) setGHCiState st{cmstate = new_cmstate} case maybe_hv of - Nothing -> return () - Just hv -> - do funs <- io (unsafeCoerce# hv :: IO [HValue]) - case funs of - [fun] -> io (writeIORef commands - ((macro_name, keepGoing (runMacro fun)) - : cmds)) - _ -> throwDyn (OtherError "defineMacro: bizarre") + Nothing -> return () + Just hv -> io (writeIORef commands -- + ((macro_name, keepGoing (runMacro hv)) : cmds)) runMacro :: HValue{-String -> IO String-} -> String -> GHCi () runMacro fun s = do -- 1.7.10.4