On 11/03/2008, <b class="gmail_sendername">Mats Cronqvist</b> <<a href="mailto:mats.cronqvist@kreditor.se">mats.cronqvist@kreditor.se</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Jim McCoy wrote:<br> > ... Regardless of what records were<br> > intended to solve...<br> ><br>  i believe that the original requirement was something like; "access to<br> tuple elements by name, but with zero overhead compared to normal tuple<br>
 access."<br>  a pretty tall order (and, with hindsight, misguided)...</blockquote><div><br>Yes, this was one of the original requirements of our first/major users. They wanted named fields but as fast as using tuples directly. The system (computer+emulator) wasn't as fast in those days and they felt they couldn't offer performance. It was not misguided then. Anyway this meant that everything had to be done at compile-time, which *is* very un-Erlangy.<br>
<br>Some other factors which influenced the syntax:<br><br>- No typing in Erlang and no record information in the record (for speed). This meant that you either have a shared field-name space over all records with unique field-names over all records or you had to explicitly say which record type it was. We chose the latter as being more manageable.<br>
<br>- The syntax and semantics of '=' as a match and that it returned the RHS value which meant that you can do X = {P,Q,R} = ... . There were no aliases in patterns then. This made a field setting syntax difficult.<br>
<br>Perhaps it would have been better to generate access functions or macros instead (like lisps and LFE do) but macros were very new then and we weren't yet into that. That would be possible to add today.<br><br>I definitely think it is time to add runtime dynamic structures to the language. As Richard O'Keefe mentioned there are at least two suggestions for this, his own and one from Joe.<br>
<br>Robert<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">  mats<br> <br> <br>_______________________________________________<br>
 erlang-questions mailing list<br> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br> <a href="http://www.erlang.org/mailman/listinfo/erlang-questions">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br>