Welcome to the CHICKEN Scheme pasting service

was ist her falsch?! pasted by saeftl on Thu Jan 26 17:43:50 2012

(define (ortdist-missing n1 n2)
    (let ((nl1 (string->list n1))
          (nl2 (string->list n2))
        (if (! (eq? (abs (- (length nl1) (length nl2))) 1)) 1 ;; not a one-char difference
            (let ((nl1 (if (> (length nl1) (length nl2)) nl1 nl2))
                  (nl2 (if (> (length nl1) (length nl2)) nl2 nl1)))
                    (define (allonedrops ls)
                        (let ((ret '()))
                            (for-each (lambda (i)
                                (append! ret (list (append (take ls i) (drop (drop ls i) 1)))))
                                (iota (length ls)))
                            ret))
            (any (lambda (l) (equal? l nl2)) (allonedrops nl1)))))))

fehlende klammer im ersten let added by C-Keen on Thu Jan 26 17:48:15 2012

(define (ortdist-missing n1 n2)
    (let ((nl1 (string->list n1))
          (nl2 (string->list n2)))
        (if (! (eq? (abs (- (length nl1) (length nl2))) 1)) 1 ;; not a one-char difference
            (let ((nl1 (if (> (length nl1) (length nl2)) nl1 nl2))
                  (nl2 (if (> (length nl1) (length nl2)) nl2 nl1))
                  (allonedrops (lambda (ls)
                                 (let ((ret '()))
                                   (for-each (lambda (i)
                                               (append! ret (list (append (take ls i) (drop (drop ls i) 1)))))
                                             (iota (length ls)))
                                   ret))))
            (any (lambda (l) (equal? l nl2)) (allonedrops nl1))))))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What's the procedure that returns the cdr of a cdr?
Visually impaired? Let me spell it for you (wav file) download WAV