Proper or well formed Lists
Thu Dec 14 10:25:50 CET 2000
Well, one possible use of non-well-formed lists was explored a while
ago on erlang-questions: lazy lists:
It was decided not to open that Pandora's Box.
Another use seems to be [byte() | binary()], which is accepted by
the list_to_binary/1 BIF. It doesn't seem indispensable.
I agree that there would be an advantage to have clearer errors in the
cases where lists are supposed to be well-formed, but aren't.
On Thu, 14 Dec 2000, Francesco Cesarini wrote:
>A well formed list follows the definition List = [Term|List] or .
>Why where non proper (or well formed) lists (List = [Term|Term] ex:
>[hello|world]) allowed in the language in the first place?
>I am having a hard time seeing the need or intent with non well
>formed lists, other than a simplifying run-time evaluations and
>possibly the parsing. Wouldn't it have been better to have
>expressions not evaluating to a well formed list result in a run
Ulf Wiger tfn: +46 8 719 81 95
Senior System Architect mob: +46 70 519 81 95
Strategic Product & System Management ATM Multiservice Networks
Data Backbone & Optical Services Division Ericsson Telecom AB
More information about the erlang-questions