Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the “minimal” set of primitives needed for a Lisp interpreter?

0
Posted

What is the “minimal” set of primitives needed for a Lisp interpreter?

0

Many Lisp functions can be defined in terms of other Lisp functions. For example, CAAR can be defined in terms of CAR as (defun caar (list) (car (car list))) It is then natural to ask whether there is a “minimal” or smallest set of primitives necessary to implement the language. 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. If you add more specialized datatypes, such as integers, floats, arrays, characters, and structures, you’ll need to add primitives to construct and

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.