Functional Programming: what is an “improper list”?

前端 未结 9 1010
遥遥无期
遥遥无期 2020-11-27 04:38

Could somebody explain what an \"improper list\" is?

Note: Thanks to all ! All you guys rock!

9条回答
  •  春和景丽
    2020-11-27 05:09

    I think possibly it refers to a "dotted pair" in LISP, e.g. a list whose final cons cell has an atom, rather than a reference to another cons cell or NIL, in the cdr.

    EDIT

    Wikipedia suggests that a circular list also counts as improper. See

    http://en.wikipedia.org/wiki/Lisp_(programming_language)

    and search for 'improper' and check the footnotes.

提交回复
热议问题