wiki:Scheme

Scheme

All you need is lambda as Brian Harvey told us.

Here is a essence of Lisp captured in a few lines of Scheme:

schiptsov@imedia-S2100:~$ scheme
MIT/GNU Scheme running under GNU/Linux
Type `^C' (control-C) followed by `H' to obtain information about interrupts.

Copyright (C) 2012 Massachusetts Institute of Technology
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Image saved on Sunday December 2, 2012 at 1:32:54 PM
  Release 9.1.99    || Microcode 15.3 || Runtime 15.7 || SF 4.41
  LIAR/x86-64 4.118 || Edwin 3.116

1 ]=> (lambda x x)     ; all you need is lambda

;Value 13: #[compound-procedure 13]

1 ]=> ((lambda x x) 1)

;Value 14: (1)

1 ]=> ((lambda x x) 1 2 3)

;Value 15: (1 2 3)

1 ]=> ((lambda x x))

;Value: ()

1 ]=> ((lambda x x) (lambda x x))

;Value 16: (#[compound-procedure 17])

1 ]=> 

Here we should say OM or something appropriate.)

Last modified 8 years ago Last modified on Dec 6, 2012, 8:15:35 PM
Note: See TracWiki for help on using the wiki.