Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Man or boy test.

Name: Anonymous 2014-05-25 5:37

http://rosettacode.org/wiki/Man_or_boy_test

So, how does your weapon of choice fare?

Name: Anonymous 2014-05-26 10:09

My Scheme interpreter passes the test with:

(define A (lambda (k x1 x2 x3 x4 x5)
(define B (lambda ()
(set! k (- k 1))
(A k B x1 x2 x3 x4)))
(if (<= k 0)
(+ (x4) (x5))
(B))))

(display (A 10 (lambda () 1) (lambda () -1) (lambda () -1) (lambda () 1) (lambda () 0)))


GC doesn't run into any problems, either.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List