Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One of the problems with records (except the ugly syntax, especially with nested records) as a compile-time construct comes when you need to do hot loading of a module while keeping it running. The transition function using the record can no longer use the '#name{}' construct because the expanded tuple form will not match in both cases and the function will crash.

You instead need to expand the old version of the record to avoid the problem. If you forget to, things will go wrong.

So yeah, they're ugly and get tricky in some areas of your programs, but they're still essential when you want a data structure with named fields AND pattern matching. You get used to them, but they're still considered a wart to many programmers.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: