Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You should use an empty line to make a new paragraph, and then start every line with two spaces:

  #lang racket

  (define memo-table (box empty))
  (define-struct memo (key ans))

  (define (memoize f)
    (lambda args
      (local ([define lookup (filter (lambda (v)
                                       (equal? args (memo-key v)))
                                     (unbox memo-table))])
        (if (empty? lookup)
            (begin (local ([define ans (apply f args)])
                     (begin
                       (set-box! memo-table (cons (make-memo args ans)
                                                  (unbox memo-table)))
                       ans)))
            (memo-ans (first lookup))))))


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: