Comment on Lisp implementation in sedparentComments−bad_login12y ;; comparing with racket: (define (grade student) (cond [(excellent-work student) "A+"] [(and (okay-stuff student) (tried-hard student)) "B"] [(okay-stuff student) "B-"] [else "C"])) ;; Or (require racket/match) (define (grade student) (match (map (lambda (fn) (fn student)) '(excellent-work okay-stuff tried-hard)) [(list #t _ _) "A+"] [(list _ #t #t) "B"] [(list _ #t _) "B-"] [else "C"]))
Comments