(prl (the Cons foo))
By contrast, the statement
(ToString (the Cons foo))
returns "LSharp.Cons", as does any command that implicitly converts a
Cons to a string.
Is there currently a clean way to retrieve a string representation of a
list as a string rather than sending it to console?
If not, it seems like the obvious solution would be to have Cons
override ToString and produce the same string that the pr command
produces (i.e. no newline). Does that seem reasonable?
The only thing that needs to be done to fix this is that the following
additional method needs to be added to Cons.cs:
/// <summary>
/// Overrides the default ToString to return the string
representation of the list
/// as produced by the L Sharp Printer.
/// </summary>
/// <returns>The string represention of the list.</returns>
public override string ToString()
{
return Printer.WriteToString(this);
}
Is this a reasonable request?