[erlang-questions] How to decide if the type of two variables isthe same record?
Mats Cronqvist
mats.cronqvist@REDACTED
Thu Jun 14 14:22:41 CEST 2007
Ulf Wiger (TN/EAB) wrote:
> I think it's reasonably safe to write code
> that does this:
>
> same_record_type(A,B) ->
> is_tuple(A)
> andalso is_tuple(B)
> andalso size(A) == size(B)
> andalso element(1,A) == element(1,B).
>
> That sums up the amount of testing that can
> be done in order to verify that two variables
> are of the same record type. These properties
> of records are also documented.
note that many large Erlang projects have design rules that forbids peeking
into the record structure :>
mats
More information about the erlang-questions
mailing list