[erlang-questions] Are recursive record definitions allowed?

Fredrik Andersson <>
Thu Jul 29 13:17:34 CEST 2010


On Wed, Jul 28, 2010 at 7:39 PM, Tony Arcieri <> wrote:
> On Tue, Jul 27, 2010 at 1:28 PM, Brian Williams <> wrote:
>
>> I'm working on some algorithm analysis and am trying to define a
>> fairly simple binary search tree with a record definition:
>> -record(btreenode, {left = #btreenode{}, right = #btreenode{}, value}).
>
>
> Wouldn't you want the defaults to be for the leaf nodes, and if so,
> shouldn't they be some sort of nil/null/void atom to indicate there are no
> left/right branches?
>
> --
> Tony Arcieri
> Medioh! A Kudelski Brand
>

Why not even make them the atom leaf? :)


More information about the erlang-questions mailing list