(for/list ((i (in-range 10))) (* 2 i))
(map (curry * 2) (build-list 10 (λ (x) x)))
(apply + (build-list 10000 (λ (x) x)))
(define wordlist '("Racket" "akka" "play framework" "sbt" "curring")) ; (define tweet "This is an example tweet talking about Racket and curring") ;
(findf (curryr regexp-match? tweet) wordlist)
(filter (curryr regexp-match? tweet) wordlist)
(file->string "file.txt") ; (file->lines "file.txt") ;
(for-each (λ (x) (display (string-append "Happy Birthday" (if x ", dear John" " to You") "\n"))) '(#f #f #t #f))
(for ((x (in-range 4))) (display (string-append "Happy Birthday" (if (= x 2) ", dear John" " to You") "\n")))
(display-lines (build-list 4 (λ (x) (string-append "Happy Birthday" (if (= x 2) ", dear John" " to You")))))
(partition (curry > 60) '(49 58 76 82 88 90))
(require net/url xml)
(define doc (read-xml (get-pure-port (string->url "http://search.twitter.com/search.atom?&q=racket"))))
(xml->xexpr (document-element doc))
(apply max '(14 35 -7 46 98)) (apply min '(14 35 -7 46 98))
(define data-list '(ABCDEFGH))
(define (process sym) (for ((n (in-range 10))) (display sym)))
(for ((x data-list)) (thread (λ () (process x))))
(define (eratosphen max) (let er ([lst null] [cur 2]) (cond [(> cur max) (reverse lst)] [(ormap (λ (x) (= (remainder cur x) 0)) lst) (er lst (add1 cur))] [else (er (cons cur lst) (add1 cur))])))
(let check ([cur 2] [n 113]) (cond [(= (remainder n cur) 0) #f] [(> (sqr cur) n) #t] [else (check (add1 cur) n)]))
Source: https://habr.com/ru/post/126606/
All Articles