module Main where
+import Control.Monad
import Text.ParserCombinators.Parsec hiding (spaces)
import System.Environment
char '"'
return $ String x
+parseAtom :: Parser LispVal
+parseAtom = do
+ a <- letter <|> symbol
+ b <- many (letter <|> digit <|> symbol)
+ let atom = a:b
+ return $ case atom of
+ "#t" -> Bool True
+ "#f" -> Bool False
+ _ -> Atom atom
+
+parseNumber :: Parser LispVal
+parseNumber = liftM (Number . read) $ many1 digit
+
readExpr :: String -> String
readExpr input = case parse (spaces >> symbol) "lisp" input of
Left err -> "No match: " ++ show err