[erlang-questions] Are recursive record definitions allowed?

Hynek Vychodil <>
Tue Jul 27 23:40:43 CEST 2010


On Tue, Jul 27, 2010 at 9: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}).
> I get:
> record btreenode undefined
>
> Should I just not bother to specify the type of left and right and
> just enforce the record type in code?
>

Left term on = is default value. What should be done when you define
#btreenode{}? I think that even all memory available in the universe
will not suffice to declare this term ;-)
>
> --
> Brian E. Williams
> 
> http://www.techhouse.us/wordpress-mu/brianw
>
> "Never attribute to malice that which can be adequately
> explained by stupidity." - Hanlon's Razor
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
>
>



-- 
--Hynek (Pichi) Vychodil

Analyze your data in minutes. Share your insights instantly. Thrill
your boss.  Be a data hero!
Try GoodData now for free: www.gooddata.com


More information about the erlang-questions mailing list