Algebraic data types: Difference between revisions
Content added Content deleted
(Added C#) |
(C# changed output to look more like a tree) |
||
Line 285: | Line 285: | ||
public void Print(int indent = 0) { |
public void Print(int indent = 0) { |
||
⚫ | |||
Console.WriteLine(new string(' ', indent * 4) + ToString()); |
Console.WriteLine(new string(' ', indent * 4) + ToString()); |
||
if (this |
if (this != E) Left.Print(indent + 1); |
||
Left.Print(indent + 1); |
|||
⚫ | |||
} |
} |
||
Line 308: | Line 307: | ||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
⚫ | |||
⚫ | |||
[ |
[R16] |
||
[ |
[] |
||
[ |
[B15] |
||
[] |
[] |
||
⚫ | |||
[] |
[] |
||
[ |
[B13] |
||
[] |
[] |
||
⚫ | |||
[] |
[] |
||
[ |
[B11] |
||
⚫ | |||
[] |
[] |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
[B10] |
[B10] |
||
⚫ | |||
[B9] |
[B9] |
||
[] |
[] |
||
⚫ | |||
[] |
[] |
||
[ |
[B7] |
||
[] |
[] |
||
⚫ | |||
[] |
[] |
||
[ |
[B5] |
||
[B13] |
|||
[] |
[] |
||
[B4] |
|||
[] |
[] |
||
[ |
[B3] |
||
[] |
[] |
||
[B2] |
|||
[] |
|||
[B1] |
|||
⚫ | |||
=={{header|Clojure}}== |
=={{header|Clojure}}== |