Record selectors

Vlad Dumitrescu (EAW) Vlad.Dumitrescu@REDACTED
Mon Jan 13 12:54:45 CET 2003


Hi,

	Well, if I wanted to play the great directory hunt then I'd use Java! 
	Seriously there is a great deal of legacy code (perhaps every system written 
	since the invention of gen_server) which relies on this behaviour so I don't think 
	removing it is an option.

True. If the compiler had -record() info available, then this could be fixed by having it 
check first if there is a -record() included into the file with the current name, then check 
if there is an utype module present. But since -record()s are a preprocessor thing, it would 
require more changes...

	So, it would seem that even to make a simple analysis tool would require 
	the compiler to hold onto the knowledge of record definitions a few more 
	steps into the process (before finally turning accesses into erlang:element/2 calls). 

Yep, a source code tool is called for... Richard Carlsson's Igor showed pretty neat things 
that can be done with those. A source code analyzer seems very doable. One caveat is that 
the result may be dependent of the compilation options (i.e. library dirs and such), and 
thus such options need to be fed into the analyzer.

regards,
Vlad



More information about the erlang-questions mailing list