Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changing startup routine and adding version number to Scotch.Config.

  • Loading branch information...
commit 518917a567aa784ce02ee9a423e33049ea00bfc7 1 parent 6c36bfc
@bendmorris authored
View
7 Scotch/Config/Paths.hs → Scotch/Config.hs
@@ -1,7 +1,12 @@
-module Scotch.Config.Paths where
+module Scotch.Config where
import System.Environment.Executable
+import System.Info
+version = "0.5.0"
+
+environment = os
+
libraryPath = do fullPath <- splitExecutablePath
return $ (fst fullPath) ++ "scotch.lib"
View
2  Scotch/Eval/ReadFile.hs
@@ -28,7 +28,7 @@ import Scotch.Types.Bindings
import Scotch.Types.Hash
import Scotch.Types.Interpreter
import Scotch.Eval.Eval
-import Scotch.Config.Paths
+import Scotch.Config
-- interpret a list of code lines using a list of scoped bindings
View
5 scotch.hs
@@ -25,6 +25,7 @@ import Data.List
import System.Console.Haskeline
import System.Console.Haskeline.IO
import System.Console.Haskeline.Completion
+import Scotch.Config
import Scotch.Parse.Parse as Parse
import Scotch.Eval.ReadFile
import Scotch.Types.Types
@@ -95,9 +96,11 @@ main = do args <- getArgs
if interpret then loop settings newbindings state
else return ()
-- otherwise, start the interpreter
- else do wexecute settings [(Nothing, (Var "startup"))] stdlib
+ else do putStrLn $ "Scotch, version " ++ version ++ " on " ++ environment
+ putStrLn "For more information, type \"about\", \"copyright\" or \"license\"."
loop settings stdlib state
+
-- the interpreter's main REPL loop
loop :: InterpreterSettings -> VarDict -> InputState -> IO ()
loop settings [] state = loop settings emptyHash state
View
3  scotch.lib/std/startup.sco
@@ -1,3 +0,0 @@
-print("Scotch interpreter")
-import std.version
-print("For more information, type \"about\", \"copyright\" or \"license\".")
Please sign in to comment.
Something went wrong with that request. Please try again.