Lisp 的小片段。第1章

问题描述 投票:0回答:2

我开始学习《Lisp in Small Pieces》这本书。例如,选定的球拍。但是第一章有一个代码示例(if (atom? e) 。什么是“atom?”?在哪里定义它?

lisp racket
2个回答
2
投票

Scheme 标准没有定义

atom?
;通常的定义是

(define (atom? x) 
  (and (not (pair? x))
       (not (null? x))))

0
投票

第 4 页有一个简短的提及,

(atom? exp)
的意思是
(not (pair? exp))

© www.soinside.com 2019 - 2024. All rights reserved.