Lisp Scheme Part22at TECH
Lisp Scheme Part22 - 暇つぶし2ch578:デフォルトの名無しさん
08/06/14 11:07:37
(list? '(1 . 2)) ;=> #f
(list? '()) ;=> #t
(list? '(1 2)) ;=> #t

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

(listp '(1 . 2)) ;=> #t
(listp '()) ;=> #f
(listp '(1 2)) ;=> #t

(define (non-nil-list? x)
 (and (not (null? x))
    (list? x)))

(non-nil-list? '(1 . 2)) ;=> #f
(non-nil-list? '()) ;=> #f
(non-nil-list? '(1 2)) ;=> #t


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch