Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
ef46487b
Commit
ef46487b
authored
Mar 23, 2001
by
simonmar
Browse files
[project @ 2001-03-23 12:12:18 by simonmar]
make :def work again
parent
ea21fc75
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/ghci/InteractiveUI.hs
View file @
ef46487b
-----------------------------------------------------------------------------
-- $Id: InteractiveUI.hs,v 1.5
5
2001/03/
15 11:23
:1
9
simonmar Exp $
-- $Id: InteractiveUI.hs,v 1.5
6
2001/03/
23 12:12
:1
8
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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment