News for hackers. Stuff that matters.
Re:Once you go functional, you can never go back by lispm on Monday May 18, 2015 @01:11PM (#9565597)
Seeing all this incorrect Scheme code hurts...

    (define (lastHalf L N)
      (if (= N 0) L); Base Case
      (if (or (= N 1) (< N 2))
          (cdr L)
          ;else
          (lastHalf (cdr L) (- N 1)))
          )

    Would be:

    (define (last-half L N)
      (if (= N 0)
         L
        (if (< N 2)
          (cdr L)
          (last-half (cdr L) (- N 1)))))

There are no comments on this comment yet.