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

letrec

Name: Anonymous 2011-12-23 12:06

Isn't
(letrec ([is-even? (lambda (n)
                    (or (zero? n)
                        (is-odd? (sub1 n))))]
         [is-odd? (lambda (n)
                   (and (not (zero? n))
                        (is-even? (sub1 n))))])
        (is-odd? 11))


equivalent to...

(let
    ([is-even? nil]
     [is-odd? nil])
    (set! is-even? (lambda (n)
                    (or (zero? n)
                        (is-odd? (sub1 n)))))
    (set! is-odd? (lambda (n)
                   (and (not (zero? n))
                        (is-even? (sub1 n)))))
    (is-odd? 11))

Name: Anonymous 2011-12-24 18:24

>>43
you seem to think you can learn everything you need to know about scheme by reading one critical article written by one dude on the internet. Try using it and develop your own opinion.
Cant you see, undefined behaviour just invites bugs: a little change in compiler's eval-order could break your whole program.

http://www.cygwin.com/ml/glibc-bugs/2011-02/msg00090.html
That is why Unix sucks. They changed memcpy implementation and broke tons of code that depended on undefine behavior. But Worse is Better, of course.

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