Algebraic data types: Difference between revisions
→{{header|Bracmat}} Declared local variable C. Changed output function from 'out' to 'lst'. Surrounded code with parentheses, so the code can be copy/pasted to Bracmat command prompt.
(Added Erlang) |
|||
Line 7:
=={{header|Bracmat}}==
<lang bracmat>
= a x b y c zd
. !arg
Line 29:
)
& ( ins
= C X tree a m z
. !arg:(?X.?tree)
& !tree:(?C.?a,?m,?z)
Line 53:
| insert$!arg
)
);</lang>
Test:
<lang bracmat>
, and can represent the algorithm directly
.
)
: ?values
& insertMany$(!values.):?tree
&
& done
);</lang>
Output:
<lang bracmat>
B
. ( B
. (R.(B.,,),algorithm,(B.,allows,))
Line 85 ⟶ 87:
, (R.(B.,the,),to,(B.,which,))
)
)
);</lang>
=={{header|Clojure}}==
|