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

Pages: 1-

Rate my fibonacci program

Name: Anonymous 2013-08-27 8:08

(define (fib n)
  (((lambda (x) (x x))
    (lambda (fhelp)
      (lambda (remaining cpair)
        (if (zero? remaining)
          (cdr cpair)
          ((fhelp fhelp) (sub1 remaining) (cons (cdr cpair) (+ (car cpair) (cdr cpair))))))))
      n (cons 0 1)))

Name: Anonymous 2013-08-27 8:37

Too deeply indented. try again

Name: Anonymous 2013-08-27 8:39

>>2

I'm only using two spaces per indent dude. It's not that bad...

Name: Anonymous 2013-08-27 8:53

Nest Nest Nest Nest Nest Nest Nest Nest Nest Nest Nest Nest Nest Nest.

Name: Anonymous 2013-08-27 9:06

Name: Anonymous 2013-08-27 9:07

>>5 balls

Name: Anonymous 2013-08-27 9:10

>>4
There a problem with the given level of nesting? It's using the Y-Combinator to achieve anonymous recursion. I don't think I could use any less nesting here without abandoning that.

Name: Anonymous 2013-08-27 9:16

>>5,6
Get the fuck back to, uhh, I dunno, vBulletin.com?

Name: Anonymous 2013-08-27 9:18

>>7
I don't really think that's some sort of praiseworthy attribute that is worthy of keeping.

Name: Anonymous 2013-08-27 9:23

>>5
How about you fuck off back to the imageboards right now.

Name: Anonymous 2013-08-27 9:38

>>9

Well, that was the purpose of writing it like this. Otherwise you could just use function composition to solve it.

(define (fib n)
  (define (fhelp remaining cpair)
    (if (zero? remaining)
      (cdr cpair)
      (fhelp (sub1 remaining) (cons (cdr cpair) (+ (car cpair) (cdr cpair))))))
  (fhelp (cons 0 1)))


^ This is trivial. I wrote the Y-Combinator version to abstract a little further from it. Now it is defined as a single expression.

Name: Anonymous 2013-08-27 10:03

FIB MY ANUS

Name: Anonymous 2013-08-27 15:50

>>12

SAGE MY ANUS

Name: Anonymous 2013-08-27 20:02

>>5
>>12
>>13

This thread is not a testing spot for BBCode. Please stay on-topic

Name: Anonymous 2013-08-27 20:03

>>14
Please optimize your quotes, cretin.

Name: Anonymous 2013-08-27 20:09

Name: Anonymous 2013-08-27 23:50

>>15

Optimize yourself.

Name: Anonymous 2013-08-27 23:51

>>17
ok.

>>14
Optimize your quotes, cretin.

Name: Anonymous 2013-08-28 0:33

>>18

Why do you sage your post? Do you find something offensive about the thread?

Name: Anonymous 2013-08-28 0:41

>>19
Reported

Name: Anonymous 2013-08-28 1:01

>>19
Why do you think sage is an insult, /g/-kun?

Name: Anonymous 2013-08-28 1:32

>>21

Sage says "your thread is shit and I do not want others to see it"

Name: Anonymous 2013-08-28 1:44

>>21
Sage is only ``polite'' if it's a necropost or OP is posting in his own thread.

Name: Anonymous 2013-08-28 1:44

>>22
But following that logic, posting without sage says ``My comment is the most important thing on this board right now.''

Name: Anonymous 2013-08-28 2:01

>>24

Sage has nothing to do with your own comment though. Sage means "this thread is so shitty it doesn't deserve a bump". Threads regularly get bumped and brought to the top of the page all the time. Saging prevents a thread from going back up, and makes it more difficult to add new posters to the discussion.

Name: Anonymous 2013-08-28 2:10

>>25
That's completely incorrect, though.  Sage simply preserves the equilibrium.  Our tangential discussion is not about programming, is not really interesting, and should not be making this thread the first thing a /prog/ browser sees. You cannot deny that, so your posts should not be bumping the thread. If you have an actual insight that goes above and beyond the expectations of this thread, the repositioning of threads serves as a cue to readers.

For all your comments about `new readers,' your constant bumping of threads is not actually helpful to any of them.  If a reader cares about fibonacci programs, they will certainly find this thread.  If they don't, they won't appreciate this thread constantly jumping up and down in the order as they leisurely read through /prog/.  And they certainly won't appreciate it if the posts bumping the thread are unrelated to /prog/ at all, as these threads are.

If you feel it is somehow your responsibility to bump threads that you do not consider shit, you must have a moral obligation to browse through all seven hundred-odd pages of /prog/ and bump the threads you think everyone else should see.

Name: Anonymous 2013-08-28 2:11

>>22
What are you talking about. The only thing it means is that the thread doesn't get bumped to the top of the list. It has nothing to do with that.

Name: Anonymous 2013-08-28 2:14

>>27
ey doesn't know any better. This is too different from the imageboards.

Name: Anonymous 2013-08-28 7:42

Sage has nothing to do with your own comment though.
You are starting from false premise.

Name: Anonymous 2013-08-28 8:59

>>28
trans-faggot

Name: Anonymous 2013-08-28 9:47

>>30
Kill yourself, shitlord.

Name: Anonymous 2013-08-28 10:23

>>22
No, it doesn't. Please go back to /g/ and sage all the threads you don't like.

Name: Anonymous 2013-09-15 17:57

                            ██████████████████████                                                                          
          ██████████████████                      ████            ██████████████    ████    ██    ██  ██████    ████    ██    ██
        ██                      ██                    ████  ████████████████████  ██    ██  ██    ██  ██      ██    ██  ██  ██
        ██                  ████            ██            ████    ██████████████  ██        ████████  ████    ██        ████
          ██████████████████          ██████                ██    ██████████████  ██    ██  ██    ██  ██      ██    ██  ██  ██
                        ██        ████    ██                ██    ██████████████    ████    ██    ██  ██████    ████    ██    ██
                        ██████████        ██                ██    ██████████████                                            
                          ██          ████  ██              ██    ██████████████  ██████████  ██    ██  ██████  ██      ██  
                            ██████████      ██              ██    ██████████████      ██      ██    ██  ██      ████  ████  
                              ██        ████  ██            ██    ██████████████      ██      ████████  ████    ██  ██  ██  
                                ████████      ██            ██    ██████████████      ██      ██    ██  ██      ██      ██  
                                ██        ████              ██    ██████████████      ██      ██    ██  ██████  ██      ██  
                                  ████████            ████████    ██████████████                                            
                                          ████████████      ████████████████████                                            
                                                                  ██████████████

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