home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / elk-2_0.lha / elk-2.0 / examples / scheme / kons < prev    next >
Encoding:
Text File  |  1991-09-25  |  224 b   |  14 lines

  1. ;;; -*-Scheme-*-
  2.  
  3. (define (kons left right)
  4.   (lambda (op)
  5.     (case op
  6.       (a left)
  7.       (d right))))
  8.  
  9. (define (kar cell) (cell 'a))
  10. (define (kdr cell) (cell 'd))
  11.  
  12. (let ((k (kons 1 2)))
  13.   (print (cons (kar k) (kdr k))))
  14.