| Portability | portable |
|---|---|
| Stability | experimental |
| Maintainer | github.com/justinethier |
Language.Scheme.Core
Description
This module contains Core functionality, primarily Scheme expression evaluation.
- evalLisp :: Env -> LispVal -> IOThrowsError LispVal
- evalString :: Env -> String -> IO String
- evalAndPrint :: Env -> String -> IO ()
- apply :: LispVal -> LispVal -> [LispVal] -> IOThrowsError LispVal
- continueEval :: Env -> LispVal -> LispVal -> IOThrowsError LispVal
- primitiveBindings :: IO Env
- version :: String
- escapeBackslashes :: String -> String
- showBanner :: IO ()
- substr :: (LispVal, LispVal, LispVal) -> IOThrowsError LispVal
- updateVector :: LispVal -> LispVal -> LispVal -> IOThrowsError LispVal
Scheme code evaluation
evalLisp :: Env -> LispVal -> IOThrowsError LispVal
Evaluate lisp code that has already been loaded into haskell
evalString :: Env -> String -> IO String
evalAndPrint :: Env -> String -> IO ()
Evaluate a string and print results to console
Arguments
| :: Env | Current environment |
| -> LispVal | Current continuation |
| -> LispVal | Value of previous computation |
| -> IOThrowsError LispVal | Final value of computation |
A support function for eval; eval calls into this function instead of returning values directly. continueEval then uses the continuation argument to manage program control flow.
Core data
Environment containing the primitive forms that are built into the Scheme language. Note that this only includes forms that are implemented in Haskell; derived forms implemented in Scheme (such as let, list, etc) are available in the standard library which must be pulled into the environment using (load).
Utility functions
escapeBackslashes :: String -> String
A utility function to escape backslashes in the given string
showBanner :: IO ()
A utility function to display the husk console banner
substr :: (LispVal, LispVal, LispVal) -> IOThrowsError LispVal
A helper function for the special form (string-set!)
updateVector :: LispVal -> LispVal -> LispVal -> IOThrowsError LispVal
A helper function for the special form (vector-set!)