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

quick question about scheme

Name: Anonymous 2015-11-06 22:20

and what's this craze about tail-recursion? they didn't like loops?

Name: Anonymous 2015-11-10 19:14

>>9
Most Schemes have it. If not, all you have to do is write a macro.
(define-struct foo (a b c))
; ->
(define foo-id (gensym))
(define (foo a b c) (list foo-id a b c))
(define (foo? x) (eq? (car x) foo-id))
(define (foo-a x) (assert (foo? x)) (cadr x))
(define (foo-b x) (assert (foo? x)) (caddr x))
(define (foo-c x) (assert (foo? x)) (cadddr x))

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