Changed display of expressions
This commit is contained in:
parent
ee13a75141
commit
4807eb0cbe
|
@ -7,9 +7,16 @@ data Expr = IntE Integer
|
|||
| LambdaE String Expr
|
||||
| QuotedE Expr
|
||||
| NilE
|
||||
deriving (Show)
|
||||
|
||||
-- instance Show Expr where
|
||||
-- show (IntE x) = show x
|
||||
-- show (VarE x) = x ++ " ; var"
|
||||
-- show NilE = "nil"
|
||||
-- Make set! and lambda(?) parsed as cons, detect later set! and lambda as special procedures
|
||||
|
||||
instance Show Expr where
|
||||
show (IntE x) = show x
|
||||
show (VarE x) = x
|
||||
show (SetE _ _) = "#set"
|
||||
show c@(ConsE _ _) = "(" ++ showCons c
|
||||
where showCons (ConsE _ NilE) = ")"
|
||||
showCons (ConsE x xs) = show x ++ " " ++ showCons xs
|
||||
show (LambdaE s e) = "#lambda"
|
||||
show (QuotedE e) = show e
|
||||
show NilE = "nil"
|
||||
|
|
Loading…
Reference in New Issue