Do any lisps have a s-expression as their head, e.g. ((f 2) 3 4)? If not, why?

前端 未结 3 1918
失恋的感觉
失恋的感觉 2021-01-12 11:24

Do any lisps support nested s-expression on their head? For example

((f 2) 3 4)

for which (f 2) presumably evaluates to a fun

3条回答
  •  无人及你
    2021-01-12 11:45

    For example in Common Lisp above is not valid. The syntax of Common Lisp does not generally allow lists as the head of a function call. You have to use FUNCALL to call a returned function value.

    (funcall (f 2) 3 4)
    

    In some other Lisp dialects it is allowed. Scheme is such a Lisp dialect. Scheme also evaluates the head of a function call expression.

提交回复
热议问题