Subject: Re: a view of comp lang [was: why we have cons]
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 1998/01/15
Newsgroups: comp.lang.lisp
Message-ID: <69kjeh$f26vl@fido.asd.sgi.com>

Richard Mlynarik  <Mly@ADOC.Xerox.COM> wrote:
+---------------
| It's perfectly possible -- and demonstrated by implementation -- to
| create a comfortable Scheme-like language which does not have
| a pair data type and in which lists are implemented entirely
| as a library.
| 
| (define cons (lambda (a b) (vector a b))
+---------------

Or even, as is sometimes shown in Scheme primers, pairs as closures:

	(define cons
	  (lambda (a b)
	    (lambda (fcn)
	      (cond
		((eq? fcn 'car) a)
		((eq? fcn 'cdr) b)
		(else (error "Bad selector to cons object"))))))

	(define car (lambda (x) (x 'car)))
	(define cdr (lambda (x) (x 'cdr)))

"Hey, it could happen..."  ;-}


-Rob

-----
Rob Warnock, 7L-551		rpw3@sgi.com   http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673 [New area code!]
2011 N. Shoreline Blvd.		FAX: 650-933-4392
Mountain View, CA  94043	PP-ASEL-IA