[erlang-questions] Types and specs [WAS: [enhancement] string:split/2]

Robert Virding rvirding@REDACTED
Fri Oct 31 16:35:13 CET 2008


2008/10/31 Tobias Lindahl <tobias.lindahl@REDACTED>

> Matthias Lang wrote:
> > On Tuesday, October 14, Kostis Sagonas wrote:
> >
> >> (If you want to specify an improper list the closer you can get is to
> >> employ the long and yucky type  maybe_improper_list()
> >
> > cons_cell() would have been a more appetising name.
>
> It used to be called cons_or_nil() once upon a time, then it became
> possibly_improper_list() and ended up in maybe_improper_list().
>
> The corresponding type to cons_cell() is the even nicer
> nonempty_maybe_improper_list().
>
> I agree that the names are too verbose, I'm not even sure anymore how it
> happened.


Perhaps it reflects the opinions of those who set the names that this is a
very bad thing and shouldn't be done, hence the verbose support. Lists are
nil terminated lists and cons cells are really list cells and should only be
used as such. :-)

Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081031/1db33d6a/attachment.htm>


More information about the erlang-questions mailing list