Thank you for your comment

Beau­tiful Racket / explainers

  1. (equal? gorilla-weight "800lb") ; prefix notation
    (gorilla-weight . equal? . "800lb") ; infix notation
    1
    2
    (equal? gorilla-weight "800lb") ; prefix notation
    (gorilla-weight . equal? . "800lb") ; infix notation
    
    copy to clipboard
  2. (taller-than? alice bob) ; prefix notation
    (apply taller-than? (list alice bob)) ; `apply` notation
    1
    2
    (taller-than? alice bob) ; prefix notation
    (apply taller-than? (list alice bob)) ; `apply` notation
    
    copy to clipboard
    (filter even? (range 5)) ; '(0 2 4)
    1
    (filter even? (range 5)) ; '(0 2 4)
    
    copy to clipboard
    (filter (λ (x) (zero? (modulo x 2))) (range 5))
    ; also '(0 2 4)
    1
    2
    (filter (λ (x) (zero? (modulo x 2))) (range 5))
    ; also '(0 2 4)
    
    copy to clipboard
← prev next →