husk-scheme 3.5.3.1 → 3.5.3.2
raw patch · 5 files changed
+31/−15 lines, 5 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Language.Scheme.Core: escapeBackslashes :: String -> String
Files
- hs-src/Compiler/huskc.hs +1/−1
- hs-src/Interpreter/shell.hs +2/−2
- hs-src/Language/Scheme/Core.hs +10/−1
- hs-src/Language/Scheme/Macro.hs +17/−10
- husk-scheme.cabal +1/−1
hs-src/Compiler/huskc.hs view
@@ -132,7 +132,7 @@ process inFile outExec dynamic extraArgs = do env <- liftIO $ nullEnv stdlib <- getDataFileName "stdlib.scm"- result <- (runIOThrows $ liftM show $ compileSchemeFile env stdlib inFile)+ result <- (runIOThrows $ liftM show $ compileSchemeFile env (stdlib) inFile) case result of "" -> compileHaskellFile outExec dynamic extraArgs _ -> putStrLn result
hs-src/Interpreter/shell.hs view
@@ -37,7 +37,7 @@ env <- primitiveBindings >>= flip extendEnv [((varNamespace, "args"), List $ map String $ drop 1 args)]- _ <- evalString env $ "(load \"" ++ stdlib ++ "\")" -- Load standard library+ _ <- evalString env $ "(load \"" ++ (escapeBackslashes stdlib) ++ "\")" -- Load standard library result <- (runIOThrows $ liftM show $ evalLisp env (List [Atom "load", String (args !! 0)])) case result of "" -> putStr result@@ -58,7 +58,7 @@ runRepl = do stdlib <- getDataFileName "stdlib.scm" env <- primitiveBindings- _ <- evalString env $ "(load \"" ++ stdlib ++ "\")" -- Load standard library into the REPL+ _ <- evalString env $ "(load \"" ++ (escapeBackslashes stdlib) ++ "\")" -- Load standard library into the REPL runInputT defaultSettings (loop env) where loop :: Env -> InputT IO ()
hs-src/Language/Scheme/Core.hs view
@@ -18,6 +18,9 @@ , primitiveBindings , apply , continueEval+-- TODO: we are starting to get some cruft here with utility functions.+-- they should be relocated to a new Util module...+ , escapeBackslashes , showBanner , substr , updateVector@@ -37,7 +40,7 @@ import System.IO version :: String-version = "3.5.3.1"+version = "3.5.3.2" showBanner :: IO () showBanner = do@@ -52,6 +55,12 @@ putStrLn " (c) 2010-2012 Justin Ethier " putStrLn $ " Version " ++ version ++ " " putStrLn " "++-- |A utility function to escape backslashes in the given string+escapeBackslashes :: String -> String+escapeBackslashes s = foldr step [] s+ where step x xs | x == '\\' = '\\' : '\\' : xs+ | otherwise = x : xs {- |Evaluate a string containing Scheme code.
hs-src/Language/Scheme/Macro.hs view
@@ -14,23 +14,30 @@ transformation, the following components are considered: - Pattern (part of a rule that matches input)+ - Transform (what the macro "expands" into)+ - Literal Identifiers (from the macro definition)+ - Input (the actual code in the user's program)+ - Environments of macro definition and macro use At a high level, macro transformation is broken down into the following steps: - 0) Walk the input code looking for a macro definition or macro call. If a macro call is found -- 1) Search for a rule that matches the input.- During this process, any pattern variables in the input are loaded into a temporary environment- 2) If a rule matches,- 3) Transcribe the rule's template by walking the template, inserting pattern variables - and renaming free identifiers as needed.- 4) Walk the expanded code, checking for each of the cases from Macros That Work. If a - case is found (such as a macro call or procedure abstraction) then the appropriate - handler will be called to deal with it.+ (0) Walk the input code looking for a macro definition or macro call. If a macro call is found - + (1) Search for a rule that matches the input.+ During this process, any pattern variables in the input are loaded into a temporary environment++ (2) If a rule matches,++ (3) Transcribe the rule's template by walking the template, inserting pattern variables + and renaming free identifiers as needed.++ (4) Walk the expanded code, checking for each of the cases from Macros That Work. If a + case is found (such as a macro call or procedure abstraction) then the appropriate + handler will be called to deal with it. -} module Language.Scheme.Macro@@ -94,7 +101,7 @@ --needToExtendEnv _ = False -- |macroEval--- Search for macro's in the AST, and transform any that are found.+-- Search for macros in the AST, and transform any that are found. macroEval :: Env -> LispVal -> IOThrowsError LispVal {- Inspect code for macros
husk-scheme.cabal view
@@ -1,5 +1,5 @@ Name: husk-scheme-Version: 3.5.3.1+Version: 3.5.3.2 Synopsis: R5RS Scheme interpreter, compiler, and library. Description: A dialect of R5RS Scheme written in Haskell. Provides advanced features including continuations, hygienic macros, a Haskell FFI,