Skip to content

Commit 7872993

Browse files
committed
Only exceptional special form keywords are exceptions
Addresses #6, but not in the way the poster desires. The purpose of highlighting language keywords is to provide affirmation that the keyword exists and is spelled correctly. The purpose of coloring keywords differently is to convey information about their utility and limitations. My colorscheme highlights macros as blue, so I am instantly reminded when I see a blue word that I should not pass it as a higher-order function. Similarly, if, def, and let are arguably the most important primitive elements of a Lisp, and coloring them together with the handful of other special forms convey information about their performance and composability that would be lost when lumping them together by their logical classification. The Exception group is exceptional in that the utility of coloring 'try' 'catch' 'finally' and 'throw' differently to stand out from all other keywords supersedes the fact they are special forms since it is commonly expected that the exception-handling syntax of a language is itself exceptional.
1 parent 9c2372d commit 7872993

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

genkeywords.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
;; http://clojure.org/special_forms
1717
["Special" '[def if do let quote var fn loop recur throw try
1818
catch finally monitor-enter monitor-exit . new set!]]
19-
;; The duplicates from Special are intentional
19+
;; The duplicates from Special are intentional here
2020
["Exception" '[try catch finally throw]]
21-
["Cond" '[if if-not if-let when when-> when->> when-not
21+
["Cond" '[if-not if-let when when-> when->> when-not
2222
when-let when-first cond condp case]]
2323
["Repeat" '[map mapv mapcat reduce reduce-kv filter filterv
2424
for doall dorun doseq dotimes map-indexed keep

0 commit comments

Comments
 (0)