public string AsString()
{
// TODO Refactor to String Builder
string result = "[";
foreach (var param in this.parameterNames)
result += " :" + param;
if (this.parameterNames.Count > 0)
result += " |";
if (this.localVariables.Count > 0)
{
result += " |";
foreach (var local in this.localVariables)
result += " " + local;
result += " |";
}
if (result != "[")
result += " ";
int nexpressions = 0;
foreach (IExpression expression in this.body)
{
if (nexpressions > 0)
result += ". ";
result += expression.AsString();
nexpressions++;
}
return result + "]";
}