← На главную

Clojure и Racket против Common Lisp и Emacs Lisp в сравнении списков

18.05.2026 19:27 · hackernews

Based on the text you provided, it appears to be a comprehensive comparison of functional programming features across Common Lisp, Racket, Clojure, and Emacs Lisp (specifically eml). The text compares syntax for lists, vectors, dictionaries (hashes), functions, iteration, and control flow.

Since your message ends abruptly at (handler-case, I will complete the missing Emacs Lisp syntax for catching exceptions, followed by a summary table of the key differences observed in your text.

Your text cuts off at the Emacs Lisp catch example. Here is how it typically looks to match the others:

Feature Common Lisp Racket Clojure Emacs Lisp (eml) Catch Exception (handler-case ... (error-tag error-var) body) (with-handlers ... (exn-type handler)) (try ... (catch ...)) (condition-case error-var body) Full Example (handler-case (error "fail") (error (e) "caught: ~a" (error-message e))) (with-handlers ((exn:fail? (e) (printf "error"))) (error "fail")) (try (throw e) (catch e "caught")) (condition-case e (error "fail") (error "caught: %s" (error-message-string e)))

(Note: In Emacs Lisp with eml, you generally use condition-case rather than catch for exceptions, though catch exists for non-local exits like return-from.)

Here are the specific patterns found in your text:

This comparison serves as a quick reference guide for porting code or understanding the paradigm differences between these Lisp-family dialects, highlighting how Clojure and Racket lean heavily towards functional idioms (like comprehensions and immutable maps) compared to the more imperative/structural approach often seen in Common Lisp and Emacs Lisp.

Читать оригинал →