<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">BTW, you'll probably learn a lot by checking out this video from the last Erlang factory<div><br></div><div><a href="http://www.erlang-factory.com/conference/SFBay2013/speakers/ErikStenman">http://www.erlang-factory.com/conference/SFBay2013/speakers/ErikStenman</a></div><div><br></div><div>as it gives some good examples of what is happening in the heap and stack of a process and talks about term sharing and how it works.</div><div><br></div><div>-Anthony</div><div><br><div><div>On Jun 1, 2013, at 8:55 AM, Bryan Hughes <<a href="mailto:bryan@go-factory.net">bryan@go-factory.net</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<div bgcolor="#FFFFFF" text="#000000">
Thanks Bob - that is what I was thinking/hoping. <br>
<br>
<div class="moz-cite-prefix">On 6/1/13 8:50 AM, Bob Ippolito wrote:<br>
</div>
<blockquote cite="mid:CACwMPm_BtX7e_z4wN-3U11e0fGX4pNTGpygvFfQvK1kBOojG2g@mail.gmail.com" type="cite">It's not copied in this case, nested records aren't
flattened or anything like that. Records are just tuples after
all. <span></span><br>
<br>
On Saturday, June 1, 2013, Bryan Hughes wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> Howdy!<br>
<br>
I am working on section of code that will be dealing with a
large number of records in a relatively tight loop and have a
question in how Erlang constructs a nested record.<br>
<br>
If I define a person and manager record:<br>
<br>
1> rd(person, {name, age}).<br>
person<br>
2> rd(manager, {person, dept}).<br>
manager<br>
<br>
Then create a person record:<br>
<br>
3> P = #person{name = bryan, age = 45}.<br>
#person{name = bryan,age = 45}<br>
<br>
And then a manager record:<br>
<br>
4> M = #manager{person = P, dept = foo}.<br>
#manager{person = #person{name = bryan,age = 45},dept = foo}<br>
<br>
When the manager record is created, is the nested person
record P referenced by the manager record M, or is it copied?
<br>
<br>
Thanks,<br>
Bryan<br>
<br>
<div>-- <br><p style="font-size:12px"> Bryan Hughes<br>
<b>Go Factory</b><br>
<a moz-do-not-send="true" href="http://www.go-factory.net/" target="_blank">http://www.go-factory.net</a><br>
<br>
<i>"Internet Class, Enterprise Grade"</i><br>
</p><p><br>
</p>
</div>
</div>
</blockquote>
</blockquote>
<div class="moz-signature"><p><br>
</p>
</div>
</div>
_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>http://erlang.org/mailman/listinfo/erlang-questions<br></blockquote></div><br></div></body></html>