[erlang-questions] Bug ?!
Richard A. O'Keefe
Tue Oct 3 01:38:38 CEST 2006
We've seen a number of explanations for why <variable>#<record>.<field>
isn't allowed in a pattern match. Basically, it's because that expands
to element(<field number>, <variable>), and that happens not to be allowed.
Of course, it could be given a different expansion, so the question
of whether field access SHOULD be allowed in a pattern remains open.
My first reaction was "well, a reasonable user wanted to use it, so why not?"
The more I thought about it, the less I liked it, but I can't quite put my
finger on why not. It's something to do with blurring the distinction
between patterns and expressions too much. Can anyone else put it into words?
More information about the erlang-questions