husk-scheme 3.4.3 → 3.4.4
raw patch · 5 files changed
+51/−11 lines, 5 files
Files
- hs-src/Language/Scheme/Core.hs +2/−0
- hs-src/Language/Scheme/FFI.hs +3/−1
- hs-src/shell.hs +2/−2
- husk-scheme.cabal +1/−1
- stdlib.scm +43/−7
hs-src/Language/Scheme/Core.hs view
@@ -807,11 +807,13 @@ evalfuncCallCC [cont@(Continuation _ _ _ _ _), func] = do case func of+ Continuation _ _ _ _ _ -> apply cont func [cont] PrimitiveFunc f -> do result <- liftThrows $ f [cont] case cont of Continuation cEnv _ _ _ _ -> continueEval cEnv cont result _ -> return result+ Func _ (Just _) _ _ -> apply cont func [cont] -- Variable # of args (pair). Just call into cont Func aparams _ _ _ -> if (toInteger $ length aparams) == 1 then apply cont func [cont]
hs-src/Language/Scheme/FFI.hs view
@@ -94,8 +94,10 @@ defaultRunGhc :: GHC.Ghc a -> IO a defaultRunGhc =-#if __GLASGOW_HASKELL__ < 720+#if __GLASGOW_HASKELL__ <= 700+ -- Old syntax for GHC 7.0.x and lower GHC.defaultErrorHandler DynFlags.defaultDynFlags . GHC.runGhc (Just GHC.Paths.libdir) #else+ -- New syntax in GHC 7.2 GHC.defaultErrorHandler DynFlags.defaultLogAction . GHC.runGhc (Just GHC.Paths.libdir) #endif
hs-src/shell.hs view
@@ -67,8 +67,8 @@ putStrLn " | | | | |_| \\__ \\ < /// \\\\\\ \\__ \\ (__| | | | __/ | | | | | __/ " putStrLn " |_| |_|\\__,_|___/_|\\_\\ /// \\\\\\ |___/\\___|_| |_|\\___|_| |_| |_|\\___| " putStrLn " "- putStrLn " husk Scheme Interpreter Version 3.4.3 "- putStrLn " (c) 2010-2011 Justin Ethier github.com/justinethier/husk-scheme "+ putStrLn " http://justinethier.github.com/husk-scheme Version 3.4.4 "+ putStrLn " (c) 2010-2011 Justin Ethier " putStrLn " " runRepl :: IO ()
husk-scheme.cabal view
@@ -1,5 +1,5 @@ Name: husk-scheme-Version: 3.4.3+Version: 3.4.4 Synopsis: R5RS Scheme interpreter program and library. Description: A dialect of R5RS Scheme written in Haskell. Provides advanced features including continuations, hygienic macros, a Haskell FFI,
stdlib.scm view
@@ -107,7 +107,19 @@ (define-syntax cond (syntax-rules (else =>) ((cond (else result1 result2 ...))- (begin result1 result2 ...))+;+; TODO: see pitfall 3.2+;+; This is a modification from R5RS - we put the begin within+; an if statement, because in this context definitions are+; not allowed. This prevents one from interfering with macro+; hygiene. +;+; TODO: unfortunately the macro logic has not yet been+; updated to take this into acccount, so the pitfall+; still fails+;+ (if #t (begin result1 result2 ...))) ((cond (test => result)) (let ((temp test)) (if temp (result temp))))@@ -139,7 +151,7 @@ (case atom-key clauses ...))) ((case key (else result1 result2 ...))- (begin result1 result2 ...))+ (if #t (begin result1 result2 ...))) ((case key ((atoms ...) result1 result2 ...)) (if (memv key '(atoms ...))@@ -201,12 +213,36 @@ (fold (lambda (a b) (append-2 b a)) (car lst) (cdr lst)))))) ; Let forms+;+; letrec from R5RS (define-syntax letrec- (syntax-rules ()- ((_ ((x v) ...) e1 e2 ...)- (let () - (define x v) ...- (let () e1 e2 ...)))))+ (syntax-rules ()+ ((letrec ((var1 init1) ...) body ...)+ (letrec "generate_temp_names"+ (var1 ...)+ ()+ ((var1 init1) ...)+ body ...))+ ((letrec "generate_temp_names"+ ()+ (temp1 ...)+ ((var1 init1) ...)+ body ...) ; start the changed code+ (let ((var1 #f) ...)+ (let ((temp1 init1) ...)+ (set! var1 temp1)+ ...+ body ...)))+ ((letrec "generate_temp_names"+ (x y ...)+ (temp ...)+ ((var1 init1) ...)+ body ...)+ (letrec "generate_temp_names"+ (y ...)+ (newtemp temp ...)+ ((var1 init1) ...)+ body ...)))) ; let and named let (using the Y-combinator): (define-syntax let