Example program for 'unloadAll'.

This commit is contained in:
lemmih
2005-05-19 03:23:30 +00:00
parent fc58e81ed6
commit 7dbaf7fe88
6 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,15 @@
import System.Plugins
import API
-- an example where we just want to load an object and run it
main = do
m_v <- load_ "../Null.o" ["../api",".."] "resource"
t <- load_ "../Dep.o" ["../api"] "resource"
case m_v of
LoadFailure err -> error (unlines err)
LoadSuccess m v -> do putStrLn ( show (a v) ) ; unloadAll m
case t of
LoadFailure err -> error (unlines err)
LoadSuccess m v -> do putStrLn ( show (a v) ) ; unloadAll m