On Tue, May 17, 2011 at 3:14 PM, Sam Tobin-Hochstadt <sa...@ccs.neu.edu>
wrote:
> Lots of people have written similar things (`cut' in SRFI 26, Jay's
> `super-cut', etc), but I'd like to move towards using it implicitly.

I use (require (rename-in srfi/26 [cut //])) and that's simple enough for
me. I find the implicit version harder to read. You have to read further to
the right before realizing you are inside a function, and it is easy to
miss.

Here are two example from my code of how it looks.

(define common-confusions
 (count-instances
  (filter-not all-the-same?
              (map (// sort <> <)
                   (map (// take <> 2) summary)))))


(define (non-whitespace-diff? . strings)
 (define collapsed (map (// regexp-replace* #px"[[:space:]]{2,}" <> " ")
strings))
 (not (andmap (// equal? (first collapsed) <>) (rest collapsed))))
_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

Reply via email to