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 17:43

>>39
Yay! Undefined behaviour makes interface simple, correct, consistent and complete! Yay! Scheme! So randum! Yay!

Name: Anonymous 2011-12-24 17:45

>>40
You antisemite-nazi scum! JWZ is one of the best jewish programmers, even Spolsky says so!

Name: Anonymous 2011-12-24 18:05

>>42

well, he isn't necessarily an idiot, but he says many idiotic things in the website, and it looks like it is just an effort to get his name out there.

>>41

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.

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.

Name: Anonymous 2011-12-24 18:42

>>44

But specifying things like that prevent implementations from providing the main functionality in the fastest way possible. I gather the problem with the memcpy thing is that some implementations would copy from back to front, while others would copy from front to back, causing strange effects if the regions overlapped? So if you specified the order of the copy, then overlapping in one direction would always work, and overlapping in the other would always fail. But what if you had some processor A that could implement back to front copying really fast (maybe it had a single instruction for it or something), and it couldn't do it the other way as quickly. The order of the copying is irrelevant for correct usages of memcpy, and insisting that the slower order always be taken will piss off people using processor A who use memcpy the correct way. The solution isn't to make memcpy do memmove, it's to educate people to use memmove when needed instead of depending on undefined behavior of memcpy, and to use memcpy when memcpy's behavior is defined.

Name: Anonymous 2011-12-24 19:11

Again, it's not undefined behaviour, let's sematics are well-defined. The definition is, the evaluation order is unspecified. If you want, you can rephrase that as ``every expression is conceptually evaluated at the same time''. Goddamn /g/tards.

Name: Anonymous 2011-12-24 19:31

>>44
The correct course of action is not to assume undefined behaviour as valid behaviour.

Name: Anonymous 2011-12-24 19:35

>>45
But specifying things like that prevent implementations from providing the main functionality in the fastest way possible. I
So, for you speed is more important than simplicity and consistency? Why wont you use C/C++ or Fortran then?

Name: Anonymous 2011-12-24 19:36

>>47
The correct course of action is to eliminate undefined behaviour.

Name: Anonymous 2011-12-24 19:41

>>46
If you want, you can rephrase that as ``every expression is conceptually evaluated at the same time''.
You can close your eyes, but it wont change the order.

Name: Anonymous 2011-12-24 19:57

>>32
>I hate lazy lists
>I KNOW, I'LL CREATE TWO THREADS EQUIVALENT TO ONE THREAD WITH A LAZY LIST
ENTERPRISE PROGRAMMING

Name: Anonymous 2011-12-24 20:04

>>50

Actually, my scheme implementation interfaces with my web cam to detect when I've closed my eyes, and it then evaluates let, letrec, and map using random order, and when my eyes are open, it evaluates them from front to back.

Name: Anonymous 2011-12-24 20:06

>>51

I love lazy lists, which is why I choose to use an implementation of lazy lists that allows me to use a function call stack when generating the elements of the lazy list.

Name: Anonymous 2011-12-24 21:40

HASKAL
Lazy shit doesnt do anything until it has to show its doing its job.

Name: Anonymous 2011-12-25 13:05

>>54
lisp is shit.

Name: Anonymous 2011-12-27 4:20


[sub]my[/sub]anus[sub]all[/sub]

Name: Anonymous 2011-12-27 4:21

myanusall

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