eval: add write, eval arguments before applying function

This commit is contained in:
2018-05-15 22:13:43 +02:00
parent 45822a2ecd
commit 6413bd7e81
4 changed files with 53 additions and 16 deletions

View File

@@ -120,6 +120,16 @@ func (ast *AST) Pretty() string {
return fmt.Sprintf("%v", ast.Val)
}
func (ast *AST) String() string {
switch ast.Tag {
case List, Quoted, Fn, Table, Prim:
return ast.Pretty()
case Char:
return string(ast.Val.(rune))
}
return fmt.Sprintf("%v", ast.Val)
}
type Env struct {
parent *Env
Values map[string]*AST