How many primitives does it take to build a LISP machine? Ten, seven or five?

前端 未结 7 1337
夕颜
夕颜 2020-12-02 05:08

On this site they say there are 10 LISP primitives. The primitives are: atom, quote, eq, car, cdr, cons, cond, lambda, label, apply.

http://hyperpolygl

7条回答
  •  眼角桃花
    2020-12-02 05:20

    This faq states:

    There is no single "best" minimal set of primitives; it all depends on the implementation. For example, even something as basic as numbers need not be primitive, and can be represented as lists. One possible set of primitives might include CAR, CDR, and CONS for manipulation of S-expressions, READ and PRINT for the input/output of S-expressions and APPLY and EVAL for the guts of an interpreter. But then you might want to add LAMBDA for functions, EQ for equality, COND for conditionals, SET for assignment, and DEFUN for definitions. QUOTE might come in handy as well.

    That comes from the School of Computer Science, Carnegie Melon website.

提交回复
热议问题