Minimal scheme interpreter

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Write a minimal interpreter for Scheme.

Procedures must be supported:
(display X)
(newline)
(define X Y)
(set! X Y)
(+ X Y)
(- X Y)
(/ X Y)
(* X Y)
(equal? X Y)
(if X Y Z)
(begin X ...)
(lambda (X Y Z ...) BODY)

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

(display (+ 1 2))

Sample output:

3

Sample input:_

(define (accgen n)
  (lambda (i)
    (set! n (+ n i)
    n))

(let ((acc (accgen 4))
  (display (acc 1)) (newline)
  (display (acc 3)) (newline)
  (display (acc 50)))

Sample output:

5
8
58

Sample input:_

(define (fact n)
  (if (equal? n 0)
      1
      (* n (fact (- 1 n)))))

(display (fact 4))

Sample output:

24

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1ozy4dm250.24242008/01/23 08:25:560B / 8B / 15B
2leonid250.07502008/01/24 01:10:270B / 8B / 15B
3shinh310.12302008/02/01 02:38:200B / 17B / 12B
4eban310.20102008/02/01 02:52:340B / 17B / 13B
5oto-oto-oto410.10382008/01/21 21:05:490B / 18B / 20B
6leonid230.16092008/10/03 14:01:432B / 6B / 14B
7leonid (alnum)680.16072008/09/28 05:56:050B / 42B / 0B

Perl _

RankUserSizeTimeDateStatistics
1ott(embed)320.10862008/01/21 01:19:290B / 14B / 16B
2nuko320.13282008/01/21 19:56:350B / 14B / 16B

Python _

RankUserSizeTimeDateStatistics
1elb320.14072008/01/19 12:04:520B / 19B / 13B
2kt3k320.18642008/01/22 17:44:160B / 19B / 13B
3hirose320.13152008/01/24 09:36:230B / 17B / 15B

PHP _

RankUserSizeTimeDateStatistics
1o-cn350.01072009/12/14 02:19:280B / ?B / ?B
2pooq410.39582008/10/06 22:43:280B / 19B / 20B

Scheme _

RankUserSizeTimeDateStatistics
1ksk520.06472008/02/02 03:18:080B / 35B / 15B
2pla670.08832008/01/31 23:15:470B / 39B / 26B
3murky-satyr470.08492008/06/25 02:43:030B / 31B / 14B

Common LISP _

RankUserSizeTimeDateStatistics
1kozima560.25362008/01/21 13:20:200B / 30B / 22B
2ttmh530.05492014/08/29 18:28:310B / 30B / 20B

Arc _

RankUserSizeTimeDateStatistics
1pooq4010.85952009/10/06 19:51:060B / 22B / 15B

Io _

RankUserSizeTimeDateStatistics
1poop653.03682008/01/28 17:45:220B / 49B / 11B
2murky-satyr412.48672008/03/17 09:41:340B / 29B / 9B

JavaScript _

RankUserSizeTimeDateStatistics
1murky-satyr360.06942008/01/31 23:23:000B / 22B / 13B

Lua _

RankUserSizeTimeDateStatistics
1murky-satyr440.01042008/06/05 08:20:120B / 23B / 21B

Tcl _

RankUserSizeTimeDateStatistics
1pooq680.06962009/11/16 17:51:090B / 44B / 13B

Xtal _

RankUserSizeTimeDateStatistics
1pooq440.06892010/08/23 01:21:030B / 26B / 16B

Icon _

RankUserSizeTimeDateStatistics
1pooq580.07472012/04/02 12:35:410B / 35B / 20B

Smalltalk _

RankUserSizeTimeDateStatistics
1murky-satyr450.39772008/01/31 23:24:590B / 29B / 13B
2murky-satyr420.49752008/06/05 08:17:500B / 28B / 11B

Prolog _

RankUserSizeTimeDateStatistics
1pooq530.13282009/02/26 23:04:420B / 30B / 19B

BASIC _

RankUserSizeTimeDateStatistics
1poop610.07122008/01/25 11:38:240B / 35B / 16B
2*yuko*431.82482009/06/24 09:54:480B / 25B / 16B

Perl6 _

RankUserSizeTimeDateStatistics
1pooq246.52012010/08/10 19:28:000B / 14B / 8B

J _

RankUserSizeTimeDateStatistics
1poop310.19162008/01/27 03:46:490B / 16B / 13B
2pooq280.22402008/09/16 12:17:060B / 14B / 12B

A+ _

RankUserSizeTimeDateStatistics
1pooq410.03772009/12/06 04:07:590B / 20B / 18B

K _

RankUserSizeTimeDateStatistics
1pooq210.06902012/03/19 17:07:070B / 9B / 10B

C _

RankUserSizeTimeDateStatistics
1ozy4dm370.04472008/01/23 08:14:472B / 21B / 14B

OCaml _

RankUserSizeTimeDateStatistics
1ksk540.24902008/01/24 01:08:050B / 30B / 21B
2m.ukai650.11272008/01/25 14:46:130B / 40B / 23B

Haskell _

RankUserSizeTimeDateStatistics
1notogawa(embed)600.02072008/01/25 23:40:450B / 39B / 15B

Ada _

RankUserSizeTimeDateStatistics
1D1700.04732008/01/29 11:23:100B / 119B / 38B

Pascal _

RankUserSizeTimeDateStatistics
1pooq540.08392009/01/25 08:11:240B / 34B / 13B

Fortran _

RankUserSizeTimeDateStatistics
1*yuko*490.00132009/08/12 11:57:400B / 28B / 21B

Curry _

RankUserSizeTimeDateStatistics
1pooq600.06602009/11/14 03:04:510B / 37B / 13B

Maxima _

RankUserSizeTimeDateStatistics
1pooq540.28712010/01/17 16:29:180B / 31B / 21B

REBOL _

RankUserSizeTimeDateStatistics
1pooq490.21942009/02/14 21:11:490B / 32B / 11B

Asymptote _

RankUserSizeTimeDateStatistics
1pooq523.21682009/03/26 10:16:300B / 28B / 22B

AWK _

RankUserSizeTimeDateStatistics
1nn320.04502008/06/18 18:58:050B / 13B / 19B
2_320.02212010/05/27 19:00:330B / ?B / ?B

sed _

RankUserSizeTimeDateStatistics
1eban250.01942008/01/20 22:40:060B / 14B / 6B

wake _

RankUserSizeTimeDateStatistics
1pooq380.02232010/07/20 15:52:180B / 11B / 24B

Postscript _

RankUserSizeTimeDateStatistics
1yshl(bin)260.52552008/02/05 05:33:258B / 15B / 1B
2yshl340.51962008/02/05 05:33:020B / 24B / 3B

R _

RankUserSizeTimeDateStatistics
1pooq343.71622008/05/31 15:04:000B / 19B / 13B

Brainfuck _

RankUserSizeTimeDateStatistics
1nuko1050.03032008/01/23 22:04:270B / 0B / 105B

GolfScript _

RankUserSizeTimeDateStatistics
1leonid180.29662008/01/24 23:29:510B / 8B / 7B

FlogScript _

RankUserSizeTimeDateStatistics
1pooq200.11512010/09/09 19:54:500B / 8B / 9B

Vim _

RankUserSizeTimeDateStatistics
1nn360.06822009/12/13 22:37:192B / 16B / 17B

goruby _

RankUserSizeTimeDateStatistics
1leonid200.16862008/01/24 23:25:350B / 10B / 7B

Groovy _

RankUserSizeTimeDateStatistics
1murky-satyr478.61152008/03/17 08:32:410B / 30B / 16B

Scala _

RankUserSizeTimeDateStatistics
1pooq4510.25522011/02/27 22:03:350B / 31B / 14B

Logo _

RankUserSizeTimeDateStatistics
1pooq332.50532011/03/21 20:41:550B / 22B / 4B

Language Ranking_

RankLangUserSizeScore
1GolfScriptleonid1810000
2gorubyleonid209000
3FlogScriptpooq209000
4Kpooq218571
5Rubyleonid237826
6Perl6pooq247500
7sedeban257200
8Postscriptyshl(bin)266923
9Jpooq286428
10Pythonelb325625
11Perlott(embed)325625
12AWKnn325625
13Logopooq335454
14Rpooq345294
15PHPo-cn355142
16JavaScriptmurky-satyr365000
17Vimnn365000
18Cozy4dm374864
19wakepooq384736
20Arcpooq404500
21Iomurky-satyr414390
22A+pooq414390
23Smalltalkmurky-satyr424285
24BASIC*yuko*434186
25Luamurky-satyr444090
26Xtalpooq444090
27Scalapooq454000
28Groovymurky-satyr473829
29Schememurky-satyr473829
30REBOLpooq493673
31Fortran*yuko*493673
32Asymptotepooq523461
33Prologpooq533396
34Common LISPttmh533396
35OCamlksk543333
36Pascalpooq543333
37Maximapooq543333
38Iconpooq583103
39Haskellnotogawa(embed)603000
40Currypooq603000
41Tclpooq682647
42Brainfucknuko1051714
43AdaD1701058

return top