package ast

import "fmt"

// AnonymousFunction represents a anonymous function as an expression.
type AnonymousFunction struct {
	signature Signature
	body      interface{}
}

// NewAnonymousFunction creates a anonymous function.
func NewAnonymousFunction(s Signature, b interface{}) AnonymousFunction {
	return AnonymousFunction{s, b}
}

// Signature returns a signature of an anonymous function.
func (f AnonymousFunction) Signature() Signature {
	return f.signature
}

// Body returns a body expression of an anonymous function.
func (f AnonymousFunction) Body() interface{} {
	return f.body
}

func (f AnonymousFunction) String() string {
	return fmt.Sprintf("(\\ (%v) %v)", f.signature, f.body)
}

package ast

// AnonymousFunction represents a anonymous function as an expression.
type AnonymousFunction struct {
	signature Signature
	body      interface{}
}

// NewAnonymousFunction creates a anonymous function.
func NewAnonymousFunction(s Signature, b interface{}) AnonymousFunction {
	return AnonymousFunction{s, b}
}

// Signature returns a signature of an anonymous function.
func (f AnonymousFunction) Signature() Signature {
	return f.signature
}

// Body returns a body expression of an anonymous function.
func (f AnonymousFunction) Body() interface{} {
	return f.body
}

--- 
+++ 
@@ -1,4 +1,6 @@
 package ast
+
+import "fmt"
 
 // AnonymousFunction represents a anonymous function as an expression.
 type AnonymousFunction struct {
@@ -20,3 +22,7 @@
 func (f AnonymousFunction) Body() interface{} {
 	return f.body
 }
+
+func (f AnonymousFunction) String() string {
+	return fmt.Sprintf("(\\ (%v) %v)", f.signature, f.body)
+}
Implement Stringer for anonymous function
