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

Pages: 1-

Scheme

Name: Anonymous 2012-10-04 23:43

I just made a sweet, efficient implementation of map
Scheme is awesome!

Check it outtttt
(define (map! f l)
  (if (not (null? l))
    (begin
      (set-car! l (f (car l)))
      (map! f (cdr l)))))

Name: Anonymous 2012-10-05 1:53

that's possible in like 1 line of javascript

which is why it's the new scheme

Name: Anonymous 2012-10-05 1:57

>>2
(define (map! f l) (if (not (null? l)) (begin (set-car! l (f (car l))) (map! f (cdr l)))))
It's possible in 1 line of Scheme too!

Name: Anonymous 2012-10-05 8:25

>>1
set-car!
Disgusting.

Name: Anonymous 2012-10-05 10:11

[code](shalom! hymie)[code]

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