Portability | portable |
---|---|
Stability | experimental |
Maintainer | github.com/justinethier |
Safe Haskell | Safe-Infered |
This module contains code for working with Scheme variables, and the environments that contain them.
- printEnv :: Env -> IO String
- copyEnv :: Env -> IO Env
- extendEnv :: Env -> [((String, String), LispVal)] -> IO Env
- findNamespacedEnv :: Env -> String -> String -> IO (Maybe Env)
- getVar :: Env -> String -> IOThrowsError LispVal
- getNamespacedVar :: Env -> String -> String -> IOThrowsError LispVal
- defineVar :: Env -> String -> LispVal -> IOThrowsError LispVal
- setVar :: Env -> String -> LispVal -> IOThrowsError LispVal
- setNamespacedVar :: Env -> String -> String -> LispVal -> IOThrowsError LispVal
- defineNamespacedVar :: Env -> String -> String -> LispVal -> IOThrowsError LispVal
- isBound :: Env -> String -> IO Bool
- isRecBound :: Env -> String -> IO Bool
- isNamespacedBound :: Env -> String -> String -> IO Bool
- isNamespacedRecBound :: Env -> String -> String -> IO Bool
Environments
Show the contents of an environment
Create a deep copy of an environment
:: Env | Environment |
-> [((String, String), LispVal)] | Extensions to the environment |
-> IO Env | Extended environment |
Extend given environment by binding a series of values to a new environment.
:: Env | Environment to begin the search; parent env's will be searched as well. |
-> String | Namespace |
-> String | Variable |
-> IO (Maybe Env) | Environment, or Nothing if there was no match. |
Recursively search environments to find one that contains the given variable.
Getters
:: Env | Environment |
-> String | Variable |
-> IOThrowsError LispVal | Contents of the variable |
Retrieve the value of a variable defined in the default namespace
:: Env | Environment |
-> String | Namespace |
-> String | Variable |
-> IOThrowsError LispVal | Contents of the variable |
Retrieve the value of a variable defined in a given namespace
Setters
:: Env | Environment |
-> String | Variable |
-> LispVal | Value |
-> IOThrowsError LispVal | Value |
Bind a variable in the default namespace
:: Env | Environment |
-> String | Variable |
-> LispVal | Value |
-> IOThrowsError LispVal | Value |
Set a variable in the default namespace
:: Env | Environment |
-> String | Namespace |
-> String | Variable |
-> LispVal | Value |
-> IOThrowsError LispVal | Value |
Set a variable in a given namespace
:: Env | Environment |
-> String | Namespace |
-> String | Variable |
-> LispVal | Value |
-> IOThrowsError LispVal | Value |
Bind a variable in the given namespace
Predicates
Determine if a variable is bound in the default namespace
Determine if a variable is bound in the default namespace, in this environment or one of its parents.
Determine if a variable is bound in a given namespace