husk-scheme-1.0: R5RS Scheme interpreter program and library.

Scheme.Core

Synopsis

Documentation

eval :: Env -> LispVal -> IOThrowsError LispValSource

Core eval function

NOTE: This function does not include macro support and should not be called directly. Instead, use evalLisp

evalLisp :: Env -> LispVal -> IOThrowsError LispValSource

Evaluate lisp code that has already been loaded into haskell

TODO: code example for this, via ghci and/or a custom program.

evalString :: Env -> String -> IO StringSource

Evaluate a string containing Scheme code.

For example:

env <- primitiveBindings

evalString env (+ x x x)
3

evalString env (+ x x x (* 3 9))
30

evalString env (* 3 9)            
27

evalAndPrint :: Env -> String -> IO ()Source

Evaluate a string and print results to console

primitiveBindings :: IO EnvSource

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).