wiki:Languages/Scheme

Version 4 (modified by schiptsov, 3 years ago) ( diff )

--

Scheme

Esoteric expressions

((lambda x x) (lambda x x))
(define id ((lambda (x) x) (lambda (x) x)))
((lambda xs xs))
(define list (lambda xs xs))
(define (atom? x) (not (pair? x)))

Lists

'() is a List case analysis

(define (list? xs)
  (cond ((null? xs) #t)
        ((and (pair? xs) (null? (cdr xs))) #t)
        (else #f)))
(define (list? xs)
  (or (null? xs) (and (pair? xs) (null? (cdr xs)))))

==

Newton's method


see also Standard ML

Note: See TracWiki for help on using the wiki.